This is the mail archive of the gdb-prs@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]

[Bug python/12174] gdb.GdbError exceptions should not be translatedto RuntimeError exceptions


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.


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