dwarf2loc.c: minor cleanup. don't print integer with paddress.
authorPedro Alves <palves@redhat.com>
Thu, 5 Sep 2013 14:49:13 +0000 (14:49 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 5 Sep 2013 14:49:13 +0000 (14:49 +0000)
A couple years ago, dwarf_expr_fetch used to return a CORE_ADDR.  It
was made to return a ULONGEST since, and the 'dwarf_regnum' local
adjusted accordingly, but, we kept printing it with paddress.
gdbarch_dwarf2_reg_to_regnum takes the register number as 'int', so
there's really no point in using ULONGEST/pulongest either.

gdb/
2013-09-05  Pedro Alves  <palves@redhat.com>

* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): 'dwarf_regnum'
local is now int instead of ULONGEST.  Print it with %d
instead of paddress.

gdb/ChangeLog
gdb/dwarf2loc.c

index 8788b3bec582672d119a0c71ff636ea8bb0aafd8..92452a90ac2921bfdd3cde871627c48a1d90893c 100644 (file)
@@ -1,3 +1,9 @@
+2013-09-05  Pedro Alves  <palves@redhat.com>
+
+       * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): 'dwarf_regnum'
+       local is now int instead of ULONGEST.  Print it with %d
+       instead of paddress.
+
 2013-09-05  Tristan Gingold  <gingold@adacore.com>
 
        * MAINTAINERS: Remove avr maintainership.
index a1a384a201b5bd36dc8ea6dac3ed7c8002ecd425..55d43f1d0c0f9e2e2ce2bb4500b6965d08a288b0 100644 (file)
@@ -2283,7 +2283,8 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
        case DWARF_VALUE_REGISTER:
          {
            struct gdbarch *arch = get_frame_arch (frame);
-           ULONGEST dwarf_regnum = value_as_long (dwarf_expr_fetch (ctx, 0));
+           int dwarf_regnum
+             = longest_to_int (value_as_long (dwarf_expr_fetch (ctx, 0)));
            int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, dwarf_regnum);
 
            if (byte_offset != 0)
@@ -2292,8 +2293,8 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
            if (gdb_regnum != -1)
              retval = value_from_register (type, gdb_regnum, frame);
            else
-             error (_("Unable to access DWARF register number %s"),
-                    paddress (arch, dwarf_regnum));
+             error (_("Unable to access DWARF register number %d"),
+                    dwarf_regnum);
          }
          break;