From df4342b6db095063cad32c4c8276bba1ef160bf1 Mon Sep 17 00:00:00 2001 From: asvitkine <> Date: Sun, 1 Jan 2012 18:50:01 +0000 Subject: [PATCH] fix compile error introduced by my recent refactoring --- SheepShaver/src/Unix/main_unix.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/SheepShaver/src/Unix/main_unix.cpp b/SheepShaver/src/Unix/main_unix.cpp index 7b31cd83..b81fbfa7 100644 --- a/SheepShaver/src/Unix/main_unix.cpp +++ b/SheepShaver/src/Unix/main_unix.cpp @@ -527,6 +527,7 @@ static void get_system_info(void) } fclose(proc_file); } else { + char str[256]; sprintf(str, GetString(STR_PROC_CPUINFO_WARN), strerror(errno)); WarningAlert(str); } @@ -1377,7 +1378,7 @@ static void *tick_func(void *arg) sigregs *r = &sigsegv_regs; char str[256]; if (crash_reason == NULL) - crash_reason = "SIGSEGV"; + crash_reason = "SIGSEGV!"; sprintf(str, "%s\n" " pc %08lx lr %08lx ctr %08lx msr %08lx\n" " xer %08lx cr %08lx \n" @@ -1403,6 +1404,20 @@ static void *tick_func(void *arg) printf(str); VideoQuitFullScreen(); + { + static int (*backtrace_fn)(void**, int); + static char** (*backtrace_symbols_fn)(void* const*, int); + backtrace_fn = dlsym(RTLD_DEFAULT, "backtrace"); + backtrace_symbols_fn = dlsym(RTLD_DEFAULT, "backtrace_symbols"); + void *frame_ptrs[64]; + int count = backtrace_fn(frame_ptrs, 64); + char **fnames = backtrace_symbols_fn(frame_ptrs, count); + int i; + for (i = 0; i < count; i++) + printf("%s", fnames[i]); + free(fnames); + } + #ifdef ENABLE_MON // Start up mon in real-mode printf("Welcome to the sheep factory.\n");