From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27582 invoked by alias); 21 Oct 2011 08:42:33 -0000 Received: (qmail 27572 invoked by uid 22791); 21 Oct 2011 08:42:33 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Oct 2011 08:42:17 +0000 Received: by vws16 with SMTP id 16so3360991vws.0 for ; Fri, 21 Oct 2011 01:42:16 -0700 (PDT) Received: by 10.52.69.52 with SMTP id b20mr3597049vdu.85.1319186535084; Fri, 21 Oct 2011 01:42:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.180.75 with HTTP; Fri, 21 Oct 2011 01:41:55 -0700 (PDT) In-Reply-To: References: From: Kevin Pouget Date: Fri, 21 Oct 2011 09:43:00 -0000 Message-ID: Subject: Re: [patch] PR python/12438 To: Tom Tromey Cc: pmuldoon@redhat.com, gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2011-10/txt/msg00589.txt.bz2 On Wed, Oct 19, 2011 at 10:56 PM, Tom Tromey wrote: > Kevin> I have a question regarding this patch, which was committed at > Kevin> the end of June, wouldn't GDB let the user know, one way or an > Kevin> other, that there was something wrong happened ? > > I think gdbpy_print_stack is mostly called in "internal" situations, > where printing something will mess up the output. > > Ordinary commands and such that fail should convert the Python exception > to a gdb exception, leading to what you'd expect. > > I might be misremembering. =A0Concrete examples would help. I don't think so about gdbpy_print_stack, I think it's used every time an exception is caught, either originating from [user-] python code, or from GDB's internals the first example I can thing about it: class BP(gdb.Breakpoint):=09 def stop(self): raise ValueError which will silently fail if "set python print-stack" is off > Kevin> I don't know if Python allows to do it, but i think it would be ni= ce > Kevin> to see something like: > >>> NameError: global name 'comp' is not define > > Kevin> which is the last line of a python stacktrace > > I think it could be done. > We can always add more values for "maint set python print-stack". I posted a bug report for that; http://sourceware.org/bugzilla/show_bug.cgi?id=3D13329 I'll give in a try in the next weeks or so, if still available Thanks, Kevin