Movatterモバイル変換
[0]ホーム
This is the mail archive of thebinutils@sources.redhat.commailing list for thebinutils project.
Re: using bfd, help please I am confused
- From: Ian Lance Taylor <ian at airs dot com>
- To: Robert Schweikert <Robert dot Schweikert at abaqus dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 20 Jun 2003 11:05:12 -0700
- Subject: Re: using bfd, help please I am confused
- References: <1056131220.24077.211.camel@cheetah.hks.com>
Robert Schweikert <Robert.Schweikert@abaqus.com> writes:> My assumption is that I can somehow figure out the address of the> function I am in, from here I'd like to figure out the function name.> The approach is to use the > > void * __builtin_return_address (unsigned int level)> > kernel function to get the return address of the stack from there I> should be able to figure out the function/method name/symbol.That's a gcc builtin function, not a kernel function.If you pass the address you get to addr2line, you should find thefunction name, etc. Here's the documentation for addr2line:http://sources.redhat.com/binutils/docs-2.12/binutils.info/addr2line.html#addr2lineIf you want to get that information from within the program, withoutusing an external program, then you are going to have to link yourprogram against libbfd and call bfd_find_nearest_line(). Look at thesources to addr2line for some hints.Ian
[8]ページ先頭