public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* python: get filename for selected frame?
@ 2010-07-07 20:23 Joseph Garvin
  2010-07-07 22:44 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Joseph Garvin @ 2010-07-07 20:23 UTC (permalink / raw)
  To: gdb

Is there anyway to get at the filename for the source file associated
with the currently selected frame from python? It'd assist with pretty
printing boost backtraces a lot.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: python: get filename for selected frame?
  2010-07-07 20:23 python: get filename for selected frame? Joseph Garvin
@ 2010-07-07 22:44 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2010-07-07 22:44 UTC (permalink / raw)
  To: Joseph Garvin; +Cc: gdb

>>>>> "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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-07 22:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-07 20:23 python: get filename for selected frame? Joseph Garvin
2010-07-07 22:44 ` Tom Tromey

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).