ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/Unix/main_unix.cpp
(Generate patch)

Comparing SheepShaver/src/Unix/main_unix.cpp (file contents):
Revision 1.98 by asvitkine, 2011-12-30T17:38:39Z vs.
Revision 1.99 by asvitkine, 2012-01-01T18:50:01Z

# Line 527 | Line 527 | static void get_system_info(void)
527                  }
528                  fclose(proc_file);
529          } else {
530 +                char str[256];
531                  sprintf(str, GetString(STR_PROC_CPUINFO_WARN), strerror(errno));
532                  WarningAlert(str);
533          }
# Line 1377 | Line 1378 | static void *tick_func(void *arg)
1378                          sigregs *r = &sigsegv_regs;
1379                          char str[256];
1380                          if (crash_reason == NULL)
1381 <                                crash_reason = "SIGSEGV";
1381 >                                crash_reason = "SIGSEGV!";
1382                          sprintf(str, "%s\n"
1383                                  "   pc %08lx     lr %08lx    ctr %08lx    msr %08lx\n"
1384                                  "  xer %08lx     cr %08lx  \n"
# Line 1403 | Line 1404 | static void *tick_func(void *arg)
1404                          printf(str);
1405                          VideoQuitFullScreen();
1406  
1407 +                        {
1408 +                                static int (*backtrace_fn)(void**, int);
1409 +                                static char** (*backtrace_symbols_fn)(void* const*, int);
1410 +                                backtrace_fn = dlsym(RTLD_DEFAULT, "backtrace");
1411 +                                backtrace_symbols_fn = dlsym(RTLD_DEFAULT, "backtrace_symbols");
1412 +        void *frame_ptrs[64];
1413 +        int count = backtrace_fn(frame_ptrs, 64);
1414 +        char **fnames = backtrace_symbols_fn(frame_ptrs, count);
1415 +        int i;
1416 +        for (i = 0; i < count; i++)
1417 +                printf("%s", fnames[i]);
1418 +        free(fnames);
1419 +                        }
1420 +
1421   #ifdef ENABLE_MON
1422                          // Start up mon in real-mode
1423                          printf("Welcome to the sheep factory.\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines