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

Comparing BasiliskII/src/Unix/main_unix.cpp (file contents):
Revision 1.46 by gbeauche, 2002-05-12T11:10:50Z vs.
Revision 1.47 by gbeauche, 2002-05-16T15:48:06Z

# Line 197 | Line 197 | char *strdup(const char *s)
197  
198  
199   /*
200 + *  Dump state when everything went wrong after a SEGV
201 + */
202 +
203 + static void sigsegv_dump_state(sigsegv_address_t fault_address, sigsegv_address_t fault_instruction)
204 + {
205 +        fprintf(stderr, "do_handle_screen_fault: unhandled address %p", fault_address);
206 +        if (fault_instruction != SIGSEGV_INVALID_PC)
207 +                fprintf(stderr, " [IP=%p]", fault_instruction);
208 +        fprintf(stderr, "\n");
209 + #if EMULATED_68K
210 +        uaecptr nextpc;
211 +        extern void m68k_dumpstate(uaecptr *nextpc);
212 +        m68k_dumpstate(&nextpc);
213 + #endif
214 +        VideoQuitFullScreen();
215 + #ifdef ENABLE_MON
216 +        char *arg[4] = {"mon", "-m", "-r", NULL};
217 +        mon(3, arg);
218 +        QuitEmulator();
219 + #endif
220 + }
221 +
222 +
223 + /*
224   *  Main program
225   */
226  
# Line 290 | Line 314 | int main(int argc, char **argv)
314            sigsegv_set_ignore_state(true);
315   #endif
316  
317 +        // Register dump state function when we got mad after a segfault
318 +        sigsegv_set_dump_state(sigsegv_dump_state);
319 +
320          // Read RAM size
321          RAMSize = PrefsFindInt32("ramsize") & 0xfff00000;       // Round down to 1MB boundary
322          if (RAMSize < 1024*1024) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines