[lldb-dev] Running other threads while stepping

Ed Maste emaste at freebsd.org
Thu Sep 5 14:25:43 PDT 2013


I'm making good progress with the FreeBSD target thread support, but
see some differences in behaviour between my work and the Linux
support.  (Thanks to Mike Sartain for sending me debug logs of the
Linux case.)

I'm using a version of Mike's pthread sample code that I've modified
for portability; it's available at
https://raw.github.com/emaste/snippets/master/mikesart_pthread.c if
anyone's interested.  The test code spawns a couple of threads and
sleep()s in those threads.  In my test I set breakpoints on both
sleep() calls and run the process.  After hitting a breakpoint I
'step-in' or 'step-over' the sleep(), and I end up stopping on a
breakpoint in another thread, rather than moving to the next source
line.  Mike's log on Linux doesn't show this; the process carries on
with the next line.

SVN r166732 has the commit message "Found a couple more places where
we need to run all threads when stepping," and as described it does
introduce cases where all threads are run for a step-in or step-over.
For whatever reason this affects the ThreadPlans I encounter on
FreeBSD, but not Linux.

I'm curious about the reason this change was made, and whether the
Linux behaviour or mine is expected.  I can see arguments both ways,
but would expect the behaviour to be consistent on both platforms.



More information about the lldb-dev mailing list