Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* How to do "info address" directly from python?
@ 2018-07-27 12:16 David Griffiths
  2018-07-27 12:41 ` Emiliano Testa
  2018-08-08 14:39 ` Tom Tromey
  0 siblings, 2 replies; 3+ messages in thread
From: David Griffiths @ 2018-07-27 12:16 UTC (permalink / raw)
  To: gdb

Hi, I can obtain the address of a non-debug symbol in python by doing:

gdb.execute("info address %s" % symbol, to_string=True)

and then parsing the result, but is there a way to obtain that information
directly using the python api? I've tried things like
gdb.lookup_global_symbol, gdb.lookup_type and gdb.parse_and_eval but none
of them return anything.

I'd prefer not to use gdb.execute as it sometimes gets the output of the
command mixed up with the output of a preceding gdb.write.

Cheers,

David


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

end of thread, other threads:[~2018-08-08 14:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27 12:16 How to do "info address" directly from python? David Griffiths
2018-07-27 12:41 ` Emiliano Testa
2018-08-08 14:39 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox