diff options
author | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2014-04-28 07:56:51 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2014-09-30 09:14:33 +0200 |
commit | 4108500a2ac989e770d91f076be4c9434e25afa8 (patch) | |
tree | 21f642f3e2512dcf157012019458837f78f343f5 /gdb/aarch64-linux-tdep.c | |
parent | a904c024b0760911288e865c62d91578fd887e3b (diff) | |
download | gdb-4108500a2ac989e770d91f076be4c9434e25afa8.zip gdb-4108500a2ac989e770d91f076be4c9434e25afa8.tar.gz gdb-4108500a2ac989e770d91f076be4c9434e25afa8.tar.bz2 |
AARCH64: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections'
Don't define the 'regset_from_core_section' method, but the iterator
method instead. This slightly reduces the code and enables non-native
use of the 'generate-core-file' command.
Also, when all instances of 'regset_from_core_section' are replaced,
it can be dropped from the gdbarch interface.
gdb/ChangeLog:
* aarch64-linux-tdep.c (aarch64_linux_regset_from_core_section):
Remove.
(aarch64_linux_iterate_over_regset_sections): New.
(aarch64_linux_init_abi): Adjust gdbarch initialization.
Diffstat (limited to 'gdb/aarch64-linux-tdep.c')
-rw-r--r-- | gdb/aarch64-linux-tdep.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c index 6377977..804e767 100644 --- a/gdb/aarch64-linux-tdep.c +++ b/gdb/aarch64-linux-tdep.c @@ -215,20 +215,16 @@ const struct regset aarch64_linux_fpregset = /* Implement the "regset_from_core_section" gdbarch method. */ -static const struct regset * -aarch64_linux_regset_from_core_section (struct gdbarch *gdbarch, - const char *sect_name, - size_t sect_size) +static void +aarch64_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, + iterate_over_regset_sections_cb *cb, + void *cb_data, + const struct regcache *regcache) { - if (strcmp (sect_name, ".reg") == 0 - && sect_size == AARCH64_LINUX_SIZEOF_GREGSET) - return &aarch64_linux_gregset; - - if (strcmp (sect_name, ".reg2") == 0 - && sect_size == AARCH64_LINUX_SIZEOF_FPREGSET) - return &aarch64_linux_fpregset; - - return NULL; + cb (".reg", AARCH64_LINUX_SIZEOF_GREGSET, &aarch64_linux_gregset, + NULL, cb_data); + cb (".reg2", AARCH64_LINUX_SIZEOF_FPREGSET, &aarch64_linux_fpregset, + NULL, cb_data); } /* Implementation of `gdbarch_stap_is_single_operand', as defined in @@ -376,8 +372,8 @@ aarch64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) /* Enable longjmp. */ tdep->jb_pc = 11; - set_gdbarch_regset_from_core_section (gdbarch, - aarch64_linux_regset_from_core_section); + set_gdbarch_iterate_over_regset_sections + (gdbarch, aarch64_linux_iterate_over_regset_sections); /* SystemTap related. */ set_gdbarch_stap_integer_prefixes (gdbarch, stap_integer_prefixes); |