omjavaid added inline comments.

================
Comment at: 
packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py:78
+
+        while count < 4 :
+         
----------------
labath wrote:
> This is quite racy.
> 
> There is nothing that guarantees that we will stop on the breakpoint at least 
> four times. In particular, it can happen that all 8 threads hit the 
> breakpoint simultaneously, and then you have only one stop of the whole 
> process. If you want to have more than one stop you need to either:
> - make sure that no two threads can hit the breakpoint simultaneously (e.g., 
> add some kind of a mutex in the inferior),
> - or count the stops more diligently (after each stop, count the number of 
> threads stopped at the location, as in e.g. TestConcurrentEvents)
> 
> However, if the purpose of this test is to make sure the breakpoint applies 
> to newly-created threads, then I think you don't need than many threads, and 
> one thread would suffice. Then the test could be:
> - set a breakpoint
> - inferior spins up a thread and hits it
> - remove/disable the breakpoint
> - inferior joins the first thread
> - inferior spins up another thread which does *not* hit the breakpoint
> This should make debugging any failures easier as the test is more 
> deterministic.
Agreed!! I ll post an alternative then.

Thanks!


https://reviews.llvm.org/D29669



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to