diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-08-04 20:34:10 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-08-04 20:34:10 +0000 |
commit | 6c7d17ba3a5d982ae1c2b972417aedce0f404cf5 (patch) | |
tree | 2608b73719576cc5a6c1aa63742969c4ded95f3c /gdb/regcache.c | |
parent | 95cd630eaeeb7c59acb5129df8a18b808dfabe23 (diff) | |
download | gdb-6c7d17ba3a5d982ae1c2b972417aedce0f404cf5.zip gdb-6c7d17ba3a5d982ae1c2b972417aedce0f404cf5.tar.gz gdb-6c7d17ba3a5d982ae1c2b972417aedce0f404cf5.tar.bz2 |
2003-08-04 Andrew Cagney <cagney@redhat.com>
* reggroups.c (struct reggroup_el): Define.
(struct reggroups): Delete field "nr_group". Replace array
"group" with a "first" to "last" linked list.
(reggroups_init): Update. Allocate using gdbarch's obstack.
(reggroups_free): Delete function.
(add_group): Update. Add "el" parameter.
(reggroup_add): Pass gdbarch obstack allocated space to add_group.
(default_groups): Update.
(reggroup_next): Replace reggroups.
(reggroups_dump): Update.
(_initialize_reggroup): Pass XMALLOC allocated space to add_group.
* regcache.c (regcache_dump): Use reggroup_next instead of reggroups.
* infcmd.c (registers_info): Use reggroup_next instead of reggroups.
Diffstat (limited to 'gdb/regcache.c')
-rw-r--r-- | gdb/regcache.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gdb/regcache.c b/gdb/regcache.c index b66e06d..2b8c33f 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -1426,7 +1426,6 @@ regcache_dump (struct regcache *regcache, struct ui_file *file, { struct cleanup *cleanups = make_cleanup (null_cleanup, NULL); struct gdbarch *gdbarch = regcache->descr->gdbarch; - struct reggroup *const *groups = reggroups (gdbarch); int regnum; int footnote_nr = 0; int footnote_register_size = 0; @@ -1597,13 +1596,15 @@ regcache_dump (struct regcache *regcache, struct ui_file *file, fprintf_unfiltered (file, "Groups"); else { - int i; const char *sep = ""; - for (i = 0; groups[i] != NULL; i++) + struct reggroup *group; + for (group = reggroup_next (gdbarch, NULL); + group != NULL; + group = reggroup_next (gdbarch, group)) { - if (gdbarch_register_reggroup_p (gdbarch, regnum, groups[i])) + if (gdbarch_register_reggroup_p (gdbarch, regnum, group)) { - fprintf_unfiltered (file, "%s%s", sep, reggroup_name (groups[i])); + fprintf_unfiltered (file, "%s%s", sep, reggroup_name (group)); sep = ","; } } |