public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Joseph Garvin <joseph.h.garvin@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: python: get filename for selected frame?
Date: Wed, 07 Jul 2010 22:44:00 -0000	[thread overview]
Message-ID: <m3y6dm9akq.fsf@fleche.redhat.com> (raw)
In-Reply-To: <AANLkTil4y1svyCAtXIVfqIh-iMs-275ViKAMoYrpXBGi@mail.gmail.com>	(Joseph Garvin's message of "Wed, 7 Jul 2010 15:23:19 -0500")

>>>>> "Joseph" == Joseph Garvin <joseph.h.garvin@gmail.com> writes:

Joseph> Is there anyway to get at the filename for the source file associated
Joseph> with the currently selected frame from python?

Yes, it is just a bit obscure:

(top-gdb) python f = gdb.selected_frame()
(top-gdb) python print f.find_sal().symtab.filename
../../archer/gdb/gdb.c

Joseph> It'd assist with pretty printing boost backtraces a lot.

I am curious to know more about what you are trying to do.

On the archer branch we still have a reimplementation of "backtrace"
that lets 3rd parties plug in filters.  This is not fully baked yet (we
know of some design flaws pointed out by users), so we haven't tried
upstreaming it yet.  Still, it is useful and I'm interested in
collecting requirements for when we get back to polishing it.

Tom

      reply	other threads:[~2010-07-07 22:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07 20:23 Joseph Garvin
2010-07-07 22:44 ` Tom Tromey [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=m3y6dm9akq.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=joseph.h.garvin@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).