- Applied patch based on one by Roland Mainz, 4/1/2001.

Panic-is-fatal patch, allows user to choose whether to crash on bx_panic()
  or just print a warning.  The default behavior is still to crash.
This commit is contained in:
Bryce Denney 2001-04-10 02:13:25 +00:00
parent 55de7270df
commit e2a0ce5c03
2 changed files with 10 additions and 0 deletions

View File

@ -34,6 +34,12 @@
// USER CONFIGURABLE OPTIONS : EDIT ONLY OPTIONS IN THIS SECTION // // USER CONFIGURABLE OPTIONS : EDIT ONLY OPTIONS IN THIS SECTION //
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////
// This switch determines if a call to bx_panic will kill the
// simulation or not. Leave it on by default so that default
// functionality stays the same, but now it's easy to change the
// behavior to suit your taste.
#define BX_PANIC_IS_FATAL 1
// I rebuilt the code which provides timers to IO devices. // I rebuilt the code which provides timers to IO devices.
// Setting this to 1 will introduce a little code which // Setting this to 1 will introduce a little code which
// will panic out if cases which shouldn't happen occur. // will panic out if cases which shouldn't happen occur.

View File

@ -312,6 +312,10 @@ bx_panic(char *fmt, ...)
bx_atexit(); bx_atexit();
#if !BX_PANIC_IS_FATAL
return;
#endif
#if !BX_DEBUGGER #if !BX_DEBUGGER
exit(1); exit(1);
#else #else