From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6447 invoked by alias); 21 Mar 2011 20:15:15 -0000 Received: (qmail 6176 invoked by uid 22791); 21 Mar 2011 20:15:12 -0000 X-SWARE-Spam-Status: No, hits=-0.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 Mar 2011 20:14:34 +0000 From: "pmuldoon at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug python/12174] gdb.GdbError exceptions should not be translated to RuntimeError exceptions X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pmuldoon at redhat dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: pmuldoon at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 21 Mar 2011 20:15:00 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2011-q1/txt/msg00234.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12174 --- Comment #1 from Phil Muldoon 2011-03-21 20:03:42 UTC --- It actually took me a few hours of hacking to figure this out. It's not really a bug in that you will never have anything that faces Python (ie can be called from a Python script) that will just print a message and no stack trace. gdb.GdbError gets converted to a GDB exception which has its own handling mechanism within GDB. When a GDB exception ends up at the border between the Python API and GDB it gets converted into a Python exception. Python has no idea how to deal with a GDB exception. So in this case it went from a gdb.GdbError to a GDB Exception back to a GdbError exception. This is usless, but harmless. This is the case with gdb.execute, gdb.parse_and_eval and a few other functions. As far as I know, there is no Python C API to deal specifically or alter how Python prints backtraces from exceptions. We seem to be able to either print it or not. I'll leave this open for a few days in case you disagree, or know of some other way to fix the bug. After that will close it. -- 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.