Re: [PATCH] Define NetBSD specific skip_solib_resolver
On 07.04.2020 17:42, Tom Tromey wrote:
>>>>>> "Kamil" == Kamil Rytarowski <[hidden email]> 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().
> 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,
nbsd-tdep.c: In function ‘CORE_ADDR nbsd_skip_solib_resolver(gdbarch*,
symtab.h:758:18: error: invalid use of incomplete type ‘struct objfile’
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,
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
cc1plus: all warnings being treated as errors
> Kamil> + msym = lookup_minimal_symbol("_rtld_bind_start", NULL, NULL);
> Missing a space before the "(".