Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Raoul Gough" <RaoulGough@yahoo.co.uk>
To: gdb-patches@sources.redhat.com
Subject: Re: coffread.c extension for DLLs without debugging symbols
Date: Fri, 10 Jan 2003 22:45:00 -0000	[thread overview]
Message-ID: <avnic8$q5i$1@main.gmane.org> (raw)
In-Reply-To: <15898.13355.611979.991969@localhost.redhat.com>

"Elena Zannoni" <ezannoni@redhat.com> wrote in message
news:15898.13355.611979.991969@localhost.redhat.com...
> Raoul Gough writes:

>  > OK, this is no problem. In fact the K&R style functions are
straight
>  > out of pe-dll.c from ld, and I think there are existing bfd_
functions
>  > that do the same thing. I'll fix the code to use the bfd
functions
>  > (removing the K&R style functions) and also sort out the other
>  > formatting issues as well.
>  >
> thanks

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....).

[snip]
>  > > As far as the new code being triggered, could you do it based
on the
>  > > existance of some particular section/data in the objfile?  I
see
>  > that
>  > > you bail out of read_pe_exported_syms if there are no exports,
could
>  > > something on the same flavour be done? (like using
bfd_get_flavour,
>  > > or bfd_get_section_by_name, etc)
>  >
>  > Not sure what you mean here - it currently uses both the pe_file
flag
>  > and bfd_get_target() to check whether to proceed with the
processing.
>  > I could also add a get_section_by_name(".edata") I guess.
>  >
>
> Usually gdb triggers reading one debug format or another depending
on
> the presence of certain sections names. So here, instead of looking
at
> the target you can look at the existance of .edata.
>
> Look at elfread.c and how it finds which debug format is used.  It
is
> 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
.exe files).

>
>  > >
>  > > About location of the code, add maybe a coff-pe-read.c? (ulgh)
But
>  > > since it deals with reading symbols, I would think it more
logical
>  > 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
the
>  > new function, though. Does this also mean changing the config
somehow
>  > to make it compile the new module under the right circumstances?
Any
>  > advice on doing this?
>  >
>
> No, I just meant that the functions to manipulate these symbols
could
> 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).

Regards,
Raoul Gough.



  reply	other threads:[~2003-01-10 22:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-03 19:41 Raoul Gough
2003-01-04  0:53 ` Michael Snyder
2003-01-04  4:43 ` Christopher Faylor
2003-01-04 16:31   ` Raoul Gough
2003-01-04 17:54     ` Eli Zaretskii
2003-01-04 20:51     ` Christopher Faylor
2003-01-05 14:44       ` Mark Kettenis
2003-01-05 17:18         ` Christopher Faylor
2003-01-05 17:40           ` Daniel Jacobowitz
2003-01-07  1:03       ` Raoul Gough
2003-01-07  1:12         ` Daniel Jacobowitz
2003-01-07 13:11       ` Raoul Gough
2003-01-07 16:46         ` Christopher Faylor
2003-01-07  2:28     ` Michael Snyder
2003-01-07  2:24   ` Michael Snyder
2003-01-04 11:03 ` Eli Zaretskii
2003-01-04 16:21   ` Raoul Gough
2003-01-06 17:10   ` Elena Zannoni
2003-01-06 17:41     ` Christopher Faylor
2003-01-07  0:46     ` Raoul Gough
2003-01-07  1:53       ` Elena Zannoni
2003-01-10 22:45         ` Raoul Gough [this message]
2003-01-07  1:00     ` Andrew Cagney
2003-01-10 22:37       ` Raoul Gough
2003-01-04 16:42 Michael Elizabeth Chastain
2003-01-05 15:40 ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='avnic8$q5i$1@main.gmane.org' \
    --to=raoulgough@yahoo.co.uk \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox