aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2/implptr.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/implptr.exp')
-rw-r--r--gdb/testsuite/gdb.dwarf2/implptr.exp18
1 files changed, 17 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/implptr.exp b/gdb/testsuite/gdb.dwarf2/implptr.exp
index 562e983..a199a84 100644
--- a/gdb/testsuite/gdb.dwarf2/implptr.exp
+++ b/gdb/testsuite/gdb.dwarf2/implptr.exp
@@ -60,11 +60,26 @@ proc implptr_test_bar {} {
gdb_test "print ***l" " = 5" "print ***l in implptr:bar"
}
+# Test implicit pointer offset.
+proc implptr_test_baz {} {
+ global csrcfile
+ set line [gdb_get_line_number "baz breakpoint" $csrcfile]
+ gdb_test "break implptr.c:$line" "Breakpoint 3.*" \
+ "set baz breakpoint for implptr"
+ gdb_continue_to_breakpoint "continue to baz breakpoint for implptr"
+ gdb_test {p p[0].y} " = 92" "sanity check element 0"
+ gdb_test {p p[1].y} " = 46" "sanity check element 1"
+ gdb_test "step" "\r\nadd \\(.*" "enter the inlined function"
+ gdb_test "p a->y" " = 92" "check element 0 for the offset"
+ gdb_test "p b->y" " = 46" "check element 1 for the offset"
+ gdb_continue_to_breakpoint "ignore the second baz breakpoint"
+}
+
# Test some values in foo.
proc implptr_test_foo {} {
global csrcfile
set line [gdb_get_line_number "foo breakpoint" $csrcfile]
- gdb_test "break implptr.c:$line" "Breakpoint 3.*" \
+ gdb_test "break implptr.c:$line" "Breakpoint 4.*" \
"set foo breakpoint for implptr"
gdb_continue_to_breakpoint "continue to foo breakpoint for implptr"
gdb_test "print p\[0].x" " = \\(int \\*\\) <synthetic pointer>" \
@@ -81,4 +96,5 @@ proc implptr_test_foo {} {
}
implptr_test_bar
+implptr_test_baz
implptr_test_foo