aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-08-05 18:08:59 +0000
committerAndrew Cagney <cagney@redhat.com>2003-08-05 18:08:59 +0000
commit9dd5f34f8d4ac79c8e55bb1e5690053cd69e5f51 (patch)
treed0bc2480890e37cd176cdbc782f72f98009335ed
parent50d6c87817d9b450dcad0ab0ef0a1c5d3a1c149c (diff)
downloadgdb-9dd5f34f8d4ac79c8e55bb1e5690053cd69e5f51.zip
gdb-9dd5f34f8d4ac79c8e55bb1e5690053cd69e5f51.tar.gz
gdb-9dd5f34f8d4ac79c8e55bb1e5690053cd69e5f51.tar.bz2
2003-08-05 Andrew Cagney <cagney@redhat.com>
* reggroups.c (reggroup_next): Check for the final entry.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/reggroups.c9
2 files changed, 11 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 83ae7c4..cee2edf 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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>
* monitor.h (monitor_dump_reg_block): Remove ATTR_FORMAT.
diff --git a/gdb/reggroups.c b/gdb/reggroups.c
index 791ec0a..7000957 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;
}