From 567363e5cb4b47099741cf23bee5fd5b647e4bd6 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 5 Aug 2003 18:08:59 +0000 Subject: [PATCH] 2003-08-05 Andrew Cagney * reggroups.c (reggroup_next): Check for the final entry. --- gdb/ChangeLog | 4 ++++ gdb/reggroups.c | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 83ae7c429c..cee2edf3bc 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 791ec0abd5..7000957781 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; } -- 2.11.0