Assume that we have a single thread program and we hope to capture the value of program counter (PC) when a predefined interrupt occurs (like a timer interrupt).

It seems easy as you know we just write a specific assembly code using a special keyword "__asm__" and pop the value on the top of the stack after making a shift 4 byte.

What about Multithreaded programs ?

How can we get values of all threads from another thread which run in the same process? (It seems extremely incredible to get values from thread which run on a separate core in multi-core processors).

(in multithreaded programs, every thread has its stack and registers too).

any help, I am grateful to you.

More Hussein Al-haj Ahmad's questions See All
Similar questions and discussions