Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
None
-
2014q1
-
None
Description
testrunner.pl can already detect abnormal exit on both Windows and Unix (check_abnormal_exit_win32 and check_abnormal_exit). If that happens, the test should be rerun inside the debugger to capture more information.
On Linux and on MinGW systems, the command-line should be:
gdb -nh -batch -x $COMMANDSFILE --args $TESTEXECUTABLE args...
And the commands file I recommend to be:
set print static-members off run echo \n=== Register dump ===\n info all-reg echo \n=== Stack trace (all threads) ===\n thread apply all bt -50 echo \n=== Stack trace (detailed) ===\n bt full -20 quit 1
If the program actually succeeds in running, "info all-reg" will cause gdb to error and it will exit with code 0.
For Mac, it might not be necessary since we already have the crash reporter.
For Visual Studio, we need first to find cdb.exe, which should be in $WINDOWSSDKDIR/Debuggers/$ARCH/cdb.exe (ARCH is either x86 or x64).
The command-line would be:
cdb.exe -g -G -cf $COMMANDSFILE $TESTEXECUTABLE args...
Where the commands should be:
.lines r ~* kp c !for_each_frame x q