From: Gary Benson <gbenson@redhat.com>
To: Paul Smith <psmith@gnu.org>
Cc: Ruslan Kabatsayev <b7.10110111@gmail.com>, gdb@sourceware.org
Subject: Re: gdb -batch always exits with status 0
Date: Fri, 17 Aug 2018 15:23:00 -0000 [thread overview]
Message-ID: <20180817152345.GA2920@blade.nx> (raw)
In-Reply-To: <ac003d5a0383eb7ea75ca675b831c55357026b57.camel@gnu.org>
Paul Smith wrote:
> On Fri, 2018-08-17 at 12:03 +0100, Gary Benson wrote:
> > Paul, Ruslan, would it be acceptable to you if I:
> >
> > 1) changed the default behaviour to exit 1 on the first error
> > 2) added an option (e.g. -ignore-errors) to revert to the current
> > behaviour.
>
> [I'm on vacation until next week so may not be responding immediately]
>
> Well it would not be ideal as I'd need to go through all my scripts
> etc. and modify them to add an extra argument.
How much work would this be for you? Minutes, hours, days, weeks?
> I guess I'm not really sure why we want to change the default
> behavior here. Do we have people requesting this change? I haven't
> seen a groundswell of people saying they were confused becuase they
> expected a different behavior, and the current behavior has good and
> useful reasons for existing (i.e., not just an oversight).
There isn't a groundswell of people, no. I started investigating an
orthoganal issue, that the manual says GDB in batch mode exits with
nonzero status to indicate error, but in reality GDB always exits with
status 0. It should be a trivial fix, except that the way GDB
continues past errors makes it difficult to implement--exit nonzero
for any error, or the last error, or only some errors... which?
Also, exactly which statements get executed if errors occur isn't
exactly consistent. And all that disappears when you say, ok, lets
just exit nonzero at the first error, which is what I'd intuitively
expected would happen.
> Wouldn't the most sensible/least impactful way forward be to leave
> the current behavior as-is, and then if people want a different
> behavior add a new option they can use to request it?
It would be the least impactful way, sure, but my point is that GDB
doesn't operate in an intuitive way, and my view is that whatever is
intuitive should be the default. Having to request it with a special
flag makes GDB harder for new users.
Cheers,
Gary
next prev parent reply other threads:[~2018-08-17 15:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-05 14:47 Gary Benson
2018-07-05 14:55 ` Ruslan Kabatsayev
2018-07-05 15:23 ` Paul Smith
2018-08-17 11:03 ` Gary Benson
2018-08-17 11:25 ` Ruslan Kabatsayev
2018-08-17 13:24 ` Paul Smith
2018-08-17 15:23 ` Gary Benson [this message]
2018-08-17 15:44 ` Ruslan Kabatsayev
2018-08-17 16:03 ` Gary Benson
2018-08-17 18:30 ` Pedro Alves
2018-08-22 9:07 ` Gary Benson
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=20180817152345.GA2920@blade.nx \
--to=gbenson@redhat.com \
--cc=b7.10110111@gmail.com \
--cc=gdb@sourceware.org \
--cc=psmith@gnu.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