This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] PATCH: finding a function with address
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Subject: Re: [RFA] PATCH: finding a function with address
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Thu, 08 Feb 2001 11:57:36 -0800
- CC: Michael Elizabeth Chastain <chastain at cygnus dot com>, "Peter.Schauer" <Peter dot Schauer at Regent dot E-Technik dot TU-Muenchen dot DE>, gdb-patches at sources dot redhat dot com
- Organization: Red Hat
- References: <200102051329.FAA31142@bosch.cygnus.com> <200102051025.LAA26655@reisser.regent.e-technik.tu-muenchen.de> <200102081827.NAA25508@indy.delorie.com>
OK, Eli, I'm not the symtab maintainer, but I wrote that code,
and I think your change is reasonable. -- Michael Snyder
Eli Zaretskii wrote:
>
> I wrote:
>
> > Here's the scoop: many debug formats, including COFF, put NULL into
> > SYMBOL_BFD_SECTION, see `prim_record_minimal_symbol' and all its
> > callers. This makes `lookup_minimal_symbol_by_pc_section' reject all
> > symbols it finds, and come up empty handed.
> >
> > Can someone who knows his/her way inside minsyms.c please suggest how
> > to fix this? It seems that in its current shape,
> > `lookup_minimal_symbol_by_pc_section' is too harsh to quite a few
> > platforms, so I think we'd better change that. Would an additional
> > test for SYMBOL_BFD_SECTION being non-NULL be okay, for example?
>
> Well, since no one replied, I'm now turning this into RFA ;-)
>
> The following patch allows targets where SYMBOL_BFD_SECTION is NULL,
> in particular targets which use COFF debug info, to use "info symbol"
> as advertised.
>
> Okay to commit?
>
> 2001-02-07 Eli Zaretskii <eliz@is.elta.co.il>
>
> * minsyms.c (lookup_minimal_symbol_by_pc_section): Don't skip
> symbols whose SYMBOL_BFD_SECTION is NULL.
>
> --- gdb/minsyms.c~0 Fri Dec 15 03:01:48 2000
> +++ gdb/minsyms.c Wed Feb 7 20:29:38 2001
> @@ -482,6 +482,10 @@ lookup_minimal_symbol_by_pc_section (COR
> /* This is the new code that distinguishes it from the old function */
> if (section)
> while (hi >= 0
> + /* Some types of debug info, such as COFF,
> + don't fill the bfd_section member, so don't
> + throw away symbols on those platforms. */
> + && SYMBOL_BFD_SECTION (&msymbol[hi]) != NULL
> && SYMBOL_BFD_SECTION (&msymbol[hi]) != section)
> --hi;
>