PythonGDB access to the loaded ELF files
Jan Kratochvil
jan.kratochvil@redhat.com
Thu Sep 24 17:16:00 GMT 2015
Hi,
there is a need to access ELF files (from Python in GDB) of loaded inferior
shared libraries, for example to read custom PT_NOTEs there. Has anyone
experience with it?
I guess one can use existing Objfile.filename (*) and open it with one of
several available Python ELF libraries.
One can map PC (from a frame) to Objfile various ways in GDB Python API.
Just I do not see how to relocate the ELF file to read, I do not see how to
access Objfile's any loaded address. (One could only run "info sharedlibrary"
or "info files" and parse its text output but that is sure not acceptable.)
Thanks,
Jan
(*)
Using fd would not be great as BFD closes/reopens it very often, there is
a pending fix for that:
https://sourceware.org/ml/gdb-patches/2015-02/msg00457.html
More information about the Gdb
mailing list