Merge branch 'seg-fault-on-i-error' into 'master'

Generate a backtrace for I_Error; add a crash command

See merge request KartKrew/Kart!947
This commit is contained in:
Oni 2023-02-22 09:29:26 +00:00
commit 5217650583
2 changed files with 12 additions and 2 deletions

View file

@ -1181,6 +1181,13 @@ static void Command_assert(void)
#endif
}
#ifdef DEVELOP
static void Command_crash(void)
{
I_Error("The game crashed on PURPOSE, because of the 'crash' command. (This is only enabled in DEVELOP builds.)");
}
#endif
//
// D_SRB2Main
//
@ -1373,6 +1380,9 @@ void D_SRB2Main(void)
COM_Init();
COM_AddCommand("assert", Command_assert);
#ifdef DEVELOP
COM_AddCommand("crash", Command_crash);
#endif
#ifndef TESTERS
// add any files specified on the command line with -file wadfile

View file

@ -1891,8 +1891,8 @@ void I_Error(const char *error, ...)
W_Shutdown();
#if defined (PARANOIA) && defined (__CYGWIN__)
*(INT32 *)2 = 4; //Alam: Debug!
#if defined (PARANOIA) || defined (DEVELOP)
*(INT32 *)0 = 4; //Alam: Debug!
#endif
exit(-1);