From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 8FAD938515FF; Thu, 7 Apr 2022 15:07:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8FAD938515FF Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: make gdbarch_register_reggroup_p take a const reggroup * X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: b5556e33b5cbe101257074c497178df6de293c3e X-Git-Newrev: dbf5d61bdad9131d31c3410f123db3e296d91dfc Message-Id: <20220407150756.8FAD938515FF@sourceware.org> Date: Thu, 7 Apr 2022 15:07:56 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2022 15:07:56 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Ddbf5d61bdad9= 131d31c3410f123db3e296d91dfc commit dbf5d61bdad9131d31c3410f123db3e296d91dfc Author: Andrew Burgess Date: Thu Mar 31 12:36:06 2022 +0100 gdb: make gdbarch_register_reggroup_p take a const reggroup * =20 Change gdbarch_register_reggroup_p to take a 'const struct reggroup *' argument. This requires a change to the gdb/gdbarch-components.py script, regeneration of gdbarch.{c,h}, and then updates to all the architectures that implement this method. =20 There should be no user visible changes after this commit. Diff: --- gdb/aarch64-tdep.c | 2 +- gdb/alpha-tdep.c | 2 +- gdb/amd64-linux-tdep.c | 2 +- gdb/arm-tdep.c | 2 +- gdb/csky-tdep.c | 2 +- gdb/gdbarch-components.py | 2 +- gdb/gdbarch-gen.h | 4 ++-- gdb/gdbarch.c | 2 +- gdb/i386-linux-tdep.c | 2 +- gdb/i386-tdep.c | 2 +- gdb/i386-tdep.h | 2 +- gdb/ia64-tdep.c | 2 +- gdb/lm32-tdep.c | 2 +- gdb/m32c-tdep.c | 2 +- gdb/m68hc11-tdep.c | 2 +- gdb/mep-tdep.c | 2 +- gdb/mips-tdep.c | 4 ++-- gdb/msp430-tdep.c | 2 +- gdb/nds32-tdep.c | 2 +- gdb/reggroups.c | 2 +- gdb/reggroups.h | 2 +- gdb/riscv-tdep.c | 2 +- gdb/rl78-tdep.c | 2 +- gdb/rs6000-tdep.c | 2 +- gdb/s390-tdep.c | 2 +- gdb/sh-tdep.c | 2 +- gdb/target-descriptions.c | 4 ++-- gdb/target-descriptions.h | 2 +- gdb/xtensa-tdep.c | 4 ++-- 29 files changed, 33 insertions(+), 33 deletions(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index fb1434c97a3..cdeeece83c0 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -2695,7 +2695,7 @@ aarch64_pseudo_register_type (struct gdbarch *gdbarch= , int regnum) =20 static int aarch64_pseudo_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { aarch64_gdbarch_tdep *tdep =3D (aarch64_gdbarch_tdep *) gdbarch_tdep (gd= barch); =20 diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 7f3af216675..f04bad6bed8 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -139,7 +139,7 @@ alpha_register_type (struct gdbarch *gdbarch, int regno) =20 static int alpha_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { /* Filter out any registers eliminated, but whose regnum is=20 reserved for backward compatibility, e.g. the vfp. */ diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index 88a24c176e8..0e5194fbeee 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -279,7 +279,7 @@ static int amd64_linux_sc_reg_offset[] =3D =20 static int amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) {=20 if (regnum =3D=3D AMD64_LINUX_ORIG_RAX_REGNUM || regnum =3D=3D AMD64_FSBASE_REGNUM diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 3e91dd707b0..fbc0a38bff3 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -9105,7 +9105,7 @@ arm_elf_osabi_sniffer (bfd *abfd) =20 static int arm_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { /* FPS register's type is INT, but belongs to float_reggroup. Beside this, FPS register belongs to save_regroup, restore_reggroup, and diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index 09e8fc57246..f1376730c87 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -2063,7 +2063,7 @@ csky_add_reggroups (struct gdbarch *gdbarch) =20 static int csky_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *reggroup) + const struct reggroup *reggroup) { int raw_p; =20 diff --git a/gdb/gdbarch-components.py b/gdb/gdbarch-components.py index c820ddae764..e8f20c83ff0 100644 --- a/gdb/gdbarch-components.py +++ b/gdb/gdbarch-components.py @@ -1460,7 +1460,7 @@ Is a register in a group """, type=3D"int", name=3D"register_reggroup_p", - params=3D[("int", "regnum"), ("struct reggroup *", "reggroup")], + params=3D[("int", "regnum"), ("const struct reggroup *", "reggroup")], predefault=3D"default_register_reggroup_p", invalid=3DFalse, ) diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h index 7a8721328ab..882b9057b1a 100644 --- a/gdb/gdbarch-gen.h +++ b/gdb/gdbarch-gen.h @@ -833,8 +833,8 @@ extern void set_gdbarch_address_class_name_to_type_flag= s (struct gdbarch *gdbarc =20 /* Is a register in a group */ =20 -typedef int (gdbarch_register_reggroup_p_ftype) (struct gdbarch *gdbarch, = int regnum, struct reggroup *reggroup); -extern int gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnu= m, struct reggroup *reggroup); +typedef int (gdbarch_register_reggroup_p_ftype) (struct gdbarch *gdbarch, = int regnum, const struct reggroup *reggroup); +extern int gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnu= m, const struct reggroup *reggroup); extern void set_gdbarch_register_reggroup_p (struct gdbarch *gdbarch, gdba= rch_register_reggroup_p_ftype *register_reggroup_p); =20 /* Fetch the pointer to the ith function argument. */ diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index ff404f47727..a588bdef61a 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -3632,7 +3632,7 @@ set_gdbarch_address_class_name_to_type_flags (struct = gdbarch *gdbarch, } =20 int -gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, struct r= eggroup *reggroup) +gdbarch_register_reggroup_p (struct gdbarch *gdbarch, int regnum, const st= ruct reggroup *reggroup) { gdb_assert (gdbarch !=3D NULL); gdb_assert (gdbarch->register_reggroup_p !=3D NULL); diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 1f1aaa7d60a..5d7f54194af 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -54,7 +54,7 @@ group. Put the LINUX_ORIG_EAX register in the system group. */ static int i386_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { if (regnum =3D=3D I386_LINUX_ORIG_EAX_REGNUM) return (group =3D=3D system_reggroup diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 870cacaf0d3..400ccd6bebf 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -4557,7 +4557,7 @@ i386_add_reggroups (struct gdbarch *gdbarch) =20 int i386_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { const i386_gdbarch_tdep *tdep =3D (i386_gdbarch_tdep *) gdbarch_tdep (gd= barch); int fp_regnum_p, mmx_regnum_p, xmm_regnum_p, mxcsr_regnum_p, diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h index eb58dd68e73..a8067cf6b6c 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -418,7 +418,7 @@ extern int i386_sigtramp_p (struct frame_info *this_fra= me); =20 /* Return non-zero if REGNUM is a member of the specified group. */ extern int i386_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group); + const struct reggroup *group); =20 /* Supply register REGNUM from the general-purpose register set REGSET to register cache REGCACHE. If REGNUM is -1, do this for all diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index c2d1a475bab..69a4b4db4fd 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -322,7 +322,7 @@ ia64_ext_type (struct gdbarch *gdbarch) =20 static int ia64_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { int vector_p; int float_p; diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index cb516e846f4..f3f1f87d6bb 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -73,7 +73,7 @@ lm32_add_reggroups (struct gdbarch *gdbarch) =20 static int lm32_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { if (group =3D=3D general_reggroup) return ((regnum >=3D SIM_LM32_R0_REGNUM) && (regnum <=3D SIM_LM32_RA_R= EGNUM)) diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index 5e4844bda0a..94087302892 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -252,7 +252,7 @@ m32c_debug_info_reg_to_regnum (struct gdbarch *gdbarch,= int reg_nr) =20 static int m32c_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { m32c_gdbarch_tdep *tdep =3D (m32c_gdbarch_tdep *) gdbarch_tdep (gdbarch); struct m32c_reg *reg =3D &tdep->regs[regnum]; diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 070eeb8b3da..f1133fe6780 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1372,7 +1372,7 @@ m68hc11_add_reggroups (struct gdbarch *gdbarch) =20 static int m68hc11_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { /* We must save the real hard register as well as gcc soft registers including the frame pointer. */ diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index d16c68e6fb6..8f2f0a3b30d 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -1028,7 +1028,7 @@ static struct reggroup *mep_ccr_reggroup; /* coproces= sor control */ =20 static int mep_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { /* Filter reserved or unused register numbers. */ { diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 4bdbf0fcdb7..9157e9fa143 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -698,7 +698,7 @@ mips_register_name (struct gdbarch *gdbarch, int regno) =20 static int mips_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *reggroup) + const struct reggroup *reggroup) { int vector_p; int float_p; @@ -738,7 +738,7 @@ mips_register_reggroup_p (struct gdbarch *gdbarch, int = regnum, =20 static int mips_tdesc_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *reggroup) + const struct reggroup *reggroup) { int rawnum =3D regnum % gdbarch_num_regs (gdbarch); int pseudo =3D regnum / gdbarch_num_regs (gdbarch); diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c index 86277e0b186..28268a95139 100644 --- a/gdb/msp430-tdep.c +++ b/gdb/msp430-tdep.c @@ -203,7 +203,7 @@ msp430_register_name (struct gdbarch *gdbarch, int regn= r) =20 static int msp430_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { if (group =3D=3D all_reggroup) return 1; diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c index f8548561853..425d7d90d64 100644 --- a/gdb/nds32-tdep.c +++ b/gdb/nds32-tdep.c @@ -368,7 +368,7 @@ nds32_add_reggroups (struct gdbarch *gdbarch) =20 static int nds32_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *reggroup) + const struct reggroup *reggroup) { const char *reg_name; const char *group_name; diff --git a/gdb/reggroups.c b/gdb/reggroups.c index 169285b7475..d5a263f8109 100644 --- a/gdb/reggroups.c +++ b/gdb/reggroups.c @@ -190,7 +190,7 @@ reggroup_prev (struct gdbarch *gdbarch, const struct re= ggroup *curr) /* Is REGNUM a member of REGGROUP? */ int default_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { int vector_p; int float_p; diff --git a/gdb/reggroups.h b/gdb/reggroups.h index ef99483f39f..df8e871e365 100644 --- a/gdb/reggroups.h +++ b/gdb/reggroups.h @@ -66,6 +66,6 @@ extern reggroup *reggroup_find (struct gdbarch *gdbarch, = const char *name); =20 /* Is REGNUM a member of REGGROUP? */ extern int default_register_reggroup_p (struct gdbarch *gdbarch, int regnu= m, - struct reggroup *reggroup); + const struct reggroup *reggroup); =20 #endif diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index 2752937f601..8713652b099 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -1271,7 +1271,7 @@ riscv_is_unknown_csr (struct gdbarch *gdbarch, int re= gnum) =20 static int riscv_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *reggroup) + const struct reggroup *reggroup) { /* Used by 'info registers' and 'info registers '. */ =20 diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c index df04939acb1..6ea0473081d 100644 --- a/gdb/rl78-tdep.c +++ b/gdb/rl78-tdep.c @@ -586,7 +586,7 @@ rl78_g10_register_name (struct gdbarch *gdbarch, int re= gnr) =20 static int rl78_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { if (group =3D=3D all_reggroup) return 1; diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 5bf43644a8e..44828bcff6d 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -2642,7 +2642,7 @@ rs6000_pseudo_register_type (struct gdbarch *gdbarch,= int regnum) =20 static int rs6000_pseudo_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { ppc_gdbarch_tdep *tdep =3D (ppc_gdbarch_tdep *) gdbarch_tdep (gdbarch); =20 diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index e54348be04a..14b03a167d7 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1440,7 +1440,7 @@ s390_pseudo_register_write (struct gdbarch *gdbarch, = struct regcache *regcache, =20 static int s390_pseudo_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { s390_gdbarch_tdep *tdep =3D (s390_gdbarch_tdep *) gdbarch_tdep (gdbarch); =20 diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index c12d40b604c..2341a9beef6 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -1490,7 +1490,7 @@ sh_default_register_type (struct gdbarch *gdbarch, in= t reg_nr) TODO: sh2a and dsp registers. */ static int sh_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *reggroup) + const struct reggroup *reggroup) { if (gdbarch_register_name (gdbarch, regnum) =3D=3D NULL || *gdbarch_register_name (gdbarch, regnum) =3D=3D '\0') diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index ae3b8211167..33277c3d02d 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -1007,7 +1007,7 @@ tdesc_remote_register_number (struct gdbarch *gdbarch= , int regno) =20 int tdesc_register_in_reggroup_p (struct gdbarch *gdbarch, int regno, - struct reggroup *reggroup) + const struct reggroup *reggroup) { struct tdesc_reg *reg =3D tdesc_find_register (gdbarch, regno); =20 @@ -1028,7 +1028,7 @@ tdesc_register_in_reggroup_p (struct gdbarch *gdbarch= , int regno, =20 static int tdesc_register_reggroup_p (struct gdbarch *gdbarch, int regno, - struct reggroup *reggroup) + const struct reggroup *reggroup) { int num_regs =3D gdbarch_num_regs (gdbarch); int num_pseudo_regs =3D gdbarch_num_pseudo_regs (gdbarch); diff --git a/gdb/target-descriptions.h b/gdb/target-descriptions.h index 9d959977062..3b90dedcd80 100644 --- a/gdb/target-descriptions.h +++ b/gdb/target-descriptions.h @@ -229,7 +229,7 @@ struct type *tdesc_find_type (struct gdbarch *gdbarch, = const char *id); specify a group. */ =20 int tdesc_register_in_reggroup_p (struct gdbarch *gdbarch, int regno, - struct reggroup *reggroup); + const struct reggroup *reggroup); =20 /* Methods for constructing a target description. */ =20 diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 203d2e883df..62be13643b2 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -755,7 +755,7 @@ xtensa_add_reggroups (struct gdbarch *gdbarch) } =20 static int=20 -xtensa_coprocessor_register_group (struct reggroup *group) +xtensa_coprocessor_register_group (const struct reggroup *group) { int i; =20 @@ -776,7 +776,7 @@ xtensa_coprocessor_register_group (struct reggroup *gro= up) static int xtensa_register_reggroup_p (struct gdbarch *gdbarch, int regnum, - struct reggroup *group) + const struct reggroup *group) { xtensa_gdbarch_tdep *tdep =3D (xtensa_gdbarch_tdep *) gdbarch_tdep (gdba= rch); xtensa_register_t* reg =3D &tdep->regmap[regnum];