From 6c7d17ba3a5d982ae1c2b972417aedce0f404cf5 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Mon, 4 Aug 2003 20:34:10 +0000 Subject: 2003-08-04 Andrew Cagney * 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. --- gdb/reggroups.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gdb/reggroups.h') diff --git a/gdb/reggroups.h b/gdb/reggroups.h index 0088a85..22c0a6f 100644 --- a/gdb/reggroups.h +++ b/gdb/reggroups.h @@ -51,8 +51,11 @@ extern void reggroup_add (struct gdbarch *gdbarch, struct reggroup *group); extern const char *reggroup_name (struct reggroup *reggroup); extern enum reggroup_type reggroup_type (struct reggroup *reggroup); -/* The register groups for the current architecture. */ -extern struct reggroup *const *reggroups (struct gdbarch *gdbarch); +/* Interator for the architecture's register groups. Pass in NULL, + returns the first group. Pass in a group, returns the next group, + or NULL when the last group is reached. */ +extern struct reggroup *reggroup_next (struct gdbarch *gdbarch, + struct reggroup *last); /* Is REGNUM a member of REGGROUP? */ extern int default_register_reggroup_p (struct gdbarch *gdbarch, int regnum, -- cgit v1.1