public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] readelf/objdump DW_OP_GNU_{{const,regval,deref}_type,convert,reinterpret} support
@ 2011-05-03  8:47 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2011-05-03  8:47 UTC (permalink / raw)
  To: binutils

Hi!

This patch adds support for typed DWARF stack ops that I've committed
recently to GCC trunk.
Tested on the http://gcc.gnu.org/ml/gcc-patches/2011-03/txt00136.txt
testcase built by current trunk GCC, committed to binutils HEAD.

2011-05-03  Jakub Jelinek  <jakub@redhat.com>

	* dwarf.c (decode_location_expression): 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.

--- binutils/dwarf.c.jj	2011-04-05 11:04:23.000000000 +0200
+++ binutils/dwarf.c	2011-04-05 11:52:27.000000000 +0200
@@ -1034,17 +1034,6 @@ decode_location_expression (unsigned cha
 	  display_block (data, uvalue);
 	  data += uvalue;
 	  break;
-	case DW_OP_GNU_entry_value:
-	  uvalue = read_leb128 (data, &bytes_read, 0);
-	  data += bytes_read;
-	  printf ("DW_OP_GNU_entry_value: (");
-	  if (decode_location_expression (data, pointer_size, offset_size,
-					  dwarf_version, uvalue,
-					  cu_offset, section))
-	    need_frame_base = 1;
-	  putchar (')');
-	  data += uvalue;
-	  break;
 
 	  /* GNU extensions.  */
 	case DW_OP_GNU_push_tls_address:
@@ -1093,6 +1082,53 @@ decode_location_expression (unsigned cha
 	      data += offset_size + bytes_read;
 	    }
 	  break;
+	case DW_OP_GNU_entry_value:
+	  uvalue = read_leb128 (data, &bytes_read, 0);
+	  data += bytes_read;
+	  printf ("DW_OP_GNU_entry_value: (");
+	  if (decode_location_expression (data, pointer_size, offset_size,
+					  dwarf_version, uvalue,
+					  cu_offset, section))
+	    need_frame_base = 1;
+	  putchar (')');
+	  data += uvalue;
+	  break;
+	case DW_OP_GNU_const_type:
+	  uvalue = read_leb128 (data, &bytes_read, 0);
+	  data += bytes_read;
+	  printf ("DW_OP_GNU_const_type: <0x%s> ",
+		  dwarf_vmatoa ("x", cu_offset + uvalue));
+	  uvalue = byte_get (data++, 1);
+	  display_block (data, uvalue);
+	  data += uvalue;
+	  break;
+	case DW_OP_GNU_regval_type:
+	  uvalue = read_leb128 (data, &bytes_read, 0);
+	  data += bytes_read;
+	  printf ("DW_OP_GNU_regval_type: %s (%s)",
+		  dwarf_vmatoa ("u", uvalue), regname (uvalue, 1));
+	  uvalue = read_leb128 (data, &bytes_read, 0);
+	  data += bytes_read;
+	  printf (" <0x%s>", dwarf_vmatoa ("x", cu_offset + uvalue));
+	  break;
+	case DW_OP_GNU_deref_type:
+	  printf ("DW_OP_GNU_deref_type: %ld", (long) byte_get (data++, 1));
+	  uvalue = read_leb128 (data, &bytes_read, 0);
+	  data += bytes_read;
+	  printf (" <0x%s>", dwarf_vmatoa ("x", cu_offset + uvalue));
+	  break;
+	case DW_OP_GNU_convert:
+	  uvalue = read_leb128 (data, &bytes_read, 0);
+	  data += bytes_read;
+	  printf ("DW_OP_GNU_convert <0x%s>",
+		  dwarf_vmatoa ("x", cu_offset + uvalue));
+	  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));
+	  break;
 
 	  /* HP extensions.  */
 	case DW_OP_HP_is_value:

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-03  8:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-03  8:47 [PATCH] readelf/objdump DW_OP_GNU_{{const,regval,deref}_type,convert,reinterpret} support Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).