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.
This commit is contained in:
Andrew Cagney
2003-08-04 20:34:10 +00:00
parent 95cd630eae
commit 6c7d17ba3a
5 changed files with 93 additions and 66 deletions

View File

@@ -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 = ",";
}
}