Question

Is it possible to programatically print out stack trace of all running threads without attaching GDB? The application is running on an embedded system with Linux.

I've found a very similar thread but the solution uses a special GDB command.

Was it helpful?

Solution

This has been solved with the help of this thread and this thread.

Quoting:

Signal Handling with the help of backtrace can solve your purpose.

I mean if you have a PID of the Thread, you can raise a signal for that thread. and in the handler you can use the backtrace. since the handler would be executing in that partucular thread, the backtrace there would be the output what you are needed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top