[Top][All Lists]

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

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

From: Marion Guthmuller
Subject: Re: [Libunwind-devel] retrieve local variables and their values
Date: Tue, 11 Sep 2012 11:10:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120624 Icedove/10.0.5

Le 11/09/2012 10:34, Tommi Rantala a écrit :
2012/9/11 Marion Guthmuller <address@hidden>:

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


Ok, thanks a lot for your information. I want to retrieve all local variables, not just function arguments.

I looked for other solutions and I hoped that libunwind could help me but I think that DWARF is the most suitable solution in my case.

Thanks again for your answer.

Marion G.

reply via email to

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