From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Buettner To: Nick Duffek Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] osfsolib.c: support Tru64 5.x Date: Tue, 15 May 2001 17:02:00 -0000 Message-id: <1010516000146.ZM9797@ocotillo.lan> References: <1010513070637.ZM31193@ocotillo.lan> <200105150144.f4F1i2208435@rtl.cygnus.com> X-SW-Source: 2001-05/msg00328.html On May 14, 9:44pm, Nick Duffek wrote: > >Is there any chance that osfsolib.c could be reworked into a solib.c > >backend? > > Okay, I've just finished doing that. It's nice to delete so much > duplicated code; the new file is 60% the size of the old one. Very cool. Thanks for doing this. > Is there any pending gdbint.texinfo documentation on how to implement > shared library support using solib.c? If not, I volunteer to write a > brief explanation, while it's fresh in my mind. I have nothing planned. I think it'd be great if you'd write up the documentation. > I ran into a couple of problems: > > 1. It's necessary for the target_so_ops.current_sos callback to zero at > least the so_list.section field of each element it returns. Otherwise, > solib_map_sections() passes a bogus pointer to build_section_table(), > which frees the bogus pointer. > > What do you think about a patch like this? > > Index: gdb/solist.h > =================================================================== > diff -up gdb/solist.h gdb/solist.h > --- gdb/solist.h Mon May 14 21:17:56 2001 > +++ gdb/solist.h Mon May 14 21:17:46 2001 > @@ -52,7 +52,9 @@ struct so_list > > /* The following fields of the structure are built from > information gathered from the shared object file itself, and > - are initialized when we actually add it to our symbol tables. */ > + are set when we actually add it to our symbol tables. > + > + current_sos must initialize these fields to 0. */ > > bfd *abfd; > char symbols_loaded; /* flag: symbols read in yet? */ Good catch. Please check this in. > 2. Because Tru64 doesn't use ELF binaries, "info sharedlibrary" > incorrectly infers the address size to be 32 bits, so output address > fields are too narrow: > > (gdb) inf shared > From To Syms Read Shared Object Library > 0x3ff800cd8100x3ff801ca290Yes /usr/shlib/libc.so > (gdb) > > Some possible fixes: > (a) Default to 64 instead of 32 bits. > (b) Use something like bfd_arch_bits_per_address(exec_bfd) instead of > or in addition to bfd_get_arch_size (exec_bfd). Option (b) sounds better to me. > I'll post the new osfsolib.c patch as soon as I finish regression-testing > it. Cool. I'm looking forward to seeing it. Thanks, Kevin