This is the mail archive of the gdb-patches@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: [python] [patch] PR 12174 (preserve gdb.GdbError behaviour)


>>>>> "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


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