View Full Version : How to read DWARF file
rajukgp
April 18th, 2009, 04:49
Hi All,
I am new to this group.I would like to know, how to read DWARF file?Is there any simple sample program that can be used for reading DWARF file.Basically I would like to retrieve file name, function name and the line number from the DWAF file.My OS is MacOSX.
Thanks in advance.
-R
SirDice
April 18th, 2009, 09:05
Hmm.. I've never heard of a DWARF file, I had to look it up..
http://dwarfstd.org/
tangram
April 18th, 2009, 10:05
From this section of the post description: "Howtos & FAQs Would you like to share some of your solutions for certain problems? Tips or tricks? Post here."
Your question would be better placed in one of the other forum section.
Welcome aboard btw ;)
LateNiteTV
April 19th, 2009, 00:55
you would probably have better luck with this on a mac forum.
fronclynne
April 19th, 2009, 01:50
I can't really be of great help, but I did find devel/dwarfdump.
Again, I have no clue how to use it.
LateNiteTV
April 19th, 2009, 02:23
that probably wont help him since hes on osx. buuuuuut then again, i dont know jack about it.
fronclynne
April 19th, 2009, 02:36
Sure, but I'm obstinately sticking to the theory that he asked on a FreeBSD forum for a reason.
And, if he researches the leads he's been given, I'm sure something OSeXy will turn up for him.
SirDice
April 19th, 2009, 10:54
Sure, but I'm obstinately sticking to the theory that he asked on a FreeBSD forum for a reason.
Maybe because OS-X borrowed heavily from FreeBSD? :e
Even though there's a lot of FreeBSD stuff in OS-X, DWARF isn't one of them.
SeanC
April 21st, 2009, 21:01
Did you try readelf(1)?
http://www.freebsd.org/cgi/man.cgi?query=readelf&manpath=FreeBSD+7.1-RELEASE
It is part of the gnu/binutils, not part of a standard OSX install, but you can get the source online. It is also available via DarwinPorts.
SeanC
April 21st, 2009, 22:30
Maybe because OS-X borrowed heavily from FreeBSD?
In this case, it doesn't actually matter. DWARF debugging symbols is supported by gcc, the default cc on both FreeBSD and OSX (with Xcode installed).
CarminPolitano
March 21st, 2012, 04:44
Use the terminal command dwarfdump.
SirDice
March 21st, 2012, 09:06
Use the terminal command dwarfdump.
You're responding to a post that's almost three years old. Dwarfdump has already been mentioned.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.