[K/N] Patch libbacktrace to work in ios simulator.
This commit is contained in:
@@ -92,6 +92,7 @@ struct macho_header_fat
|
||||
|
||||
#define MACH_O_MH_EXECUTE 0x02
|
||||
#define MACH_O_MH_DYLIB 0x06
|
||||
#define MACH_O_MH_DYLINKER 0x07
|
||||
#define MACH_O_MH_DSYM 0x0a
|
||||
|
||||
/* A component of a fat file. A fat file starts with a
|
||||
@@ -1060,6 +1061,8 @@ macho_add (struct backtrace_state *state, const char *filename, int descriptor,
|
||||
case MACH_O_MH_DYLIB:
|
||||
case MACH_O_MH_DSYM:
|
||||
break;
|
||||
case MACH_O_MH_DYLINKER:
|
||||
goto skip;
|
||||
default:
|
||||
error_callback (data, "executable file is not an executable", 0);
|
||||
goto fail;
|
||||
@@ -1214,6 +1217,12 @@ macho_add (struct backtrace_state *state, const char *filename, int descriptor,
|
||||
if (descriptor != -1)
|
||||
backtrace_close (descriptor, error_callback, data);
|
||||
return 0;
|
||||
skip:
|
||||
if (cmds_view_valid)
|
||||
backtrace_release_view (state, &cmds_view, error_callback, data);
|
||||
if (descriptor != -1)
|
||||
backtrace_close (descriptor, error_callback, data);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MACH_O_DYLD_H
|
||||
|
||||
Reference in New Issue
Block a user