This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [RFA] PATCH: finding a function with address


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;
>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]