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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With