Simplify dwarf2-frame.c:read_addr_from_reg.
authorPedro Alves <palves@redhat.com>
Mon, 18 Nov 2013 12:05:11 +0000 (12:05 +0000)
committerPedro Alves <palves@redhat.com>
Mon, 18 Nov 2013 12:05:11 +0000 (12:05 +0000)
Since 'struct dwarf_expr_context_funcs::read_addr_from_reg' is now
only used for addresses, we can make it use unpack_pointer.  And since
we now have 'struct dwarf_expr_context_funcs'::get_reg_value, there's
no need for speculation about using values here.

Tested on x86_64 Fedora 17.

gdb/
2013-11-18  Pedro Alves  <palves@redhat.com>

* dwarf2-frame.c (read_addr_from_reg): Remove stale comment and
use unpack_pointer.

gdb/ChangeLog
gdb/dwarf2-frame.c

index 53de4fb67ec17e59204dc5e710cbad77f024d0d4..7fc09e0cb671b37277269ffae2326e501ac0e82e 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-18  Pedro Alves  <palves@redhat.com>
+
+       * dwarf2-frame.c (read_addr_from_reg): Remove stale comment and
+       use unpack_pointer.
+
 2013-11-18  Joel Brobecker  <brobecker@adacore.com>
 
        * mi/mi-main.c (mi_cmd_list_features): Add "language-options"
index b53c0151a567cc475880ead450b6f2c2f9bf85e6..cd4f47cfa59e42220d0cc9054b251cfbb917bc11 100644 (file)
@@ -298,12 +298,7 @@ read_addr_from_reg (void *baton, int reg)
   buf = alloca (register_size (gdbarch, regnum));
   get_frame_register (this_frame, regnum, buf);
 
-  /* Convert the register to an integer.  This returns a LONGEST
-     rather than a CORE_ADDR, but unpack_pointer does the same thing
-     under the covers, and this makes more sense for non-pointer
-     registers.  Maybe read_addr_from_reg and the associated interfaces
-     should deal with "struct value" instead of CORE_ADDR.  */
-  return unpack_long (register_type (gdbarch, regnum), buf);
+  return unpack_pointer (register_type (gdbarch, regnum), buf);
 }
 
 /* Implement struct dwarf_expr_context_funcs' "get_reg_value" callback.  */
This page took 0.034937 seconds and 4 git commands to generate.