diff options
author | Andreas Schwab <schwab@suse.de> | 2008-09-24 12:59:48 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@suse.de> | 2008-09-24 12:59:48 +0000 |
commit | 779448dbe8fd332eeeb530bdf6381e18662efc1c (patch) | |
tree | 4866e7d4c73856fc2aeed55d9485707f78b022e9 | |
parent | 856a932e196fc35162797dea39536e6565091c6e (diff) | |
download | gdb-779448dbe8fd332eeeb530bdf6381e18662efc1c.tar.gz |
* frame.c (get_frame_register_bytes): Avoid excessive function calls.
-rw-r--r-- | gdb/ChangeLog | 2 | ||||
-rw-r--r-- | gdb/frame.c | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 155c48319a9..fbc6f108a7b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,7 +1,7 @@ 2008-09-24 Andreas Schwab <schwab@suse.de> * frame.c (get_frame_register_bytes): Take pseudo registers into - account. + account. Avoid excessive function calls. 2008-09-23 Doug Evans <dje@google.com> diff --git a/gdb/frame.c b/gdb/frame.c index 0fd21e4eabe..a8774943076 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) |