This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [python] [patch] PR 12174 (preserve gdb.GdbError behaviour)
- From: Tom Tromey <tromey at redhat dot com>
- To: pmuldoon at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 19 Apr 2011 11:37:32 -0600
- Subject: Re: [python] [patch] PR 12174 (preserve gdb.GdbError behaviour)
- References: <m37hb0onq1.fsf@redhat.com>
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> In the case of gdb.execute, gdb.GdbErrors were being converted to
Phil> GDB errors and back again to a Runtime Exception.
I suppose the scenario is a command written in Python that uses
gdb.execute("something"), where "something" is itself written in Python.
Then if "something" raises GdbError, gdb.execute winds up calling error,
which translates to a RuntimeException?
It seems to me that what we really want is some unification between the
Python and GDB exception mechanisms. That is, a way to preserve the
exception across the GDB/Python boundary.
This would provide some benefits; e.g., the current patch loses subtype
information from the GdbError.
I haven't really thought through the implications of this. Maybe there
are problems lurking.
Phil> I was unsure if I should call print_exception in gdb.execute or whether
Phil> just to let the Python exception propagate.
I think it has to propagate. If it was ok to print the exception here,
then we wouldn't need this patch at all.
Tom