gdb/gdb-bz589467-pieces2of4.patch

54 lines
2.0 KiB
Diff

http://sourceware.org/ml/gdb-cvs/2010-05/msg00188.html
http://sourceware.org/ml/gdb-cvs/2010-05/msg00189.html
### src/gdb/ChangeLog 2010/05/21 20:45:18 1.11830
### src/gdb/ChangeLog 2010/05/21 20:56:48 1.11831
## -1,3 +1,8 @@
+2010-05-21 Tom Tromey <tromey@redhat.com>
+
+ * eval.c (evaluate_subexp_standard) <BINOP_SUBSCRIPT>: Call
+ evaluate_subexp, not evaluate_subexp_with_coercion.
+
### src/gdb/testsuite/ChangeLog 2010/05/21 20:39:50 1.2273
### src/gdb/testsuite/ChangeLog 2010/05/21 20:56:49 1.2274
## -1,5 +1,10 @@
2010-05-21 Tom Tromey <tromey@redhat.com>
+ * gdb.dwarf2/pieces.exp (pieces_test_f2): New proc.
+ Call it.
+
--- src/gdb/eval.c 2010/05/14 18:35:11 1.134
+++ src/gdb/eval.c 2010/05/21 20:56:49 1.135
@@ -2059,8 +2059,8 @@
error (_("':' operator used in invalid context"));
case BINOP_SUBSCRIPT:
- arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
+ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
+ arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
goto nosideret;
if (binop_user_defined_p (op, arg1, arg2))
--- src/gdb/testsuite/gdb.dwarf2/pieces.exp 2010/05/21 20:39:50 1.1
+++ src/gdb/testsuite/gdb.dwarf2/pieces.exp 2010/05/21 21:00:27 1.2
@@ -54,4 +54,18 @@
gdb_test "print a.j" " = 14" "print a.j in pieces:f1"
}
+# Function f2 tests for a bug when indexing into an array created
+# using DW_OP_piece.
+proc pieces_test_f2 {} {
+ global csrcfile
+ set line [gdb_get_line_number "f2 breakpoint" $csrcfile]
+ gdb_test "break pieces.c:$line" "Breakpoint 3.*" \
+ "set f2 breakpoint for pieces"
+ gdb_continue_to_breakpoint "continue to f2 breakpoint for pieces"
+ gdb_test "print a" " = .4, 14." "print a in pieces:f2"
+ gdb_test "print a\[0\]" " = 4" "print a\[0\] in pieces:f2"
+ gdb_test "print a\[1\]" " = 14" "print a\[1\] in pieces:f2"
+}
+
pieces_test_f1
+pieces_test_f2