From 74de6778b16fe5429d512d7250747f4d9e1ed374 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 21 May 2010 21:00:27 +0000 Subject: gdb * eval.c (evaluate_subexp_standard) : Call evaluate_subexp, not evaluate_subexp_with_coercion. gdb/testsuite * gdb.dwarf2/pieces.exp (pieces_test_f2): New proc. Call it. --- gdb/ChangeLog | 5 +++++ gdb/eval.c | 4 ++-- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.dwarf2/pieces.exp | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 2 deletions(-) (limited to 'gdb') diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 067ea48..4db2977 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2010-05-21 Tom Tromey + + * eval.c (evaluate_subexp_standard) : Call + evaluate_subexp, not evaluate_subexp_with_coercion. + 2010-05-21 Pierre Muller * dwarf2read.c (new_symbol): Handle DW_AT_variable_parameter diff --git a/gdb/eval.c b/gdb/eval.c index 1dbf6fa..8efb45a 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -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)) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 304334d..87bec37 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2010-05-21 Tom Tromey + * gdb.dwarf2/pieces.exp (pieces_test_f2): New proc. + Call it. + +2010-05-21 Tom Tromey + * gdb.dwarf2.pieces.exp: New file. * gdb.dwarf2.pieces.S: New file. * gdb.dwarf2.pieces.c: New file. diff --git a/gdb/testsuite/gdb.dwarf2/pieces.exp b/gdb/testsuite/gdb.dwarf2/pieces.exp index bdac582..3515586 100644 --- a/gdb/testsuite/gdb.dwarf2/pieces.exp +++ b/gdb/testsuite/gdb.dwarf2/pieces.exp @@ -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 -- cgit v1.1