This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]