aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndreas Arnez <arnez@linux.vnet.ibm.com>2014-03-28 17:21:39 +0000
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2014-05-21 17:49:16 +0200
commitb7611c43bf5dcdc84b4432fccef22247af11449e (patch)
treeabf3db97aa7c9223314c5e3b56d7d206b0543fcb /gdb
parenta069a2bdaba95561f9d930ff4ae4b4f60a43283e (diff)
downloadgdb-b7611c43bf5dcdc84b4432fccef22247af11449e.zip
gdb-b7611c43bf5dcdc84b4432fccef22247af11449e.tar.gz
gdb-b7611c43bf5dcdc84b4432fccef22247af11449e.tar.bz2
ARM: Replace regset_alloc() invocations by static regset structures.
After removal of the regset_alloc invocations, the appropriate tdep fields become obsolete and are thus removed.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/arm-linux-tdep.c38
-rw-r--r--gdb/arm-tdep.h3
3 files changed, 27 insertions, 23 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e6c8b56..ea32205 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,14 @@
2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
+ * arm-linux-tdep.c (arm_linux_gregset, arm_linux_fpregset)
+ (arm_linux_vfpregset): New static regset structures.
+ (arm_linux_regset_from_core_section): Remove dynamic allocation of
+ regset structures.
+ * arm-tdep.h (struct gdbarch_tdep): Remove 'gregset', 'fpregset',
+ and 'vfpregset' fields.
+
+2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
* aarch64-linux-tdep.c (aarch64_linux_gregset)
(aarch64_linux_fpregset): New static regset structures.
(aarch64_linux_regset_from_core_section): Drop dynamic allocation
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 98b912b..028a95b 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -686,6 +686,21 @@ arm_linux_collect_vfp (const struct regset *regset,
regs + (regno - ARM_D0_REGNUM) * 8);
}
+static const struct regset arm_linux_gregset =
+ {
+ NULL, arm_linux_supply_gregset, arm_linux_collect_gregset
+ };
+
+static const struct regset arm_linux_fpregset =
+ {
+ NULL, arm_linux_supply_nwfpe, arm_linux_collect_nwfpe
+ };
+
+static const struct regset arm_linux_vfpregset =
+ {
+ NULL, arm_linux_supply_vfp, arm_linux_collect_vfp
+ };
+
/* Return the appropriate register set for the core section identified
by SECT_NAME and SECT_SIZE. */
@@ -693,34 +708,17 @@ static const struct regset *
arm_linux_regset_from_core_section (struct gdbarch *gdbarch,
const char *sect_name, size_t sect_size)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
-
if (strcmp (sect_name, ".reg") == 0
&& sect_size == ARM_LINUX_SIZEOF_GREGSET)
- {
- if (tdep->gregset == NULL)
- tdep->gregset = regset_alloc (gdbarch, arm_linux_supply_gregset,
- arm_linux_collect_gregset);
- return tdep->gregset;
- }
+ return &arm_linux_gregset;
if (strcmp (sect_name, ".reg2") == 0
&& sect_size == ARM_LINUX_SIZEOF_NWFPE)
- {
- if (tdep->fpregset == NULL)
- tdep->fpregset = regset_alloc (gdbarch, arm_linux_supply_nwfpe,
- arm_linux_collect_nwfpe);
- return tdep->fpregset;
- }
+ return &arm_linux_fpregset;
if (strcmp (sect_name, ".reg-arm-vfp") == 0
&& sect_size == ARM_LINUX_SIZEOF_VFP)
- {
- if (tdep->vfpregset == NULL)
- tdep->vfpregset = regset_alloc (gdbarch, arm_linux_supply_vfp,
- arm_linux_collect_vfp);
- return tdep->vfpregset;
- }
+ return &arm_linux_vfpregset;
return NULL;
}
diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h
index f8ba122..29669d0 100644
--- a/gdb/arm-tdep.h
+++ b/gdb/arm-tdep.h
@@ -193,9 +193,6 @@ struct gdbarch_tdep
/* Convention for returning structures. */
enum struct_return struct_return;
- /* Cached core file helpers. */
- struct regset *gregset, *fpregset, *vfpregset;
-
/* ISA-specific data types. */
struct type *arm_ext_type;
struct type *neon_double_type;