This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Indicate batch mode failures by exiting with nonzero status
On Sun, 2018-08-19 at 09:35 -0600, Tom Tromey wrote:
> > > > > > "Gary" == Gary Benson <gbenson@redhat.com> writes:
> > > Also, why just the last command? I mean, I guess I don't really know
> > > what I would expect, but maybe if any command failed, gdb should exit?
>
> Gary> That was my thinking, to have GDB exit 1 on the first error in batch
> Gary> mode, but people objected; see the followups to:
>
> Oh, ok, sorry for wading into an already open issue without the
> background.
>
> On reflection perhaps I'm overthinking it. It seems to me that it is
> fine for these command line options to be defined based on whatever
> seems convenient.
>
> For "real" scripting, a script file could be used. Maybe we could
> finally land that try/catch patch, or the ignore-errors command.
> Or, longer term, finally make it possible to really script with Python.
Note that I still have on my list of things to do to rework
the 'block of commands' patch that I started some (long) time ago.
One of the objectives was to allow to group commands in blocks such as:
{ command1 ; command2 ; command3 }
And have (optional) flags -c and -s to follow the {
to control continuing (silently or not) the execution
of a sequence of commands when there is a failure.
Another objective is to allow something like:
thread apply all { command1; command 2}
and similar for frame apply,
Philippe