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

Re: gdb -batch always exits with status 0


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.

Also, it would be nice if there were a way to distinguish between "bad
command line/core file/executable and I couldn't start debugging", and
"I loaded everything but some commands didn't work".  But that may be a
separate operation.


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