diff options
author | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2013-11-22 18:43:00 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2014-05-21 17:49:17 +0200 |
commit | 245342432eaccc1cb2375af4ce0bd8a636c411aa (patch) | |
tree | 4ce3eb76b75e9b318d95c5d15c976337fb595f49 /gdb | |
parent | b7195f2786ccb2b9aaa5a0f0232b1f6d43060aed (diff) | |
download | gdb-245342432eaccc1cb2375af4ce0bd8a636c411aa.zip gdb-245342432eaccc1cb2375af4ce0bd8a636c411aa.tar.gz gdb-245342432eaccc1cb2375af4ce0bd8a636c411aa.tar.bz2 |
MN10300: Replace regset_alloc() invocations by static regset structures.
On this architecture the change may fix a small memory leak.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/mn10300-linux-tdep.c | 21 |
2 files changed, 19 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 989aa3f..dbff877 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com> + * mn10300-linux-tdep.c (am33_gregset, am33_fpregset): New static + regset structures. + (am33_regset_from_core_section): Remove dynamic regset + allocations. + +2014-05-21 Andreas Arnez <arnez@linux.vnet.ibm.com> + * mips-linux-tdep.c (mips_linux_gregset, mips64_linux_gregset) (mips_linux_fpregset, mips64_linux_fpregset): New static regset structures. diff --git a/gdb/mn10300-linux-tdep.c b/gdb/mn10300-linux-tdep.c index 6acae56..4377463 100644 --- a/gdb/mn10300-linux-tdep.c +++ b/gdb/mn10300-linux-tdep.c @@ -451,6 +451,16 @@ am33_collect_fpregset_method (const struct regset *regset, return; } +static const struct regset am33_gregset = + { + NULL, am33_supply_gregset_method, am33_collect_gregset_method + }; + +static const struct regset am33_fpregset = + { + NULL, am33_supply_fpregset_method, am33_collect_fpregset_method + }; + /* Create a struct regset from a corefile register section. */ static const struct regset * @@ -458,17 +468,10 @@ am33_regset_from_core_section (struct gdbarch *gdbarch, const char *sect_name, size_t sect_size) { - /* We will call regset_alloc, and pass the names of the supply and - collect methods. */ - if (sect_size == sizeof (mn10300_elf_fpregset_t)) - return regset_alloc (gdbarch, - am33_supply_fpregset_method, - am33_collect_fpregset_method); + return &am33_fpregset; else - return regset_alloc (gdbarch, - am33_supply_gregset_method, - am33_collect_gregset_method); + return &am33_gregset; } static void |