From 07009f70102d34785d6b88b93d46d4dc7bce5226 Mon Sep 17 00:00:00 2001 From: christos Date: Wed, 16 Apr 2014 00:34:10 +0000 Subject: [PATCH] take constant expressions out of the loop. --- external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c b/external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c index 59fa174d707e..c06b41bb6b06 100644 --- a/external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c +++ b/external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c @@ -157,19 +157,14 @@ amd64nbsd_trapframe_cache(struct frame_info *this_frame, void **this_cache) addr = sp; for (i = 0; i < ARRAY_SIZE (amd64nbsd_tf_reg_offset); i++) - { - if (amd64nbsd_tf_reg_offset[i] != -1) - trad_frame_set_reg_addr (cache, i, addr + amd64nbsd_tf_reg_offset[i]); - - /* Read %cs and %rip when we have the addresses to hand */ - if (i == AMD64_CS_REGNUM) - cs = read_memory_unsigned_integer (addr + amd64nbsd_tf_reg_offset[i], 8, - byte_order); - if (i == AMD64_RIP_REGNUM) - rip = read_memory_unsigned_integer (addr + amd64nbsd_tf_reg_offset[i], - 8, byte_order); - } + if (amd64nbsd_tf_reg_offset[i] != -1) + trad_frame_set_reg_addr (cache, i, addr + amd64nbsd_tf_reg_offset[i]); + /* Read %cs and %rip when we have the addresses to hand */ + cs = read_memory_unsigned_integer (addr + + amd64nbsd_tf_reg_offset[AMD64_CS_REGNUM], 8, byte_order); + rip = read_memory_unsigned_integer (addr + + amd64nbsd_tf_reg_offset[AMD64_RIP_REGNUM], 8, byte_order); if (cs == 0 || rip == 0) abort();