From: Andreas Arnez Date: Mon, 3 Mar 2014 09:31:21 +0000 (+0000) Subject: Constify regset structures. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ca7dae4ddfb3363458d866428e45fb5e9b6914b;p=binutils-gdb.git Constify regset structures. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cfd8612b87e..38cd57c5783 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,35 @@ +2014-05-21 Andreas Arnez + + * alpha-linux-tdep.c (alpha_linux_gregset, alpha_linux_fpregset): + Constify structures. + * alphanbsd-tdep.c (alphanbsd_gregset, alphanbsd_fpregset) + (alphanbsd_aout_gregset): Likewise. + * armbsd-tdep.c (armbsd_gregset, armbsd_fpregset): Likewise. + * frv-linux-tdep.c (frv_linux_gregset, frv_linux_fpregset): + Likewise. + * hppa-hpux-tdep.c (hppa_hpux_regset): Likewise. + * hppa-linux-tdep.c (hppa_linux_regset, hppa_linux_fpregset): + Likewise. + * hppanbsd-tdep.c (hppanbsd_gregset): Likewise. + * hppaobsd-tdep.c (hppaobsd_gregset, hppaobsd_fpregset): Likewise. + * m32r-linux-tdep.c (m32r_linux_gregset): Likewise. + * m68kbsd-tdep.c (m68kbsd_gregset, m68kbsd_fpregset): Likewise. + * m88k-tdep.c (m88k_gregset): Likewise. + * mips64obsd-tdep.c (mips64obsd_gregset): Likewise. + * mipsnbsd-tdep.c (mipsnbsd_gregset, mipsnbsd_fpregset): Likewise. + * nios2-linux-tdep.c (nios2_core_regset): Likewise. + * ppcfbsd-tdep.c (ppc32_fbsd_fpregset): Likewise. + * ppcnbsd-tdep.c (ppcnbsd_gregset, ppcnbsd_fpregset): Likewise. + * ppcnbsd-tdep.h (ppcnbsd_gregset, ppcnbsd_fpregset): Likewise. + * ppcobsd-tdep.c (ppcobsd_gregset, ppcobsd_fpregset): Likewise. + * ppcobsd-tdep.h (ppcobsd_gregset, ppcobsd_fpregset): Likewise. + * rs6000-aix-tdep.c (rs6000_aix32_regset, rs6000_aix64_regset): + Likewise. + * sh-tdep.c (sh_corefile_gregset, sh_corefile_fpregset): Likewise. + * sh-tdep.h (sh_corefile_gregset): Likewise. + * tilegx-linux-tdep.c (tilegx_linux_regset): Likewise. + * vax-tdep.c (vax_gregset): Likewise. + 2014-05-21 Jan Kratochvil Fix TLS access for -static -pthread. diff --git a/gdb/alpha-linux-tdep.c b/gdb/alpha-linux-tdep.c index 0f399686942..52f19d078cd 100644 --- a/gdb/alpha-linux-tdep.c +++ b/gdb/alpha-linux-tdep.c @@ -206,13 +206,13 @@ alpha_linux_supply_fpregset (const struct regset *regset, regcache_raw_supply (regcache, ALPHA_FPCR_REGNUM, regs + 31 * 8); } -static struct regset alpha_linux_gregset = +static const struct regset alpha_linux_gregset = { NULL, alpha_linux_supply_gregset }; -static struct regset alpha_linux_fpregset = +static const struct regset alpha_linux_fpregset = { NULL, alpha_linux_supply_fpregset diff --git a/gdb/alphanbsd-tdep.c b/gdb/alphanbsd-tdep.c index 22257900470..58d9f321367 100644 --- a/gdb/alphanbsd-tdep.c +++ b/gdb/alphanbsd-tdep.c @@ -141,19 +141,19 @@ alphanbsd_aout_supply_gregset (const struct regset *regset, /* NetBSD/alpha register sets. */ -static struct regset alphanbsd_gregset = +static const struct regset alphanbsd_gregset = { NULL, alphanbsd_supply_gregset }; -static struct regset alphanbsd_fpregset = +static const struct regset alphanbsd_fpregset = { NULL, alphanbsd_supply_fpregset }; -static struct regset alphanbsd_aout_gregset = +static const struct regset alphanbsd_aout_gregset = { NULL, alphanbsd_aout_supply_gregset diff --git a/gdb/armbsd-tdep.c b/gdb/armbsd-tdep.c index b57af3dda9a..036db6c91ff 100644 --- a/gdb/armbsd-tdep.c +++ b/gdb/armbsd-tdep.c @@ -98,13 +98,13 @@ armbsd_supply_gregset (const struct regset *regset, /* ARM register sets. */ -static struct regset armbsd_gregset = +static const struct regset armbsd_gregset = { NULL, armbsd_supply_gregset }; -static struct regset armbsd_fpregset = +static const struct regset armbsd_fpregset = { NULL, armbsd_supply_fpregset diff --git a/gdb/frv-linux-tdep.c b/gdb/frv-linux-tdep.c index 2ddc3f2ee89..fb163a8de52 100644 --- a/gdb/frv-linux-tdep.c +++ b/gdb/frv-linux-tdep.c @@ -465,13 +465,13 @@ frv_linux_supply_fpregset (const struct regset *regset, /* FRV Linux kernel register sets. */ -static struct regset frv_linux_gregset = +static const struct regset frv_linux_gregset = { NULL, frv_linux_supply_gregset }; -static struct regset frv_linux_fpregset = +static const struct regset frv_linux_fpregset = { NULL, frv_linux_supply_fpregset diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c index 8d4686f0ccc..588f577a5b3 100644 --- a/gdb/hppa-hpux-tdep.c +++ b/gdb/hppa-hpux-tdep.c @@ -1367,7 +1367,7 @@ hppa_hpux_supply_save_state (const struct regset *regset, /* HP-UX register set. */ -static struct regset hppa_hpux_regset = +static const struct regset hppa_hpux_regset = { NULL, hppa_hpux_supply_save_state diff --git a/gdb/hppa-linux-tdep.c b/gdb/hppa-linux-tdep.c index 4e890486673..7a765a21763 100644 --- a/gdb/hppa-linux-tdep.c +++ b/gdb/hppa-linux-tdep.c @@ -491,13 +491,13 @@ hppa_linux_supply_fpregset (const struct regset *regset, } /* HPPA Linux kernel register set. */ -static struct regset hppa_linux_regset = +static const struct regset hppa_linux_regset = { NULL, hppa_linux_supply_regset }; -static struct regset hppa_linux_fpregset = +static const struct regset hppa_linux_fpregset = { NULL, hppa_linux_supply_fpregset diff --git a/gdb/hppanbsd-tdep.c b/gdb/hppanbsd-tdep.c index 466aa69c978..fdc97198cdc 100644 --- a/gdb/hppanbsd-tdep.c +++ b/gdb/hppanbsd-tdep.c @@ -181,7 +181,7 @@ hppanbsd_supply_gregset (const struct regset *regset, /* NetBSD/hppa register set. */ -static struct regset hppanbsd_gregset = +static const struct regset hppanbsd_gregset = { NULL, hppanbsd_supply_gregset diff --git a/gdb/hppaobsd-tdep.c b/gdb/hppaobsd-tdep.c index 7f517dc14e5..8dc03a2d2fb 100644 --- a/gdb/hppaobsd-tdep.c +++ b/gdb/hppaobsd-tdep.c @@ -131,13 +131,13 @@ hppaobsd_supply_fpregset (const struct regset *regset, /* OpenBSD/hppa register sets. */ -static struct regset hppaobsd_gregset = +static const struct regset hppaobsd_gregset = { NULL, hppaobsd_supply_gregset }; -static struct regset hppaobsd_fpregset = +static const struct regset hppaobsd_fpregset = { NULL, hppaobsd_supply_fpregset diff --git a/gdb/m32r-linux-tdep.c b/gdb/m32r-linux-tdep.c index 683b67e8144..bf1fffff80c 100644 --- a/gdb/m32r-linux-tdep.c +++ b/gdb/m32r-linux-tdep.c @@ -388,7 +388,7 @@ m32r_linux_supply_gregset (const struct regset *regset, } } -static struct regset m32r_linux_gregset = { +static const struct regset m32r_linux_gregset = { NULL, m32r_linux_supply_gregset }; diff --git a/gdb/m68kbsd-tdep.c b/gdb/m68kbsd-tdep.c index e59bc668ce7..d27beb8828c 100644 --- a/gdb/m68kbsd-tdep.c +++ b/gdb/m68kbsd-tdep.c @@ -105,13 +105,13 @@ m68kbsd_supply_gregset (const struct regset *regset, /* Motorola 68000 register sets. */ -static struct regset m68kbsd_gregset = +static const struct regset m68kbsd_gregset = { NULL, m68kbsd_supply_gregset }; -static struct regset m68kbsd_fpregset = +static const struct regset m68kbsd_fpregset = { NULL, m68kbsd_supply_fpregset diff --git a/gdb/m88k-tdep.c b/gdb/m88k-tdep.c index bab7feef7b8..56384a71994 100644 --- a/gdb/m88k-tdep.c +++ b/gdb/m88k-tdep.c @@ -799,7 +799,7 @@ m88k_supply_gregset (const struct regset *regset, /* Motorola 88000 register set. */ -static struct regset m88k_gregset = +static const struct regset m88k_gregset = { NULL, m88k_supply_gregset diff --git a/gdb/mips64obsd-tdep.c b/gdb/mips64obsd-tdep.c index 62853ce1417..6d8b9eea31d 100644 --- a/gdb/mips64obsd-tdep.c +++ b/gdb/mips64obsd-tdep.c @@ -61,7 +61,7 @@ mips64obsd_supply_gregset (const struct regset *regset, /* OpenBSD/mips64 register set. */ -static struct regset mips64obsd_gregset = +static const struct regset mips64obsd_gregset = { NULL, mips64obsd_supply_gregset diff --git a/gdb/mipsnbsd-tdep.c b/gdb/mipsnbsd-tdep.c index 97421504064..31b8dca8ece 100644 --- a/gdb/mipsnbsd-tdep.c +++ b/gdb/mipsnbsd-tdep.c @@ -103,13 +103,13 @@ mipsnbsd_supply_gregset (const struct regset *regset, /* NetBSD/mips register sets. */ -static struct regset mipsnbsd_gregset = +static const struct regset mipsnbsd_gregset = { NULL, mipsnbsd_supply_gregset }; -static struct regset mipsnbsd_fpregset = +static const struct regset mipsnbsd_fpregset = { NULL, mipsnbsd_supply_fpregset diff --git a/gdb/nios2-linux-tdep.c b/gdb/nios2-linux-tdep.c index 792a4daca40..d9a51a85494 100644 --- a/gdb/nios2-linux-tdep.c +++ b/gdb/nios2-linux-tdep.c @@ -73,7 +73,7 @@ nios2_supply_gregset (const struct regset *regset, } } -static struct regset nios2_core_regset = +static const struct regset nios2_core_regset = { NULL, nios2_supply_gregset, diff --git a/gdb/ppcfbsd-tdep.c b/gdb/ppcfbsd-tdep.c index a03c6a97954..77292f375e4 100644 --- a/gdb/ppcfbsd-tdep.c +++ b/gdb/ppcfbsd-tdep.c @@ -115,7 +115,7 @@ static const struct regset ppc64_fbsd_gregset = { /* 32-/64-bit floating-point register set. */ -static struct regset ppc32_fbsd_fpregset = { +static const struct regset ppc32_fbsd_fpregset = { &ppc32_fbsd_reg_offsets, ppc_supply_fpregset, ppc_collect_fpregset diff --git a/gdb/ppcnbsd-tdep.c b/gdb/ppcnbsd-tdep.c index 58e6599532c..6fe84779cab 100644 --- a/gdb/ppcnbsd-tdep.c +++ b/gdb/ppcnbsd-tdep.c @@ -42,13 +42,13 @@ struct ppc_reg_offsets ppcnbsd_reg_offsets; /* NetBSD/powerpc register sets. */ -struct regset ppcnbsd_gregset = +const struct regset ppcnbsd_gregset = { &ppcnbsd_reg_offsets, ppc_supply_gregset }; -struct regset ppcnbsd_fpregset = +const struct regset ppcnbsd_fpregset = { &ppcnbsd_reg_offsets, ppc_supply_fpregset diff --git a/gdb/ppcnbsd-tdep.h b/gdb/ppcnbsd-tdep.h index 52f64786b5b..747b452e7a8 100644 --- a/gdb/ppcnbsd-tdep.h +++ b/gdb/ppcnbsd-tdep.h @@ -28,7 +28,7 @@ struct regset; extern struct ppc_reg_offsets ppcnbsd_reg_offsets; /* Register sets for NetBSD/powerpc. */ -extern struct regset ppcnbsd_gregset; -extern struct regset ppcnbsd_fpregset; +extern const struct regset ppcnbsd_gregset; +extern const struct regset ppcnbsd_fpregset; #endif /* ppcnbsd-tdep.h */ diff --git a/gdb/ppcobsd-tdep.c b/gdb/ppcobsd-tdep.c index ac60bcc8e81..2cdf68713b8 100644 --- a/gdb/ppcobsd-tdep.c +++ b/gdb/ppcobsd-tdep.c @@ -71,13 +71,13 @@ ppcobsd_collect_gregset (const struct regset *regset, /* OpenBSD/powerpc register set. */ -struct regset ppcobsd_gregset = +const struct regset ppcobsd_gregset = { &ppcobsd_reg_offsets, ppcobsd_supply_gregset }; -struct regset ppcobsd_fpregset = +const struct regset ppcobsd_fpregset = { &ppcobsd_fpreg_offsets, ppc_supply_fpregset diff --git a/gdb/ppcobsd-tdep.h b/gdb/ppcobsd-tdep.h index ea6bd3d1e5e..8c9ac3a0926 100644 --- a/gdb/ppcobsd-tdep.h +++ b/gdb/ppcobsd-tdep.h @@ -30,8 +30,8 @@ extern struct ppc_reg_offsets ppcobsd_reg_offsets; extern struct ppc_reg_offsets ppcobsd_fpreg_offsets; /* Register sets for OpenBSD/powerpc. */ -extern struct regset ppcobsd_gregset; -extern struct regset ppcobsd_fpregset; +extern const struct regset ppcobsd_gregset; +extern const struct regset ppcobsd_fpregset; /* Supply register REGNUM in the general-purpose register set REGSET diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c index 3ab88830e87..83e881e6bd6 100644 --- a/gdb/rs6000-aix-tdep.c +++ b/gdb/rs6000-aix-tdep.c @@ -135,14 +135,14 @@ rs6000_aix_collect_regset (const struct regset *regset, /* AIX register set. */ -static struct regset rs6000_aix32_regset = +static const struct regset rs6000_aix32_regset = { &rs6000_aix32_reg_offsets, rs6000_aix_supply_regset, rs6000_aix_collect_regset, }; -static struct regset rs6000_aix64_regset = +static const struct regset rs6000_aix64_regset = { &rs6000_aix64_reg_offsets, rs6000_aix_supply_regset, diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 85f8067acd5..0c1fbed2dba 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -2195,14 +2195,14 @@ sh_corefile_collect_regset (const struct regset *regset, /* The following two regsets have the same contents, so it is tempting to unify them, but they are distiguished by their address, so don't. */ -struct regset sh_corefile_gregset = +const struct regset sh_corefile_gregset = { NULL, sh_corefile_supply_regset, sh_corefile_collect_regset }; -static struct regset sh_corefile_fpregset = +static const struct regset sh_corefile_fpregset = { NULL, sh_corefile_supply_regset, diff --git a/gdb/sh-tdep.h b/gdb/sh-tdep.h index 3e3c746f2f9..5d64c744f26 100644 --- a/gdb/sh-tdep.h +++ b/gdb/sh-tdep.h @@ -101,7 +101,7 @@ struct gdbarch_tdep struct sh_corefile_regmap *core_fpregmap; }; -extern struct regset sh_corefile_gregset; +extern const struct regset sh_corefile_gregset; void sh_corefile_supply_regset (const struct regset *regset, struct regcache *regcache, diff --git a/gdb/tilegx-linux-tdep.c b/gdb/tilegx-linux-tdep.c index 98b071a8356..98b03dbcd84 100644 --- a/gdb/tilegx-linux-tdep.c +++ b/gdb/tilegx-linux-tdep.c @@ -97,7 +97,7 @@ tilegx_linux_supply_regset (const struct regset *regset, } /* TILE-Gx Linux kernel register set. */ -static struct regset tilegx_linux_regset = +static const struct regset tilegx_linux_regset = { NULL, tilegx_linux_supply_regset diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c index efa702c99d9..4780c9059c0 100644 --- a/gdb/vax-tdep.c +++ b/gdb/vax-tdep.c @@ -85,7 +85,7 @@ vax_supply_gregset (const struct regset *regset, struct regcache *regcache, /* VAX register set. */ -static struct regset vax_gregset = +static const struct regset vax_gregset = { NULL, vax_supply_gregset