From 26fae1d6e38b9f8c6470326487fe7d2a5c1dcae7 Mon Sep 17 00:00:00 2001 From: Andrew Stubbs Date: Mon, 22 Sep 2008 13:36:29 +0000 Subject: [PATCH] 2008-09-22 Andrew Stubbs * frame.c (get_frame_register_bytes): Comment improvments. --- gdb/ChangeLog | 4 ++++ gdb/frame.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 69fbac83620..c8163b72698 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2008-09-22 Andrew Stubbs + + * frame.c (get_frame_register_bytes): Comment improvments. + 2008-09-22 Pedro Alves * linux-nat.c (linux_nat_wait): Only use set_ignore_sigint in diff --git a/gdb/frame.c b/gdb/frame.c index 88d51f782d9..dd3e34118e6 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -806,13 +806,14 @@ get_frame_register_bytes (struct frame_info *frame, int regnum, regnum++; } - /* Detect bad debug info. */ + /* Ensure that we will not read beyond the end of the register file. + This can only ever happen if the debug information is bad. */ maxsize = -offset; for (i = regnum; i < gdbarch_num_regs (gdbarch); i++) { int thissize = register_size (gdbarch, i); if (thissize == 0) - break; + break; /* This register is not available on this architecture. */ maxsize += thissize; } if (len > maxsize) -- 2.30.2