2003-08-05 Andrew Cagney <cagney@redhat.com>

* reggroups.c (reggroup_next): Check for the final entry.
This commit is contained in:
Andrew Cagney 2003-08-05 18:08:59 +00:00
parent 50d6c87817
commit 9dd5f34f8d
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2003-08-05 Andrew Cagney <cagney@redhat.com>
* reggroups.c (reggroup_next): Check for the final entry.
2003-08-04 Andrew Cagney <cagney@redhat.com> 2003-08-04 Andrew Cagney <cagney@redhat.com>
* monitor.h (monitor_dump_reg_block): Remove ATTR_FORMAT. * monitor.h (monitor_dump_reg_block): Remove ATTR_FORMAT.

View File

@ -132,13 +132,18 @@ reggroup_next (struct gdbarch *gdbarch, struct reggroup *last)
if (groups->first == NULL) if (groups->first == NULL)
groups = &default_groups; groups = &default_groups;
/* Retun the first/next reggroup. */ /* Return the first/next reggroup. */
if (last == NULL) if (last == NULL)
return groups->first->group; return groups->first->group;
for (el = groups->first; el != NULL; el = el->next) for (el = groups->first; el != NULL; el = el->next)
{ {
if (el->group == last) if (el->group == last)
return el->next->group; {
if (el->next != NULL)
return el->next->group;
else
return NULL;
}
} }
return NULL; return NULL;
} }