문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top