public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "markflorisson88 at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug python/12174] gdb.GdbError exceptions should not be translated to RuntimeError exceptions
Date: Mon, 21 Mar 2011 23:19:00 -0000	[thread overview]
Message-ID: <bug-12174-4717-1SephSr6O4@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <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.


  parent reply	other threads:[~2011-03-21 23:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-31 20:43 [Bug python/12174] New: " markflorisson88 at gmail dot com
2011-03-21 13:25 ` [Bug python/12174] " pmuldoon at redhat dot com
2011-03-21 20:15 ` pmuldoon at redhat dot com
2011-03-21 23:19 ` markflorisson88 at gmail dot com [this message]
2011-03-22  0:11 ` markflorisson88 at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-12174-4717-1SephSr6O4@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).