From: Andrew Cagney Date: Tue, 5 Aug 2003 18:08:59 +0000 (+0000) Subject: 2003-08-05 Andrew Cagney X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9dd5f34f8d4ac79c8e55bb1e5690053cd69e5f51;p=binutils-gdb.git 2003-08-05 Andrew Cagney * reggroups.c (reggroup_next): Check for the final entry. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 83ae7c429cd..cee2edf3bc2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2003-08-05 Andrew Cagney + + * reggroups.c (reggroup_next): Check for the final entry. + 2003-08-04 Andrew Cagney * monitor.h (monitor_dump_reg_block): Remove ATTR_FORMAT. diff --git a/gdb/reggroups.c b/gdb/reggroups.c index 791ec0abd52..70009577818 100644 --- a/gdb/reggroups.c +++ b/gdb/reggroups.c @@ -132,13 +132,18 @@ reggroup_next (struct gdbarch *gdbarch, struct reggroup *last) if (groups->first == NULL) groups = &default_groups; - /* Retun the first/next reggroup. */ + /* Return the first/next reggroup. */ if (last == NULL) return groups->first->group; for (el = groups->first; el != NULL; el = el->next) { if (el->group == last) - return el->next->group; + { + if (el->next != NULL) + return el->next->group; + else + return NULL; + } } return NULL; }