Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: creating a load map to associate addresses with symbols




On May 25, 2006, at 5:42 PM, Brendan Creane wrote:

Another possibility is to parse the new .dSYM files
... but I haven't found an API for accessing the
contents of the .dSYM file.

There isn't one. The .dSYM file is the DWARF debug information for your executable; you can read the specifics about the DWARF standard here:
http://dwarf.freestandards.org/Home.php


Xcode 2.3 includes the dwarfdump(1) utility; there is a man page documenting its usage. You may be able to process its output to do what you need. Specifically, look at the DW_TAG_subprogram DIEs and the DW_AT_low_pc and DW_AT_high_pc attributes in them. It won't be that easy all of the time -- for instance a C++ constructor has a DW_TAG_subprogram Debug Info Entry (DIE) describing the ctor but there are at least two different versions of the ctor emitted (e.g. in- charge) -- those concrete DIEs will have pc address ranges and pointers back to the one abstract DW_TAG_subprogram DIE. This kind of thing can be complex but if you ignore these corner cases you can probably cook something up that will work a lot of the time.

It may actually be easier for you to get the information you want from gdb. Put commands like

info line *0x<address>

in a file like "gdbcmds.txt" and then run "gdb --batch --quiet -x gdbcmds.txt my-dwarf-file" and post-process the output.


Another minor goal is to find analagous functionality
to libcwd to demangle C++ symbol names.

Conveniently enough, gdb can also demangle names. "maint demangle <mangled name>". Or as another person already mentioned, c++filt will do what you need.


J
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >creating a load map to associate addresses with symbols (From: Brendan Creane <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.