[Lldb-commits] [PATCH] D58394: Add --auto-continue to stop-hooks, fix up a few tests

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 20 01:34:08 PST 2019

labath added a comment.

Thank you for jumping onto this. I've tried the patch out on linux, and the stop-hook-threads.test now passes. However, the basic test now fails for me because the stop hook isn't fired in the "run" command. it is caused by the "is hijacked" check in `ProcessEventData::DoOnRemoval`, as removing that condition causes to hook to fire, but that's probably not the right thing to do here. The difference here is probably caused by PlatformLinux hijacking the process events during the launch sequence https://github.com/llvm-mirror/lldb/blob/76c0545e7f24cd6636df61292472df64cfa2900e/source/Plugins/Platform/Linux/PlatformLinux.cpp#L337, but I am not sure where is the error here. I definitely know that there is something fishy going on in PlatformLinux, as e.g. we don't get a "Process XXX stopped" message when launching with the --stop-at-entry flag, so it's quite possible the error is there. If you think that the general behavior is right there, then we can just XFAIL this test for linux, and one of us will get to fixing PlatformLinux eventually.

Comment at: lit/ExecControl/StopHook/stop-hook-threads.test:36
 # When we don't filter, we expect to count 12 stopped threads in the thread list output
-# CHECK-NO-FILTER-COUNT-12: at stop-hook-threads.cpp{{.*}} stop reason = breakpoint
\ No newline at end of file
+# CHECK-NO-FILTER-COUNT-12: , stop reason = breakpoint 3.1
BTW, this check is fairly dodgy, because in the case of two threads hitting a breakpoint simultaneously, we will get 4 stop reasons instead of two ("thread list" will be executed twice, and each instance will print the stop reason for both threads). It might be better to replace "thread list" with a different command, or add synchronization to the test to prevent two threads from hitting the breakpoint at once, depending on what we want to test.




More information about the lldb-commits mailing list