smeis
smeis

Reputation: 151

How can I jump to a different thread at the top of the stack in LLDB?

Using LLDB you can move up and down through the frames on the stack using the up and down commands or select a specific frame. When you've reached to top of the stack, is it possible to jump to the thread that spawned the execution of the code happening on the current thread?

Upvotes: 0

Views: 572

Answers (1)

Jim Ingham
Jim Ingham

Reputation: 27110

No. "Originating thread" is not the sort of thing that threading systems keep track of (or rather pthreads doesn't and I've not heard of one that does...)

If you are using libdispatch to handle threading operations, then you can start up with the "introspection" version of libdispatch (in /usr/lib/introspection) and then the command:

(lldb) thread backtrace -e

will print the stacks from the chain of originating threads at the time the work item being done on the current thread was enqueued. Xcode will show this to you by default. Of course these are not live backtraces, so you won't be able to inspect stack memory and the like.

Upvotes: 1

Related Questions