]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Add DW_OP_GNU_const_type/regval_type/deref_type/convert/reinterpret.
authorJakub Jelinek <jakub@redhat.com>
Tue, 17 May 2011 15:00:14 +0000 (17:00 +0200)
committerMark Wielaard <mjw@redhat.com>
Tue, 17 May 2011 20:07:39 +0000 (22:07 +0200)
libdw/ChangeLog
libdw/dwarf.h
src/ChangeLog
src/readelf.c

index 8febd4287ffe7cda82af67f6f10cce1345930a13..fc7d6295bae15cc974b73af647b258923cf19320 100644 (file)
@@ -1,3 +1,9 @@
+2011-05-16  Jakub Jelinek  <jakub@redhat.com>
+
+       * dwarf.h (DW_OP_GNU_const_type, DW_OP_GNU_regval_type,
+       DW_OP_GNU_deref_type, DW_OP_GNU_convert, DW_OP_GNU_reinterpret):
+       New.
+
 2011-04-26  Mark Wielaard  <mjw@redhat.com>
 
        * dwarf_child (dwarf_child): Sanity check end of section against
index c0dcbdd2987a366fc9aa6e24f4efc66b3ace57fa..e6a83670ef1b1bbf21dfe9a6eda430541214e9ec 100644 (file)
@@ -1,5 +1,5 @@
 /* This file defines standard DWARF types, structures, and macros.
-   Copyright (C) 2000-2010 Red Hat, Inc.
+   Copyright (C) 2000-2011 Red Hat, Inc.
    This file is part of Red Hat elfutils.
 
    Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -487,6 +487,11 @@ enum
     DW_OP_GNU_encoded_addr = 0xf1,
     DW_OP_GNU_implicit_pointer = 0xf2,
     DW_OP_GNU_entry_value = 0xf3,
+    DW_OP_GNU_const_type = 0xf4,
+    DW_OP_GNU_regval_type = 0xf5,
+    DW_OP_GNU_deref_type = 0xf6,
+    DW_OP_GNU_convert = 0xf7,
+    DW_OP_GNU_reinterpret = 0xf9,
 
     DW_OP_lo_user = 0xe0,      /* Implementation-defined range start.  */
     DW_OP_hi_user = 0xff       /* Implementation-defined range end.  */
index 4de8162b28efc21530825a86eec610b19b6c347d..5f164e0d927368d9fda47481803ecfc3a0433e73 100644 (file)
@@ -1,3 +1,9 @@
+2011-05-16  Jakub Jelinek  <jakub@redhat.com>
+
+       * readelf.c (print_ops): Handle DW_OP_GNU_const_type,
+       DW_OP_GNU_regval_type, DW_OP_GNU_deref_type, DW_OP_GNU_convert
+       and DW_OP_GNU_reinterpret.
+
 2011-05-17  Mark Wielaard  <mjw@redhat.com>
 
        * readelf.c (dwarf_tag_string): Fixup DW_TAG_GNU_call_site and
index 72be50269602c5d220fd00afbf550acd8b842710..1d9249189135cb1583f1b708eb71924df0945154 100644 (file)
@@ -4064,6 +4064,11 @@ print_ops (Dwfl_Module *dwflmod, Dwarf *dbg, int indent, int indentrest,
       [DW_OP_stack_value] = "stack_value",
       [DW_OP_GNU_implicit_pointer] = "GNU_implicit_pointer",
       [DW_OP_GNU_entry_value] = "GNU_entry_value",
+      [DW_OP_GNU_const_type] = "GNU_const_type",
+      [DW_OP_GNU_regval_type] = "GNU_regval_type",
+      [DW_OP_GNU_deref_type] = "GNU_deref_type",
+      [DW_OP_GNU_convert] = "GNU_convert",
+      [DW_OP_GNU_reinterpret] = "GNU_reinterpret",
     };
 
   if (len == 0)
@@ -4343,6 +4348,55 @@ print_ops (Dwfl_Module *dwflmod, Dwarf *dbg, int indent, int indentrest,
          offset += 1 + (data - start);
          break;
 
+       case DW_OP_GNU_const_type:
+         /* DIE offset, size plus block.  */
+         start = data;
+         NEED (2);
+         get_uleb128 (uleb, data); /* XXX check overrun */
+         uint8_t usize = *(uint8_t *) data++;
+         NEED (usize);
+         printf ("%*s[%4" PRIuMAX "] %s [%6" PRIxMAX "] ",
+                 indent, "", (uintmax_t) offset, known[op], uleb);
+         print_block (usize, data);
+         data += usize;
+         CONSUME (data - start);
+         offset += 1 + (data - start);
+         break;
+
+       case DW_OP_GNU_regval_type:
+         start = data;
+         NEED (2);
+         get_uleb128 (uleb, data); /* XXX check overrun */
+         get_uleb128 (uleb2, data); /* XXX check overrun */
+         printf ("%*s[%4" PRIuMAX "] %s %" PRIu64 " %#" PRIx64 "\n",
+                 indent, "", (uintmax_t) offset, known[op], uleb, uleb2);
+         CONSUME (data - start);
+         offset += 1 + (data - start);
+         break;
+
+       case DW_OP_GNU_deref_type:
+         start = data;
+         NEED (2);
+         usize = *(uint8_t *) data++;
+         get_uleb128 (uleb, data); /* XXX check overrun */
+         printf ("%*s[%4" PRIuMAX "] %s %" PRIu8 " [%6" PRIxMAX "]\n",
+                 indent, "", (uintmax_t) offset,
+                 known[op], usize, uleb);
+         CONSUME (data - start);
+         offset += 1 + (data - start);
+         break;
+
+       case DW_OP_GNU_convert:
+       case DW_OP_GNU_reinterpret:
+         start = data;
+         NEED (1);
+         get_uleb128 (uleb, data); /* XXX check overrun */
+         printf ("%*s[%4" PRIuMAX "] %s [%6" PRIxMAX "]\n",
+                 indent, "", (uintmax_t) offset, known[op], uleb);
+         CONSUME (data - start);
+         offset += 1 + (data - start);
+         break;
+
        default:
          /* No Operand.  */
          if (op < sizeof known / sizeof known[0] && known[op] != NULL)