This is the mail archive of the gdb-patches@sources.redhat.com 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]

[RFA]: Report DW_OP_piece not supported and print dwarf2 unknownopcode


Hi!

When using gcc 3.4 (mainline) with gdb 6_0/mainline, I falled into the DW_OP_piece well known
problem.  Since this is not yet fixed (it seems that it need quite a number of changes to
the dwarf_expr_() API for that), I suggest to have an error message that points out the
limitation.  Also, I suggest to print out the dwarf2 opcode in hex when we don't handle it.

Ok to commit?

Stephane

2003-07-23 Stephane Carrez <stcarrez@nerim.fr>

	* dwarf2expr.c (execute_stack_op): DW_OP_piece is not yet supported,
	raise an appropriate error for it; report the unknown opcode.

Index: dwarf2expr.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2expr.c,v
retrieving revision 1.8.8.1
diff -u -p -r1.8.8.1 dwarf2expr.c
--- dwarf2expr.c	22 Jul 2003 15:44:10 -0000	1.8.8.1
+++ dwarf2expr.c	23 Jul 2003 20:41:20 -0000
@@ -671,8 +671,16 @@ execute_stack_op (struct dwarf_expr_cont
 	case DW_OP_nop:
 	  goto no_push;
 
+        case DW_OP_piece:
+          {
+            ULONGEST piece_size;
+
+            op_ptr = read_uleb128 (op_ptr, op_end, &piece_size);
+            error ("DW_OP_piece of %d bytes is not supported yet", piece_size);
+          }
+
 	default:
-	  error ("Unhandled dwarf expression opcode");
+	  error ("Unhandled dwarf expression opcode '%x'", op);
 	}
 
       /* Most things push a result value.  */

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