* eval.c (evaluate_subexp_standard) <BINOP_SUBSCRIPT>: Call
	evaluate_subexp, not evaluate_subexp_with_coercion.
gdb/testsuite
	* gdb.dwarf2/pieces.exp (pieces_test_f2): New proc.
	Call it.
This commit is contained in:
Tom Tromey 2010-05-21 21:00:27 +00:00
parent f346a30d48
commit 74de6778b1
4 changed files with 26 additions and 2 deletions

View File

@ -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.
2010-05-21 Pierre Muller <muller@ics.u-strasbg.fr>
* dwarf2read.c (new_symbol): Handle DW_AT_variable_parameter

View File

@ -2059,8 +2059,8 @@ evaluate_subexp_standard (struct type *expect_type,
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))

View File

@ -1,3 +1,8 @@
2010-05-21 Tom Tromey <tromey@redhat.com>
* gdb.dwarf2/pieces.exp (pieces_test_f2): New proc.
Call it.
2010-05-21 Tom Tromey <tromey@redhat.com>
* gdb.dwarf2.pieces.exp: New file.

View File

@ -54,4 +54,18 @@ proc pieces_test_f1 {} {
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