Is there a way to test if a convenience variable has been set in gdb?
For example:
(gdb) if $_exitcode == 0 >quit >end Invalid type combination in equality test. (gdb) p $_exitcode $1 = void
$_exitcode is void because it is not set until the program terminates. The closest available construct is init-if-undefined, but this would require setting the variable to some sentinel value and testing against that.
Since normal process exit code is somewhere in between 0 and 255, I suggest following: