[PATCH] Define NetBSD specific skip_solib_resolver

Kamil Rytarowski n54@gmx.com
Tue Apr 7 17:08:19 GMT 2020


On 07.04.2020 17:42, Tom Tromey wrote:
>>>>>> "Kamil" == Kamil Rytarowski <n54@gmx.com> writes:
>
> Kamil> gdb/ChangeLog:
> Kamil> 	* nbsd-tdep.c: Include "objfiles.h".
> Kamil> 	(nbsd_skip_solib_resolver): New.
> Kamil> 	(nbsd_init_abi): Call set_gdbarch_skip_solib_resolver().
>
> Thanks.
>
> Kamil> +#include "objfiles.h"
>
> It doesn't really matter to me (gdb isn't anywhere near header
> cleanliness), but I wonder why this include was needed.
>

If I remove the include, I get:

In file included from solist.h:24,
                 from solib-svr4.h:23,
                 from nbsd-tdep.c:23:
nbsd-tdep.c: In function ‘CORE_ADDR nbsd_skip_solib_resolver(gdbarch*,
CORE_ADDR)’:
symtab.h:758:18: error: invalid use of incomplete type ‘struct objfile’
       + (objfile)->section_offsets[(symbol)->section]))
                  ^~
symtab.h:761:3: note: in expansion of macro ‘MSYMBOL_VALUE_ADDRESS’
   MSYMBOL_VALUE_ADDRESS ((symbol).objfile, (symbol).minsym)
   ^~~~~~~~~~~~~~~~~~~~~
nbsd-tdep.c:351:22: note: in expansion of macro ‘BMSYMBOL_VALUE_ADDRESS’
   if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
                      ^~~~~~~~~~~~~~~~~~~~~~
In file included from symtab.h:28,
                 from solist.h:24,
                 from solib-svr4.h:23,
                 from nbsd-tdep.c:23:
gdbtypes.h:547:10: note: forward declaration of ‘struct objfile’
   struct objfile *objfile;
          ^~~~~~~
nbsd-tdep.c:355:1: error: control reaches end of non-void function
[-Werror=return-type]
 }
 ^
cc1plus: all warnings being treated as errors

> Kamil> +  msym = lookup_minimal_symbol("_rtld_bind_start", NULL, NULL);
>
> Missing a space before the "(".
>

OK!

> Ok with that change.
>
> Tom
>



More information about the Gdb-patches mailing list