public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/12918] New: Can not get symtab_and_line object given an arbitrary program counter
@ 2011-06-21 21:48 er_31337 at yahoo dot com
  2011-07-04  7:07 ` [Bug python/12918] " ratmice at gmail dot com
  0 siblings, 1 reply; 2+ messages in thread
From: er_31337 at yahoo dot com @ 2011-06-21 21:48 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12918

           Summary: Can not get symtab_and_line object given an arbitrary
                    program counter
           Product: gdb
           Version: 7.2
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: python
        AssignedTo: unassigned@sourceware.org
        ReportedBy: er_31337@yahoo.com


There is no (obvious) documented way to get a symtab_and_line object given an
arbitrary address.  
A function gdb.sal_for_pc() similar to gdb.block_for_pc() would be nice.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug python/12918] Can not get symtab_and_line object given an arbitrary program counter
  2011-06-21 21:48 [Bug python/12918] New: Can not get symtab_and_line object given an arbitrary program counter er_31337 at yahoo dot com
@ 2011-07-04  7:07 ` ratmice at gmail dot com
  0 siblings, 0 replies; 2+ messages in thread
From: ratmice at gmail dot com @ 2011-07-04  7:07 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=12918

matt rice <ratmice at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ratmice at gmail dot com

--- Comment #1 from matt rice <ratmice at gmail dot com> 2011-07-04 07:06:56 UTC ---
you can get a symtab_and_line object for an arbitrary address by using the
decode_line function (see the Basic Python section of the manual) and passing
in "*0xaddr" as the argument.

e.g. 
(gdb) python print gdb.decode_line("*" +
str(gdb.selected_frame().find_sal().pc))
(None, (<gdb.Symtab_and_line object at 0x7f55269cbe10>,))
(gdb)

I've suggested adding a reference to decode_line from the gdb.symtab_and_line
section.
If you have any recommendations how to further clarify the manual please let us
know.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

end of thread, other threads:[~2011-07-04  7:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-21 21:48 [Bug python/12918] New: Can not get symtab_and_line object given an arbitrary program counter er_31337 at yahoo dot com
2011-07-04  7:07 ` [Bug python/12918] " ratmice at gmail dot com

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