This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug python/12174] New: gdb.GdbError exceptions should not betranslated to RuntimeError exceptions
- From: "markflorisson88 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Sun, 31 Oct 2010 20:43:38 +0000
- Subject: [Bug python/12174] New: gdb.GdbError exceptions should not betranslated to RuntimeError exceptions
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=12174
Summary: gdb.GdbError exceptions should not be translated to
RuntimeError exceptions
Product: gdb
Version: 7.1
Status: NEW
Severity: normal
Priority: P2
Component: python
AssignedTo: unassigned@sourceware.org
ReportedBy: markflorisson88@gmail.com
When you use gdb.execute() it automatically translates any exception to
RuntimeError. At least for gdb.GdbError it should not do this, as its purpose
is to display a message to the user and not show them a big fat traceback. In
fact, I'm not sure gdb.execute() should translate exceptions at all for errors
originating in Python code.
(gdb) python
>class C(gdb.Command):
> def invoke(self, *args):
> raise gdb.GdbError("This is a nonexistent command!")
>C("some-command", gdb.COMMAND_NONE)
>end
(gdb) some-command
This is a nonexistent command!
(gdb) python gdb.execute("some-command")
Traceback (most recent call last):
File "<string>", line 1, in <module>
RuntimeError: This is a nonexistent command!
Error while executing Python code.
(gdb)
--
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.