From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============5508847247856588896==" MIME-Version: 1.0 From: Mark Wielaard To: elfutils-devel@lists.fedorahosted.org Subject: Re: Libdw sample for reading function names and addresses Date: Sun, 09 Nov 2014 18:04:13 +0100 Message-ID: <1415552653.19702.40.camel@bordewijk.wildebeest.org> In-Reply-To: CAPO7Hz-V+1YSZHPySYgxHrdHHmDCENxtOG2RnbjUoUvEqt3J2A@mail.gmail.com --===============5508847247856588896== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On Sat, 2014-11-08 at 22:00 -0500, buddhika chamith wrote: > Not entirely sure if this is the correct forum. But any help is greatly > appreciated. I have a requirement to read off function names and addresses > from an ELF binary debug symbols. Is there any such piece of code that's > already there that you have written? I had a look at some elfutils codes > (e.g: nm.c) in the hope of adapting them to my requirement. But the libdw > API is seems bit intimidating to me given that I have little knowledge on > Dwarf format. There is no such thing as "debug symbols". There are various DIEs (Debug Information Entries) that can be associated with particular address ranges though. You might want to read a bit about DWARF at http://dwarfstd.org/ You might want to take a look at src/addr2line.c which has some code (print_dwarf_function) to print out some information found in the DWARF debuginfo associated with a particular address. Cheers, Mark --===============5508847247856588896==--