aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2008-09-24 12:59:49 +0000
committerAndreas Schwab <schwab@linux-m68k.org>2008-09-24 12:59:49 +0000
commit68e007ca21d4d375218ff1accd4678dbb31769e0 (patch)
tree9ffaa56c0a00db6401194c03ad7f355d6c7615f0 /gdb/frame.c
parent45ef8ce0c5323bee1881972b0b3250e7666df102 (diff)
downloadfsf-binutils-gdb-68e007ca21d4d375218ff1accd4678dbb31769e0.zip
fsf-binutils-gdb-68e007ca21d4d375218ff1accd4678dbb31769e0.tar.gz
fsf-binutils-gdb-68e007ca21d4d375218ff1accd4678dbb31769e0.tar.bz2
* frame.c (get_frame_register_bytes): Avoid excessive function calls.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index 0fd21e4..a877494 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -798,6 +798,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum,
struct gdbarch *gdbarch = get_frame_arch (frame);
int i;
int maxsize;
+ int numregs;
/* Skip registers wholly inside of OFFSET. */
while (offset >= register_size (gdbarch, regnum))
@@ -809,8 +810,8 @@ get_frame_register_bytes (struct frame_info *frame, int regnum,
/* 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) + gdbarch_num_pseudo_regs (gdbarch); i++)
+ numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ for (i = regnum; i < numregs; i++)
{
int thissize = register_size (gdbarch, i);
if (thissize == 0)