#
# test running programs
#
-set prms_id 0
-set bug_id 0
set testfile "break"
set srcfile ${testfile}.c
-re "^help info watchpoints $"\
{ send_gdb "\n"
gdb_expect {
- -re "Synonym for .*\r\n.*$gdb_prompt $"\
+ -re "Status of watchpoints, .*\r\n.*$gdb_prompt $"\
{ pass "complete help info wat" }
-re ".*$gdb_prompt $" { fail "complete help info wat"}
timeout {fail "(timeout) complete help info wat"}
timeout { fail "(timeout) complete 'p &values\[0\] -> a' 2" }
}
+gdb_test "complete p &values\[0\]->z" \
+ "p &values.0.->z_field" \
+ "copmletion of field in anonymous union"
+
# The following tests used to simply try to complete `${objdir}/file',
# and so on. The problem is that ${objdir} can be very long; the
# completed filename may be more than eighty characters wide. When
-re "marker1.*$gdb_prompt info func marker$"\
{ send_gdb "\n"
gdb_expect {
- -re "All functions matching regular expression \"marker\":.*File.*break1.c:\r\nint marker1\\((void|)\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long int\\);.*$gdb_prompt $"\
+ -re "All functions matching regular expression \"marker\":.*File.*break1.c:\r\nint marker1\\((void|)\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long( int)?\\);.*$gdb_prompt $"\
{ pass "complete 'info func marke'"}
-re ".*$gdb_prompt $" { fail "complete 'info func marke'"}
timeout {fail "(timeout) complete 'info func marke'"}
timeout { fail "(timeout) complete 'set follow-fork-mode'" }
}
-send_gdb "p values\[0\].nonex.\t"
-gdb_expect {
- -re "Type struct some_struct has no component named nonex.\r\n$gdb_prompt $"\
- { pass "Completing non-existing component" }
- -re ".*$gdb_prompt $" { fail "Completing non-existing component" }
- timeout { fail "(timeout) Completing non-existing component" }
- eof { fail "(eof) Completing non-existing component #2" }
- }
-# Double memory freeing gets found only on the second run:
-send_gdb "p values\[0\].nonex.\t"
-gdb_expect {
- -re "Type struct some_struct has no component named nonex.\r\n$gdb_prompt $"\
- { pass "Completing non-existing component #2" }
- -re ".*$gdb_prompt $" { fail "Completing non-existing component #2" }
- timeout { fail "(timeout) Completing non-existing component #2" }
- eof { fail "(eof) Completing non-existing component #2" }
- }
+gdb_test_no_output "complete print values\[0\].x." \
+ "field completion with invalid field"
+
+# If there is a non-deprecated completion, it should be returned.
+gdb_test "complete sav" "save" "test non-deprecated completion"
+# If there is only a deprecated completion, then it should be returned.
+gdb_test "complete save-t" "save-tracepoints" "test deprecated completion"
+
# Restore globals modified in this test...
set timeout $oldtimeout1