aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2/pieces.exp
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-05-21 21:01:46 +0000
committerTom Tromey <tromey@redhat.com>2010-05-21 21:01:46 +0000
commitcb82636715e384dc5e75f3c1a4fd436626ba8dcd (patch)
treee75f984689d6689f268f025f198b5cc1817780ff /gdb/testsuite/gdb.dwarf2/pieces.exp
parent74de6778b16fe5429d512d7250747f4d9e1ed374 (diff)
downloadgdb-cb82636715e384dc5e75f3c1a4fd436626ba8dcd.zip
gdb-cb82636715e384dc5e75f3c1a4fd436626ba8dcd.tar.gz
gdb-cb82636715e384dc5e75f3c1a4fd436626ba8dcd.tar.bz2
gdb
* dwarf2loc.c (read_pieced_value): Exit loop when result is full. <DWARF_VALUE_OPTIMIZED_OUT>: New case. * dwarf2expr.h (enum dwarf_value_location) <DWARF_VALUE_OPTIMIZED_OUT>: New constant. * dwarf2expr.c (dwarf_expr_stack_empty_p): New function. (add_piece): Handle empty piece. (execute_stack_op) <DW_OP_piece>: Handle DWARF_VALUE_OPTIMIZED_OUT. gdb/testsuite * gdb.dwarf2/pieces.exp (pieces_test_f6): New proc. Call it. * gdb.dwarf2/pieces.c (struct C): New. (f6): New function. * gdb.dwarf2/pieces.S: Replace.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/pieces.exp')
-rw-r--r--gdb/testsuite/gdb.dwarf2/pieces.exp23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/pieces.exp b/gdb/testsuite/gdb.dwarf2/pieces.exp
index 3515586..c7608cd 100644
--- a/gdb/testsuite/gdb.dwarf2/pieces.exp
+++ b/gdb/testsuite/gdb.dwarf2/pieces.exp
@@ -67,5 +67,28 @@ proc pieces_test_f2 {} {
gdb_test "print a\[1\]" " = 14" "print a\[1\] in pieces:f2"
}
+# Function f6 tests for an empty DW_OP_piece.
+proc pieces_test_f6 {} {
+ global csrcfile
+ set line [gdb_get_line_number "f6 breakpoint" $csrcfile]
+ gdb_test "break pieces.c:$line" "Breakpoint 4.*" \
+ "set f6 breakpoint for pieces"
+ gdb_continue_to_breakpoint "continue to f6 breakpoint for pieces"
+ gdb_test "print a" \
+ "warning: bytes .* in computed object were.* = {i = 7, j = 8, q = 0}" \
+ "print a with optimized out piece"
+ # Note: no warning for this case.
+ gdb_test_multiple "print a.i" \
+ "print a.i with optimized out piece" {
+ -re "warning: some bits in computed object" {
+ fail "print a.i with optimized out piece"
+ }
+ -re " = 7" {
+ pass "print a.i with optimized out piece"
+ }
+ }
+}
+
pieces_test_f1
pieces_test_f2
+pieces_test_f6