[PUSHED] [gdb/build, s390x] Fix build after gdbarch_tdep changes

Simon Marchi simon.marchi@polymtl.ca
Wed Nov 17 16:45:22 GMT 2021


On 2021-11-17 10:41 a.m., Andreas Arnez wrote:
> On Wed, Nov 17 2021, Simon Marchi wrote:
>
> [...]
>
>> I would have suggested that s390-tdep.h should include gdbarch.h, since
>> it now relies on being able to see the struct gdbarch definition.
>
> Hm, sorry.  My intention was just to get the build breakage out of the
> way as quickly as possible

Yes, and thanks for doing that.

> Is the patch below OK?
>
> ---- 8< ----
> From abe1bec38982a20666d832f3eeb528d97a83341d Mon Sep 17 00:00:00 2001
> From: Andreas Arnez <arnez@li-32acfd01-53a8-11cb-b225-9c4f961b6dbf.ibm.com>
> Date: Wed, 17 Nov 2021 16:32:28 +0100
> Subject: [PATCH] [gdb/tdep, s390x] Include gdbarch.h in s390-tdep.h
>
> Since commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation"),
> s390-tdep.h requires that gdbarch.h has been included before, specifically
> for the declaration of gdbarch_tdep.  Thus expclicitly include gdbarch.h
> in s390-tdep.h to fulfill that requirement.
> ---
>  gdb/s390-tdep.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gdb/s390-tdep.h b/gdb/s390-tdep.h
> index 191977ecf50..dec3cebe53b 100644
> --- a/gdb/s390-tdep.h
> +++ b/gdb/s390-tdep.h
> @@ -20,6 +20,7 @@
>  #ifndef S390_TDEP_H
>  #define S390_TDEP_H
>
> +#include "gdbarch.h"
>  #include "prologue-value.h"
>
>  enum s390_abi_kind

LGTM.  I am preparing a patch that updates all header files that I
touched to include gdbarch.h, so that would include s390-tdep.h, but
feel free to push your patch if you want.

Simon


More information about the Gdb-patches mailing list