This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

FYI: DW_OP_GNU_convert<0>


I am checking this in on the trunk.

Jakub recently made a small extension to DW_OP_GNU_convert (and
DW_OP_GNU_reinterpret) to treat "0" specially as a type argument.
This now means to cast the value back to the "implicit" type.

See: http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00751.html

This patch implements the GDB side of this.

Built and regtested by the buildbot.

Tom

2011-06-22  Tom Tromey  <tromey@redhat.com>

	* dwarf2expr.c (execute_stack_op) <DW_OP_GNU_convert>: Treat type
	argument of 0 specially.

Index: dwarf2expr.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2expr.c,v
retrieving revision 1.65
diff -u -r1.65 dwarf2expr.c
--- dwarf2expr.c	3 Jun 2011 23:47:46 -0000	1.65
+++ dwarf2expr.c	22 Jun 2011 13:37:32 -0000
@@ -1229,7 +1229,10 @@
 
 	    op_ptr = read_uleb128 (op_ptr, op_end, &type_die);
 
-	    type = dwarf_get_base_type (ctx, type_die, 0);
+	    if (type_die == 0)
+	      type = address_type;
+	    else
+	      type = dwarf_get_base_type (ctx, type_die, 0);
 
 	    result_val = dwarf_expr_fetch (ctx, 0);
 	    dwarf_expr_pop (ctx);


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