libunwind-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] retrieve Stack Trace of all threads from Current


From: Arun Sharma
Subject: Re: [Libunwind-devel] retrieve Stack Trace of all threads from Current process
Date: Mon, 3 May 2010 09:54:15 -0700

On Fri, Apr 30, 2010 at 2:47 AM, POKHARAKAR Sandeep <address@hidden> wrote:

The steps I followed to achieve this are:

unw_getcontext =>

unw_create_addr_space => passed unw_accessors_t.

_UPT_create => passed process id and thread ids.

unw_init_remote => passed above return value.

unw_step => to walk the stack frames


You'll need to iterate over all threads in the process and stop them first, before you can examine their stack traces. Doing this in a deadlock free way may be tricky. Please look at tests/test-ptrace.c for an example. It doesn't exactly do what you want, but the same general outline should apply.

Once you've gathered the stack traces, you should be able to continue via SIGCONT.

 -Arun
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]