From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Buettner To: Stephen Smith Cc: gdb@sourceware.cygnus.com Subject: Re: GDB and shared libraries Date: Mon, 26 Feb 2001 18:05:00 -0000 Message-id: <1010227011935.ZM13399@ocotillo.lan> 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> <3A9AF77C.64785824@home.com> X-SW-Source: 2001-02/msg00400.html On Feb 26, 5:40pm, Stephen Smith wrote: > Kevin Buettner wrote: > > > > > 1) Modify your shared library implementation so that solib-svr4.c > > (in the gdb sources) will work for you. Recall that in private > > email I suggested defining SVR4_FETCH_LINK_MAP_OFFSETS for your > > target. This is easy to do; just take a look at struct > > r_debug and struct link_map and figure out the offsets from > > the beginning of the struct to each member n the struct. > > Then construct a small function to fill in the fields of > > GDB's struct link_map_offsets. You may even be able to > > use the example at > > > > http://sources.redhat.com/ml/gdb-patches/2000-10/msg00147.html > > > > verbatim. > > I take it you meant, Modify your shared library implementation of gdb... > > Is that correct? No. >From your other email (including some of the private ones) it sounded to me like you had the source to the OS and you could modify the dynamic loader. So I meant for the above to be split up into two parts: a) OS / Library side work in making the dynamic loader behave like other SVR4 shared library implementations. b) In GDB, define SVR4_FETCH_LINK_MAP_OFFSETS for your target. If you can do (a), then doing (b) will be trivial. If you look over some of my past email, you'll see that I've sketched out what needs to be done for (a). If you end up going the other route of adding a new solib backend for GDB, you may still end up doing some work in the dynamic loader anyway. Basically, your dynamic loader and GDB need to agree on an interface for 1) notifying GDB of when a shared object has been loaded/unloaded, and 2) obtaining the names of the currently loaded shared objects and their load addresses. Kevin