From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Smith To: GDB Subject: Re: GDB and shared libraries Date: Tue, 27 Feb 2001 13:14:00 -0000 Message-id: <3A9C18F3.A98359B9@home.com> References: <3A84136A.23BAF90F@home.com> <1010209182220.ZM4621@localhost.localdomain> <3A845A56.5EF8F61@home.com> <3A9AB471.5F46554@home.com> <1010226205415.ZM30678@localhost.localdomain> <3A9ADDF4.FD998D6E@home.com> <1010226233506.ZM13209@ocotillo.lan> <3A9B0022.16ABBBE0@home.com> <1010227013252.ZM13444@ocotillo.lan> <3A9B35E4.33B1868B@home.com> <3A9BD1C8.B1C6DDB1@cygnus.com> X-SW-Source: 2001-02/msg00421.html Andrew Cagney wrote: > > Ok, what do I need to add (commands, data, etc.) to my gdb server to trace into these libraries? Is the spec written > > down? > > Just FYI. > > Most shared library implementations can, in theory, be debugged remotely > without any modifications to the GDB remote protocol. This is because > the SHLIBs are handled using only memory read/writes and breakpoints. > > The ``exercise left to the reader'' is getting what was native-only > SHLIB code re-written in a way that is host independant. >From what I have been told and from looking at the spec it appears that I may have what I need already implemented as far as the remote protocol is concerned (unless I missed something). BTW, thanks kevin for your help. Now here is an example that will go along with my question that hopefully will explain why I am so confused. Remember I am running on target=powerpc-motorola-elf and host = i686-cygwin-pe (this means that gdb is the insight version 5.0). On the target I have the application testapp.exe and the library libtestlib.so. When the OS loads testapp.exe and libtestlib.so it does the fixups and (since we wrote the OS and the gdbserver) we can see the elf headers for both files. We also currently can debug testapp.exe itself. Now, the function main() has a call to lib1Func() which is defined inside of libtestlib.so. I would like to trace into that function. Questions: 1) In the protocol http://sources.redhat.com/gdb/onlinedocs/gdb_14.html#SEC120 I don't see a way to pass back the fixup results that the loader performed. Don't I need to do that? 2) When I step into the function, lib1Func(), how does the gdbserver tell gdb that it needs to load the symbol table from the file libtestlib.so? sps