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


On Sep 24,  1:06am, Andrew Cagney wrote:

> ... proposed similar things while making the observation that the current 
> shlib implementation should be generalized.

I've been giving this a bit of thought.  Until now, it never occurred
to me that we'd want more than one shared library symbol loader active
simultaneously.  For this kind of scenario (non-system library loaders),
I think it would be beneficial to extend GDB's shared lib machinery.

Once this is done, support for the XFree86 loader will be possible
without needing to introduce a new breakpoint type.  The changes to
infrun.c will also become unnecessary.

As to how to extend the solib machinery...

It seems to me that current_target_so_ops could be changed to point at
a chain of target_so_ops structs.  Each of the TARGET_SO_* macros
would be rewritten as functions to invoke the relevant method for each
backend in the chain.  For methods which return values, the
TARGET_SO_* replacement functions would need to construct an
appropriate aggragate return value.  (This is probably not as hard as
it sounds; e.g, TARGET_SO_IN_DYNSYM_RESOLVE_CODE would call the
in_dynsym_resolve_code method for each backend and return 1 (true) if
any of the backend code returned true.  The only moderately tricky one
would be TARGET_SO_CURRENT_SOS(), but I don't see any great difficulty
with making this one work either.)

Kevin


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