[lldb-dev] [Bug 25046] New: SBProcess::Stop stops only the main thread, not all threads
lldb-dev at lists.llvm.org
Sun Oct 4 12:04:03 PDT 2015
Bug ID: 25046
Summary: SBProcess::Stop stops only the main thread, not all
Component: All Bugs
Assignee: lldb-dev at lists.llvm.org
Reporter: berykubik at gmail.com
CC: llvm-bugs at lists.llvm.org
Created attachment 14997
C++ app with two threads doing an endless printing loop
When I have more threads in an app and I call SBProcess::Stop, only the main
thread stops and the rest of the threads continue.
The description of SBThread::Suspend states: "LLDB currently supports process
centric debugging which means when any thread in a process stops, all other
threads are stopped.".
I attached a simple C++ app that spawns a thread with the pthread library. Both
the main and the second thread print a message and then sleep for a while, when
I stop the process with SBProcess::Stop, the main thread stops printing, but
the other thread keeps printing the message and it's property is_stopped
Do I need to do anything else to stop the other threads? I don't know how I
could stop them, as they don't have a stop method (apart of SBThread::Suspend,
but that serves a different purpose as far as I know).
Here's a minimal code example that shows that only the main thread gets stopped
(it prints True, False instead of True, True).
debugger = lldb.SBDebugger.Create()
target = debugger.CreateTargetWithFileAndArch("./test", lldb.LLDB_ARCH_DEFAULT)
process = target.LaunchSimple(, , os.getcwd())
time.sleep(3) # ensure second thread is started
for t in process:
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the lldb-dev