This is the mail archive of the
mailing list for the GDB project.
Re: How to do "info address" directly from python?
- From: Emiliano Testa <etesta at undo dot io>
- To: David Griffiths <dgriffiths at undo dot io>
- Cc: gdb at sourceware dot org
- Date: Fri, 27 Jul 2018 13:41:26 +0100
- Subject: Re: How to do "info address" directly from python?
- References: <CA++j6c6+7cGUq=7B2Q7TBhX=p6qjqJYVOp=N=-g8ZW2iz+TmhQ@mail.gmail.com>
I'm not knowledgeable in this context much... googling a bit helped in
does it look helpful?
On 27 July 2018 at 13:16, David Griffiths <email@example.com> wrote:
> 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.
Undo software engineer
22 Station Road