This commit is contained in:
Steve Checkoway
2005-06-19 11:17:31 +00:00
parent 28fc7bcdad
commit e233317c25
@@ -121,8 +121,8 @@ void BacktraceNames::FromAddr( const void *p )
Dl_info di; Dl_info di;
if( !dladdr(p, &di) || di.dli_sname == NULL ) if( !dladdr(p, &di) || di.dli_sname == NULL )
{ {
if( !dladdr( ((char *) p) - 8, &di) ) if( !dladdr( ((char *) p) - 8, &di) )
return; return;
} }
Symbol = di.dli_sname; Symbol = di.dli_sname;
@@ -160,7 +160,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <mach-o/dyld.h> #include <mach-o/dyld.h>
#include <mach-o/nlist.h> #include <mach-o/nlist.h>
const load_command *next_load_command( const load_command *cmd ) static const load_command *next_load_command( const load_command *cmd )
{ {
const char *p = (const char *) cmd; const char *p = (const char *) cmd;
p += cmd->cmdsize; p += cmd->cmdsize;
@@ -168,7 +168,7 @@ const load_command *next_load_command( const load_command *cmd )
} }
/* Return the image index of the given pointer, or -1 if not found. */ /* Return the image index of the given pointer, or -1 if not found. */
int osx_find_image( const void *p ) static int osx_find_image( const void *p )
{ {
unsigned long image_count = _dyld_image_count(); unsigned long image_count = _dyld_image_count();
@@ -204,7 +204,7 @@ int osx_find_image( const void *p )
return -1; return -1;
} }
const char *osx_find_link_edit( const struct mach_header *header ) static const char *osx_find_link_edit( const struct mach_header *header )
{ {
const struct load_command *cmd = (struct load_command *) &header[1]; const struct load_command *cmd = (struct load_command *) &header[1];
for( unsigned i = 0; i < header->ncmds; i++, cmd = next_load_command(cmd) ) for( unsigned i = 0; i < header->ncmds; i++, cmd = next_load_command(cmd) )
@@ -242,8 +242,8 @@ void BacktraceNames::FromAddr( const void *p )
const struct load_command *cmd = (struct load_command *) &header[1]; const struct load_command *cmd = (struct load_command *) &header[1];
unsigned long diff = 0xffffffff; unsigned long diff = 0xffffffff;
const char *dli_sname = NULL; const char *dli_sname = NULL;
void *dli_saddr = NULL; void *dli_saddr = NULL;
for( unsigned long i = 0; i < header->ncmds; i++, cmd = next_load_command(cmd) ) for( unsigned long i = 0; i < header->ncmds; i++, cmd = next_load_command(cmd) )
{ {