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 | 1a7cf6a792d6c14e38a0f0094275d27b9cd82351 (patch) | |
tree | a8cca14bb312e22de3b11695ae78743072bf08eb /gdb/regcache.c | |
parent | e5bd68107ac3a3a792ffe51e00e5989f74a72b14 (diff) | |
download | gdb-1a7cf6a792d6c14e38a0f0094275d27b9cd82351.tar.gz |
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 b66e06d51be..2b8c33f5b46 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 = ","; } } |