Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Michel METZGER <michel.metzger@st.com>
To: "gdb@sourceware.org" <gdb@sourceware.org>
Subject: GDB return code and batch mode
Date: Tue, 12 Jul 2011 21:08:00 -0000	[thread overview]
Message-ID: <5B4CE209869C6A4797F5FAA0B348F0A0D9F4650FB0@SAFEX1MAIL1.st.com> (raw)

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.


             reply	other threads:[~2011-07-12 21:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12 21:08 Michel METZGER [this message]
2011-07-13 19:39 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5B4CE209869C6A4797F5FAA0B348F0A0D9F4650FB0@SAFEX1MAIL1.st.com \
    --to=michel.metzger@st.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox