Re: Help on Stack trace
Re: Help on Stack trace
- Subject: Re: Help on Stack trace
- From: Rick Altherr <email@hidden>
- Date: Mon, 9 Feb 2009 12:13:37 -0800
On Feb 9, 2009, at 11:45 AM, Steve Checkoway wrote:
The attached file is very slightly adapted from <http://svn.stepmania.com/viewvc/bin/cgi/viewvc.cgi/trunk/stepmania/src/archutils/Unix/BacktraceNames.cpp?view=markup
>. In particular converted from c++ to c, hence the global
variables.
<a.c>
There are a few potential bugs in this implementation. The main
one being that in Leopard, the segments of a binary can be slid
independently. This implementation assumes that the LINKEDIT
segment will have the same slide as the __TEXT segment. While this
is likely (assuming minimal address space fragmentation), it isn't
guaranteed.
I thought it was images that are slid, not the segments. The code
finds the image containing the address uses the slide value returned
from _dyld_get_image_vmaddr_slide() for the image. Are there
functions for getting the slide for individual segments?
No. Dyld used to slide the image as a whole so you only needed a
single slide value. This isn't strictly true now and there is no
single image slide value. Each segment can be slid independently. It
appears that this only applies to binaries within the dyld shared
cache, so it should not affect symbol lookups in your own application,
but can bite you if you are looking up anything in a system library.
GDB looks at the dyld_shared_cache_ranges symbol to determine which
images are in the shared cache and then reads their headers directly
to infer the per-segment slides.
Thanks for taking a look at this.
--
Steve Checkoway
"Anyone who says that the solution is to educate the users
hasn't ever met an actual user." -- Bruce Schneier
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@apple.com
This email sent to email@hidden
--
Rick Altherr
Architecture and Performance Group
email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden