This is the mail archive of the
mailing list for the GDB project.
Re: coffread.c extension for DLLs without debugging symbols
"Elena Zannoni" <firstname.lastname@example.org> wrote in message
> Raoul Gough writes:
> > OK, this is no problem. In fact the K&R style functions are
> > out of pe-dll.c from ld, and I think there are existing bfd_
> > that do the same thing. I'll fix the code to use the bfd
> > (removing the K&R style functions) and also sort out the other
> > formatting issues as well.
Actually, I've left those functions in after all, but reformatted
them. Turns out that the bfd_ functions are different enough that I
didn't want to try the change (if it's not broken....).
> > > As far as the new code being triggered, could you do it based
> > > existance of some particular section/data in the objfile? I
> > that
> > > you bail out of read_pe_exported_syms if there are no exports,
> > > something on the same flavour be done? (like using
> > > or bfd_get_section_by_name, etc)
> > Not sure what you mean here - it currently uses both the pe_file
> > and bfd_get_target() to check whether to proceed with the
> > I could also add a get_section_by_name(".edata") I guess.
> Usually gdb triggers reading one debug format or another depending
> the presence of certain sections names. So here, instead of looking
> the target you can look at the existance of .edata.
> Look at elfread.c and how it finds which debug format is used. It
> not using get_section_by_name(), but the idea is similar.
I've decided to stick with the bfd_get_target, because I'd like to
make sure that the code only attempts to process i386 PE files (it
might work on, say, Alpha, but I can't test it). I'm sure there are
other ways to check this, but coffread.c already uses the target name
to set up the pe_file flag.
Note also that the .edata section can be empty (seems to happen with
> > >
> > > About location of the code, add maybe a coff-pe-read.c? (ulgh)
> > > since it deals with reading symbols, I would think it more
> > to
> > > stay in some object/debug format related file rather than in a
> > target
> > > related file.
> > I agree - there will still have to be a hook in coffread to call
> > new function, though. Does this also mean changing the config
> > to make it compile the new module under the right circumstances?
> > advice on doing this?
> No, I just meant that the functions to manipulate these symbols
> be moved into their own file. Gdb always includes all the
> debug/objfile readers in each build, so no need to tweak configure.
coff-pe-read it is (see my other posting for the new patches).