This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: python: get filename for selected frame?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]