This is the mail archive of the gdb-patches@sources.redhat.com 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]

Re: Patching gdb 5.0 for XFree86 module support


> I've been working the last few days on porting an older gdb 
> 4.18 patch that adds support to gdb for debugging XFree86 
> loadable modules in place without requiring a static server 
> build.  This has several advantages for an XFree86 developer, as 
> well as for the more technical user out there who is capable of 
> debugging a problem, but not necessarily willing or capable to 
> rebuild XFree86 from source as a static server.

Just FYI, shared library support in current GDB is very different to 
that found in 5.0.  It was overhalled and made far far more modular.

Looking at this patch and especially the comment:

>> +/* The XFree server has its own dynamic load mechanism. Unlike shared
>> + * libraries it loads regular .o (or even .a) files. GDB support for
>> + * tracking loaded modules is very similar to shared libraries however
>> + * (in fact much of this code originated in solib.c).
>> + *
>> + * There are a few differences. We don't need to do very much in the
>> + * create_inferior hook as no modules are loaded at that point so we
>> + * just tidy up after the last run, tell the inferior that we're
>> + * around and insert a breakpoint so we get chance to do something
>> + * when a module is loaded.
>> + *
>> + */

the basic idea is sound.  Per Daniel J's comment several people have 
proposed similar things while makig the observation that the current 
shlib implementation should be generalized.

Andrew

PS: Since the patch is very old, I'll just add a heads up that I'll need 
to run the usual checks.



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