libunwind-devel
[Top][All Lists]
Advanced

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

Re: [Libunwind-devel] retrieve local variables and their values


From: Tommi Rantala
Subject: Re: [Libunwind-devel] retrieve local variables and their values
Date: Tue, 11 Sep 2012 11:34:07 +0300

2012/9/11 Marion Guthmuller <address@hidden>:
> Hi,
>
> I'm currently using your library for the comparison of stacks at different
> execution times of my program and I'd like to retrieve local variables and
> compare their values. I didn't find information about that on your website,
> is it possible with libunwind ?

Hi, as far as I can tell, there is no easy way to get the locals.

If you're desperate, you could try to see how the compiler optimized
your code, and for example if a local variable is kept in a register,
you could read the value with unw_get_reg(). This would of course be
extremely fragile.

AFAIK gdb has reasonably good scripting capabilities, so you could
look into those.

Also, if you only want to see the values of function arguments, then
that might be easier to do. You could look into these tools if you're
interested:
http://maemo.gitorious.org/maemo-tools/functracer
http://maemo.gitorious.org/maemo-tools/sp-rtrace

Tommi



reply via email to

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