libunwind-devel
[Top][All Lists]
Advanced

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

Re: [libunwind] walking the callstack on an x86 machine


From: matthew
Subject: Re: [libunwind] walking the callstack on an x86 machine
Date: Mon, 18 Sep 2006 14:14:18 -0300

Alex,

If you are running Linux, check out the 'backtrace' call.  It is likely to give you what you want.

You can also check out the setjmp method of walking the stack.  See the source code at:

http://groups.google.com/group/comp.unix.programmer/browse_thread/thread/fd4bf9c8a38bdd48/3e7fd5d3f7841fcc?lnk=st&q=backtrace+++FLUSHWIN&rnum=1&hl=en#3e7fd5d3f7841fcc

Matthew Fisher
Dynamic Memory Solutions
www.dynamic-memory.com



---------- Original Message -----------
From: "Alex Shye" <address@hidden>
To: "David Mosberger-Tang" <address@hidden>
Cc: address@hidden
Sent: Mon, 18 Sep 2006 12:57:59 -0400
Subject: Re: [libunwind] walking the callstack on an x86 machine

> Hi David,
>
> Thanks for the reply.  I don't know much about the DWARF format I as I understand, it is included with compiling with debug information, correct?
>
> I guess I didn't state my question clearly enough, but what if you only have stripped binaries without any debug information to work with?  Are there any resources for stack walking in such a scenario?
>
> Thanks,
>
> --alexshye
>
> On 9/18/06, David Mosberger-Tang <address@hidden> wrote:

Alex,
>
> On 9/15/06, Alex Shye <address@hidden > wrote:
>
> > I have been looking around for information on how to accurately and
> > efficiently walk the call stack on an x86 machine and figured it would
> > probably be helpful just to ask for some help on this mailing list.
>
> > x86 variable length ISA, as well as programs compiled without frame pointers
> > present problems to stack walking.   I assumed that there may be some papers
> > on techniques for stack walking and tradeoffs as far as accuracy of stack
> > walking and overhead of performing the stack walk.   However, when googling,
> > I have not found much besides this website which has been helpful:
> >
> > http://help.madshi.net/TraceMethods.htm
> >
> > Does anyone else know of other resources on this?
> >
> > Any help would be greatly appreciated.
>
> The standard way of handling this for Linux/Unix-like OSes on x86 (and
> several other architectures) is to describe frame-related instructions
> in a procedure with DWARF2/3 annotations.  You may want to read
> Section 6.4 (Call Frame Information) in the DWARF manual.  You can
> find this document here:
>
>   http://www.eagercon.com/dwarf/Dwarf3-draft7-011029.pdf
>
> You could also look at the libunwind files src/dwarf/* and
> include/dwarf* to see actual working code.
>
> Hope this helps,
>
>   --david
> --
>
> Mosberger Consulting LLC, http://www.mosberger-consulting.com/
>

------- End of Original Message -------

reply via email to

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