[Lldb-commits] [lldb] r335476 - Fix TestThreadExit for gcc&libc++ combo

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 25 07:28:38 PDT 2018


Author: labath
Date: Mon Jun 25 07:28:38 2018
New Revision: 335476

URL: http://llvm.org/viewvc/llvm-project?rev=335476&view=rev
Log:
Fix TestThreadExit for gcc&libc++ combo

pseudo_barrier_wait() begins by decrementing an atomic variable. Since
these are always_inline in libc++, there is no line table anchor to
break on before we decrement it. This meant that on gcc we stopped after
the variable has been decremented, which meant that thread2 could have
exited, violating the test setup. On clang this wasn't a problem
because it generated some line table entries for the do{}while(0) loop
in the macro, so we still ended up stopping, before we touched the
variable.

I fix this by adding a dummy statement before the pseudo_barrier_wait()
command and setting the breakpoint there.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp?rev=335476&r1=335475&r2=335476&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp Mon Jun 25 07:28:38 2018
@@ -64,7 +64,8 @@ int main ()
     thread_1.join();
 
     // Synchronize with the remaining thread
-    pseudo_barrier_wait(g_barrier3);                  // Set third breakpoint here
+    int dummy = 47;                   // Set third breakpoint here
+    pseudo_barrier_wait(g_barrier3);
 
     // Wait for the second thread to finish
     thread_2.join();




More information about the lldb-commits mailing list