Bug 18488 - gdb -batch exits with code 0 when there's a command error
Summary: gdb -batch exits with code 0 when there's a command error
Status: RESOLVED DUPLICATE of bug 13000
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-04 15:54 UTC by dje
Modified: 2015-06-04 18:12 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dje 2015-06-04 15:54:11 UTC
The docs say this:

'-batch'
     Run in batch mode.  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.  Batch mode also disables pagination, sets
     unlimited terminal width and height see Screen Size, and acts
     as if 'set confirm off' were in effect (see Messages/Warnings).

bash$ gdb -batch -ex foo
Undefined command: "foo".  Try "help".
bash$ echo $?
0
Comment 1 dje 2015-06-04 18:12:40 UTC
Bleah.
I was leaning on bugzilla's ability to suggest dupes to find this one.
It didn't.
Now I can't really trust it at all.

*** This bug has been marked as a duplicate of bug 13000 ***