This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

debugging dlmopened code in new namespaces


hi,

I would like to be able to debug (that is, place breakpoints using
symbolic names and get symbolic names from backtraces) code which was
dlmopened with LM_ID_NEWLM, that is, which was loaded in a new
namespace. The idea is that gdb should be able to maintain address range
information on each elf binary loaded through this mechanism. The
question is how could gdb get access to the link_map associated to a
given namespace ?

In SunOS, access to all loaded binaries is performed through the rtld_db
library which can list all loaded elf binaries, including those coming
from other namespaces. (there is a rl_lmident field in the rd_loadobj_t
structure)

In glibc, as far as I can tell, the relevant r_debug datastructures are
stored in an array (indexed by the namespace number) within the
rtld_global global data structure. I could make gdb perform a symbol
lookup for this rtld_global data structure and then snoop in it but I
have been told that this is expected to be fragile since this data
structure is not public: its layout can thus change from one release to
the other. So, the question is: what other mechanism could libc give us
to get access to the r_debug of each namespace ? I could not find any
equivalent of the rtld_db library: is there something else ?


regards,
Mathieu
-- 


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