[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gdb
Subject:    Re: python: get filename for selected frame?
From:       Tom Tromey <tromey () redhat ! com>
Date:       2010-07-07 22:44:05
Message-ID: m3y6dm9akq.fsf () fleche ! redhat ! com
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic