Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gdb/dist/gdb take constant expressions out of ...



details:   https://anonhg.NetBSD.org/src/rev/ea25028d29d4
branches:  trunk
changeset: 328738:ea25028d29d4
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Apr 16 00:34:10 2014 +0000

description:
take constant expressions out of the loop.

diffstat:

 external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c |  19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diffs (30 lines):

diff -r 775b2355bdb5 -r ea25028d29d4 external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c
--- a/external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c       Wed Apr 16 00:32:33 2014 +0000
+++ b/external/gpl3/gdb/dist/gdb/amd64nbsd-tdep.c       Wed Apr 16 00:34:10 2014 +0000
@@ -157,19 +157,14 @@
     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]);
+    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);
-    }
-
+  /* 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();
 



Home | Main Index | Thread Index | Old Index