This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: gdb -batch always exits with status 0
- From: Gary Benson <gbenson at redhat dot com>
- To: Paul Smith <psmith at gnu dot org>
- Cc: Ruslan Kabatsayev <b7 dot 10110111 at gmail dot com>, gdb at sourceware dot org
- Date: Fri, 17 Aug 2018 12:03:55 +0100
- Subject: Re: gdb -batch always exits with status 0
- References: <20180705144659.GA29169@blade.nx> <2c7ad73e90cc7417bd23b4529261d8c737668571.camel@gnu.org>
Paul Smith wrote:
> On Thu, 2018-07-05 at 15:47 +0100, Gary Benson wrote:
> > Would anybody object to my changing GDB's behaviour to terminate
> > on the first error in batch mode?
>
> I would definitely not like this. Often I write batch files that
> are used to collect information about cores (or running processes);
> if some aspect of the core is not as I expect, or values are
> optimized out, or some operation fails for whatever reason, I
> definitely do not want my batch processing to stop. I want it to
> continue so I can get as much information as possible.
>
> If a "stop on error" mode is needed then there should be a separate
> option to GDB such as '-batch-fail' or whatever for that, IMO.
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.
Thanks,
Gary