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]

Chicken-or-egg problem with shared libraries


In solib-svr4.c (enable_break), GDB tries to set a breakpoint in the
dynamic loader (at "_dl_debug_state") so that shared objects can be
tracked as they are loaded and unloaded.

The problem (on gnu/linux PowerPC64 at least) is that the dynamic loader
is it's self a shared object and its minimal symbols are not loaded when
"enable_break" is called.  

I have two ideas for fixing this: 1) pre-load the dynamic loaders
minimal symbols so that when "enable_break()" is called,
"_dl_debug_state" will be found and all is well and 2) allow
"enable_break()" to set a pending breakpoint.

The second idea has the problem of which name to use: "enable_break()"
currently tries five or six.

I like the first idea, but something is nagging the back of my mind
about it, but I don't know what.  I think we're talking about less the
20 minimal symbols and the name of the of the dynamic linker is in the
elf section '.interp'.  So that sounds straight forward.

Any advice?

-=# Paul #=-






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