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]

PythonGDB access to the loaded ELF files


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


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