Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Pouget <kevin.pouget@gmail.com>
To: Tom Tromey <tromey@redhat.com>
Cc: pmuldoon@redhat.com, gdb-patches@sourceware.org
Subject: Re: [patch] PR python/12438
Date: Fri, 21 Oct 2011 09:43:00 -0000	[thread overview]
Message-ID: <CAPftXUK6AFk4K3358bNty-X9ijiMMh_d2hU-1TQCQFK14dbC3w@mail.gmail.com> (raw)
In-Reply-To: <m3ehy8sntg.fsf@fleche.redhat.com>

On Wed, Oct 19, 2011 at 10:56 PM, Tom Tromey <tromey@redhat.com> 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.  Concrete 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):	
	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 nice
> 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=13329

I'll give in a try in the next weeks or so, if still available



Thanks,

Kevin


      parent reply	other threads:[~2011-10-21  8:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-30  9:38 Phil Muldoon
2011-06-30 19:58 ` Tom Tromey
2011-07-07 16:16   ` Phil Muldoon
2011-07-07 18:47     ` Eli Zaretskii
2011-07-07 18:52     ` Tom Tromey
2011-07-11 17:16       ` Phil Muldoon
2011-10-17 13:00 ` Kevin Pouget
2011-10-17 13:49   ` Phil Muldoon
2011-10-19 20:56   ` Tom Tromey
2011-10-20 12:33     ` Phil Muldoon
2011-10-21  9:43     ` Kevin Pouget [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPftXUK6AFk4K3358bNty-X9ijiMMh_d2hU-1TQCQFK14dbC3w@mail.gmail.com \
    --to=kevin.pouget@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pmuldoon@redhat.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox