aboutsummaryrefslogtreecommitdiff
path: root/gdb/amd64-tdep.c
diff options
context:
space:
mode:
authorAndreas Arnez <arnez@linux.vnet.ibm.com>2014-05-05 12:58:11 +0000
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2014-05-21 17:49:16 +0200
commitecc37a5acc8ff504d62487149f61955343d35fcf (patch)
tree49b786b54bd3862532051e8b77f581d34e4a5809 /gdb/amd64-tdep.c
parentb7611c43bf5dcdc84b4432fccef22247af11449e (diff)
downloadgdb-ecc37a5acc8ff504d62487149f61955343d35fcf.zip
gdb-ecc37a5acc8ff504d62487149f61955343d35fcf.tar.gz
gdb-ecc37a5acc8ff504d62487149f61955343d35fcf.tar.bz2
X86: 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/amd64-tdep.c')
-rw-r--r--gdb/amd64-tdep.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 1b9797a..10bd31b 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -2886,6 +2886,16 @@ amd64_collect_xstateregset (const struct regset *regset,
amd64_collect_xsave (regcache, regnum, xstateregs, 1);
}
+static const struct regset amd64_fpregset =
+ {
+ NULL, amd64_supply_fpregset, amd64_collect_fpregset
+ };
+
+static const struct regset amd64_xstateregset =
+ {
+ NULL, amd64_supply_xstateregset, amd64_collect_xstateregset
+ };
+
/* Return the appropriate register set for the core section identified
by SECT_NAME and SECT_SIZE. */
@@ -2896,23 +2906,10 @@ amd64_regset_from_core_section (struct gdbarch *gdbarch,
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset)
- {
- if (tdep->fpregset == NULL)
- tdep->fpregset = regset_alloc (gdbarch, amd64_supply_fpregset,
- amd64_collect_fpregset);
-
- return tdep->fpregset;
- }
+ return &amd64_fpregset;
if (strcmp (sect_name, ".reg-xstate") == 0)
- {
- if (tdep->xstateregset == NULL)
- tdep->xstateregset = regset_alloc (gdbarch,
- amd64_supply_xstateregset,
- amd64_collect_xstateregset);
-
- return tdep->xstateregset;
- }
+ return &amd64_xstateregset;
return i386_regset_from_core_section (gdbarch, sect_name, sect_size);
}