diff options
author | Andrew Stubbs <andrew.stubbs@st.com> | 2008-09-22 13:36:29 +0000 |
---|---|---|
committer | Andrew Stubbs <andrew.stubbs@st.com> | 2008-09-22 13:36:29 +0000 |
commit | 26fae1d6e38b9f8c6470326487fe7d2a5c1dcae7 (patch) | |
tree | a6da1563cf88c819a0c8459c86f7642acf72f395 /gdb/frame.c | |
parent | 1ad15515cd017050d1ac497ca34f8e0343d66625 (diff) | |
download | gdb-26fae1d6e38b9f8c6470326487fe7d2a5c1dcae7.zip gdb-26fae1d6e38b9f8c6470326487fe7d2a5c1dcae7.tar.gz gdb-26fae1d6e38b9f8c6470326487fe7d2a5c1dcae7.tar.bz2 |
2008-09-22 Andrew Stubbs <ams@codesourcery.com>
* frame.c (get_frame_register_bytes): Comment improvments.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r-- | gdb/frame.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/frame.c b/gdb/frame.c index 88d51f7..dd3e341 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) |