This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Add DW_OP_GNU_parameter_ref support and DW_OP_GNU_{convert,reinterpret} <0> support


Hi!

I have committed today a patch to add DW_OP_GNU_parameter_ref
support to GCC and also to allow 0 as special offset for
DW_OP_GNU_{convert,reinterpret} (to mean convert/reinterpret to untyped).

This patch is the corresponding binutils change, committed to binutils
trunk.

2011-06-22  Jakub Jelinek  <jakub@redhat.com>

	* dwarf2.h (enum dwarf_location_atom): Add DW_OP_GNU_parameter_ref.

	* dwarf.c (decode_location_expression): For DW_OP_GNU_convert and
	DW_OP_GNU_reinterpret, if uvalue is 0, don't add cu_offset.
	Handle DW_OP_GNU_parameter_ref.

--- include/dwarf2.h.jj	2011-04-30 13:00:14.000000000 +0200
+++ include/dwarf2.h	2011-06-22 09:59:59.000000000 +0200
@@ -563,6 +563,8 @@ enum dwarf_location_atom
     DW_OP_GNU_deref_type = 0xf6,
     DW_OP_GNU_convert = 0xf7,
     DW_OP_GNU_reinterpret = 0xf9,
+    /* The GNU parameter ref extension.  */
+    DW_OP_GNU_parameter_ref = 0xfa,
     /* HP extensions.  */
     DW_OP_HP_unknown     = 0xe0, /* Ouch, the same as GNU_push_tls_address.  */
     DW_OP_HP_is_value    = 0xe1,
--- binutils/dwarf.c.jj	2011-06-08 12:51:59.000000000 +0200
+++ binutils/dwarf.c	2011-06-22 10:00:38.000000000 +0200
@@ -1179,13 +1179,18 @@ decode_location_expression (unsigned cha
 	  uvalue = read_leb128 (data, &bytes_read, 0);
 	  data += bytes_read;
 	  printf ("DW_OP_GNU_convert <0x%s>",
-		  dwarf_vmatoa ("x", cu_offset + uvalue));
+		  dwarf_vmatoa ("x", uvalue ? cu_offset + uvalue : 0));
 	  break;
 	case DW_OP_GNU_reinterpret:
 	  uvalue = read_leb128 (data, &bytes_read, 0);
 	  data += bytes_read;
 	  printf ("DW_OP_GNU_reinterpret <0x%s>",
-		  dwarf_vmatoa ("x", cu_offset + uvalue));
+		  dwarf_vmatoa ("x", uvalue ? cu_offset + uvalue : 0));
+	  break;
+	case DW_OP_GNU_parameter_ref:
+	  printf ("DW_OP_GNU_parameter_ref: <0x%s>",
+		  dwarf_vmatoa ("x", cu_offset + byte_get (data, 4)));
+	  data += 4;
 	  break;
 
 	  /* HP extensions.  */

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]