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

@ -1677,24 +1677,24 @@ registers_info (char *addr_exp, int fpregs)
/* A register group? */
{
struct reggroup *const *group;
for (group = reggroups (current_gdbarch);
(*group) != NULL;
group++)
struct reggroup *group;
for (group = reggroup_next (current_gdbarch, NULL);
group != NULL;
group = reggroup_next (current_gdbarch, group))
{
/* Don't bother with a length check. Should the user
enter a short register group name, go with the first
group that matches. */
if (strncmp (start, reggroup_name ((*group)), end - start) == 0)
if (strncmp (start, reggroup_name (group), end - start) == 0)
break;
}
if ((*group) != NULL)
if (group != NULL)
{
int regnum;
for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
{
if (gdbarch_register_reggroup_p (current_gdbarch, regnum,
(*group)))
group))
gdbarch_print_registers_info (current_gdbarch,
gdb_stdout, deprecated_selected_frame,
regnum, fpregs);