This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA][patch 1/9] Yet another respin of the patch with initial Python support
- From: Daniel Jacobowitz <drow at false dot org>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: bauerman at br dot ibm dot com, tromey at redhat dot com, gdb-patches at sources dot redhat dot com
- Date: Mon, 4 Aug 2008 22:07:54 -0400
- Subject: Re: [RFA][patch 1/9] Yet another respin of the patch with initial Python support
- References: <1216653969.31797.6.camel@localhost.localdomain> <uwsj84wx5.fsf@gnu.org> <m3prp0efvr.fsf@fleche.redhat.com> <20080726173508.GA16470@caradoc.them.org> <m363qsee4r.fsf@fleche.redhat.com> <uej5g4frg.fsf@gnu.org> <1217818243.9336.7.camel@localhost.localdomain> <uhca1lb3k.fsf@gnu.org> <20080804121451.GA13640@caradoc.them.org> <u7iawlfxd.fsf@gnu.org>
On Mon, Aug 04, 2008 at 10:48:46PM +0300, Eli Zaretskii wrote:
> When executing the @code{python} command, Python exceptions
> uncaught within the Python code are translated to calls to
> @value{GDBN} error-reporting mechanism. If the command that called
> @code{python} does not handle the error, @value{GDBN} will
> terminate it and print an error message containing the Python
> exception name, the associated value, and the Python call stack
> backtrace at the point where the exception was raised. Example:
I think we've almost got it. The only problem I see with the above
text is that it's focused on user commands, both "python" and others.
This fits with the "Canned Sequences of Commands" usage which is what
the first patch implements, but if we can say it more generally it may
continue to be true as more patches go in. Here's some other
scenarios I heard mentioned in conversation today:
- Tab completion. Python code might be invoked when the user hits Tab
in the middle of an expression.
- "gdb --python", which Tom has implemented on the branch - no CLI
interpreter involved, GDB just executes a Python script.
- If Python code is used to discover some information about a stack
frame, it might be invoked every time the program stops.
So that gives me a paragraph like this, which I think is accurate.
Does this look OK to you?
When executing Python code, uncaught Python exceptions are translated
to calls to the @value{GDBN} error-reporting mechanism. If
@value{GDBN} does not handle the error, it will terminate the current
command and print an error message containing the Python exception
name, the associated value, and the Python call stack backtrace at the
point where the exception was raised. Example:
--
Daniel Jacobowitz
CodeSourcery