This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/12174] gdb.GdbError exceptions should not be translatedto RuntimeError exceptions
- From: "markflorisson88 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 21 Mar 2011 23:18:36 +0000
- Subject: [Bug python/12174] gdb.GdbError exceptions should not be translatedto RuntimeError exceptions
- Auto-submitted: auto-generated
- References: <bug-12174-4717@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=12174
--- Comment #3 from Mark Florisson <markflorisson88 at gmail dot com> 2011-03-21 23:04:23 UTC ---
(In reply to comment #2)
> Created attachment 5321 [details]
> Preserve Python exception information through GDB code
It seems sourceware forgot about my actual comment, so here goes.
For GDB commands, the C function that is invoking the Python 'invoke' method of
Command subclasses is clearing the exception, decreffing the type, value and
traceback, and is then calling error() with the message string of the Python
exception. At this point all Python information except for the exception
message (in case this was actually a string!) is lost. So instead I propose to
leave the Python error indicator installed, and have
py-utils.c:gdbpy_convert_exception() check if a Python error indicator is set.
If so, it can simply re-raise (i.e., propagate) it.
I attached an untested patch, because unfortunately I don't have archer
compiled at this moment.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.