[Lldb-commits] [PATCH] D29669: Hardware breakpoints implementation for Arm/AArch64 targets
Muhammad Omair Javaid via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Feb 22 19:44:39 PST 2017
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 :
> 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.
More information about the lldb-commits