From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26453 invoked by alias); 5 Aug 2008 02:41:19 -0000 Received: (qmail 26435 invoked by uid 22791); 5 Aug 2008 02:41:18 -0000 X-Spam-Check-By: sourceware.org Received: from igw2.br.ibm.com (HELO igw2.br.ibm.com) (32.104.18.25) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 05 Aug 2008 02:40:35 +0000 Received: from mailhub1.br.ibm.com (mailhub1 [9.18.232.109]) by igw2.br.ibm.com (Postfix) with ESMTP id 0677E17F5FF for ; Mon, 4 Aug 2008 23:26:40 -0300 (BRT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.18.232.46]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m752eMxZ1798210 for ; Mon, 4 Aug 2008 23:40:27 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m752eGwm017328 for ; Mon, 4 Aug 2008 23:40:17 -0300 Received: from [9.18.199.125] ([9.18.199.125]) by d24av01.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m752eGr0017325; Mon, 4 Aug 2008 23:40:16 -0300 Subject: Re: [RFA][patch 1/9] Yet another respin of the patch with initial Python support From: Thiago Jung Bauermann To: Daniel Jacobowitz Cc: Eli Zaretskii , tromey@redhat.com, gdb-patches@sources.redhat.com In-Reply-To: <20080805020754.GA17244@caradoc.them.org> References: <1216653969.31797.6.camel@localhost.localdomain> <20080726173508.GA16470@caradoc.them.org> <1217818243.9336.7.camel@localhost.localdomain> <20080804121451.GA13640@caradoc.them.org> <20080805020754.GA17244@caradoc.them.org> Content-Type: text/plain Date: Tue, 05 Aug 2008 02:41:00 -0000 Message-Id: <1217904015.7578.43.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00069.txt.bz2 On Mon, 2008-08-04 at 22:07 -0400, Daniel Jacobowitz wrote: > So that gives me a paragraph like this, which I think is accurate. > Does this look OK to you? I liked it. So this is the complete version of this text that I have for now. I changed the last sentence a bit, to reflect what you actually get from the Python exception: @cindex python exceptions @cindex exceptions, python 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: @smallexample (@value{GDBP}) python print foo Traceback (most recent call last): File "", line 1, in NameError: name 'foo' is not defined @end smallexample @value{GDBN} errors that happen in @value{GDBN} commands invoked by Python code are converted to Python @code{RuntimeError} exceptions. User interrupt (via @kbd{C-c} or by typing @kbd{q} at a pagination prompt) is translated to a Python @code{KeyboardInterrupt} exception. If you catch these exceptions in your Python code, your exception handler will see @code{RuntimeError} or @code{KeyboardInterrupt} as the exception type, the @value{GDBN} error message as its value, and the Python call stack backtrace at the Python statement closest to where the @value{GDB} error occured as the traceback. It this ok? -- []'s Thiago Jung Bauermann IBM Linux Technology Center