This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
GDB return code and batch mode
- From: Michel METZGER <michel dot metzger at st dot com>
- To: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Tue, 12 Jul 2011 23:08:21 +0200
- Subject: GDB return code and batch mode
Hi,
I'm probably missing something here, the question is: what is it? ;)
According to the documentation, -batch has the following effect:
"Exit with status 0 after processing all the command files specified with `-x' (and all commands from initialization files, if not inhibited with `-n'). Exit with nonzero status if an error occurs in executing the gdb commands in the command files."
A quick test:
$ gdb -batch -x "gdb.script"
with a file gdb.script containing the line:
file toto
(of course toto doesn't exist, to raise an error).
The output is:
gdb.script:1: Error in sourced command file:
toto: No such file or directory.
$ echo $?
0
Ideas?
Regards,
Michel Metzger.