This is the mail archive of the gdb-prs@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]

[Bug gdb/13000] New: Return value with -batch is always 0


http://sourceware.org/bugzilla/show_bug.cgi?id=13000

           Summary: Return value with -batch is always 0
           Product: gdb
           Version: 7.2
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned@sourceware.org
        ReportedBy: michel.metzger@st.com
              Host: pc-linux-gnu
            Target: i686


The documentation states -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."

The following test demonstrates that it is in fact not the case:

$ 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.

Displaying the exit status shows that is is in fact 0.
$ echo $?
0

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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