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]

How to do "info address" directly from python?


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


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