Added debug script to aid in getting crash callstacks from users.

This commit is contained in:
harry 2024-01-26 20:33:40 -05:00
parent 2fce5ffe74
commit 3e8978c2aa
2 changed files with 25 additions and 0 deletions

24
scripts/linux_debug.pl Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/perl
use strict;
my $i; my $findResult;
my $exe = "fceux";
$findResult = `find . -name fceux`;
if ( $findResult ne "")
{
$findResult =~ s/\n.*//;
$exe=$findResult;
}
print "Executable: $exe\n";
my $gdbCmdFile = "/tmp/gdbCmdFile";
open CMD_FILE, ">$gdbCmdFile" or die "Error: Could not open file: $gdbCmdFile\n";
print CMD_FILE "run\n";
print CMD_FILE "backtrace\n";
close(CMD_FILE);
system("gdb -x $gdbCmdFile $exe");

View File

@ -160,6 +160,7 @@ typedef uint8 (*readfunc)(uint32 A);
#endif
#define FCEU_UNUSED(x) (void)(x)
#define FCEU_CRASH() int *_dumbPointer = nullptr; *_dumbPointer = 0xdeadbeef
#if FCEU_CPP_HAS_STD(201603L) || FCEU_HAS_CPP_ATTRIBUTE(maybe_unused)
#define FCEU_MAYBE_UNUSED [[maybe_unused]]