working around batch mode command errors

Doug Evans dje@google.com
Thu Nov 1 20:30:00 GMT 2012


On Tue, Oct 30, 2012 at 10:43 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
> Pedro> There's no try/catch mechanism in the CLI unfortunately, but I
> Pedro> think you could come up with one in python gdb.  ISTR Tromey had
> Pedro> a python command wrapper that swallows CLI errors?
>
> Yeah, http://www.sourceware.org/ml/gdb/2010-06/msg00100.html
>
> There's a more full-blown try/catch implementation in bugzilla.
> That one isn't in Python.  I don't know why it never went in.
>
> This seems to be a frequently requested feature.
>
> Tom

I went looking for the bugzilla entry but couldn't find it.

try:
   gdb.execute (...)
except:
  pass

is just too much to type.
</sarcasm> :-)



More information about the Gdb mailing list