diff options
author | Doug Evans <dje@google.com> | 2015-08-10 12:23:09 -0700 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2015-08-10 12:23:09 -0700 |
commit | e27852be65403306da198b3c1d7b222acd6bdfe9 (patch) | |
tree | 0c62fa6fa515cbde26bf7121086fab9dea124c39 /gdb/testsuite/gdb.base | |
parent | fd7dcb94cbd44629b3929336aec8b76c3e339656 (diff) | |
download | gdb-e27852be65403306da198b3c1d7b222acd6bdfe9.zip gdb-e27852be65403306da198b3c1d7b222acd6bdfe9.tar.gz gdb-e27852be65403306da198b3c1d7b222acd6bdfe9.tar.bz2 |
PR gdb/17960 Internal error: tracker != NULL when completing on file:function
gdb/ChangeLog:
* symtab.c (make_file_symbol_completion_list_1): Renamed from
make_file_symbol_completion_list and made static.
(make_file_symbol_completion_list): New function.
gdb/testsuite/ChangeLog:
* gdb.base/completion.exp: Add location completer tests.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r-- | gdb/testsuite/gdb.base/completion.exp | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp index 1eb0fd8..f0e4dec 100644 --- a/gdb/testsuite/gdb.base/completion.exp +++ b/gdb/testsuite/gdb.base/completion.exp @@ -777,6 +777,88 @@ gdb_test_multiple "" "$test" { } # +# Tests for the location completer +# + +# Turn off pending breakpoint support so that we don't get queried +# all the time. +gdb_test_no_output "set breakpoint pending off" + +set subsrc [string range $srcfile 0 [expr {[string length $srcfile] - 3}]] +set test "tab complete break $subsrc" +send_gdb "break $subsrc\t\t" +gdb_test_multiple "" $test { + -re "break\.c.*break1\.c.*$gdb_prompt " { + send_gdb "1\t\n" + gdb_test_multiple "" $test { + -re ".*Function \"$srcfile2\" not defined\..*$gdb_prompt " { + pass $test + } + -re "$gdb_prompt p$" { + fail $test + } + } + } + + -re "$gdb_prompt p$" { + fail $test + } +} + +gdb_test "complete break $subsrc" "break\.c.*break1\.c" + +set test "tab complete break need" +send_gdb "break need\t" +gdb_test_multiple "" $test { + -re "break need_malloc " { + send_gdb "\n" + gdb_test_multiple "" $test { + -re ".*Breakpoint.*at .*/$srcfile, line .*$gdb_prompt " { + pass $test + gdb_test_no_output "delete breakpoint \$bpnum" \ + "delete breakpoint for $test" + } + -re "$gdb_prompt p$" { + fail $test + } + } + } + -re "$gdb_prompt p$" { + fail $test + } +} + +gdb_test "complete break need" "need_malloc" + +# gdb/17960 +# Enabling max-completions is necessary to trigger the bug. +gdb_test_no_output "set max-completions 10" +set test "tab complete break $srcfile:ma" +send_gdb "break $srcfile:ma\t" +gdb_test_multiple "" $test { + -re "break $srcfile:main " { + send_gdb "\n" + gdb_test_multiple "" $test { + -re ".*Breakpoint.*at .*/$srcfile, line .*$gdb_prompt " { + pass $test + gdb_test_no_output "delete breakpoint \$bpnum" \ + "delete breakpoint for $test" + } + -re "$gdb_prompt p$" { + fail $test + } + } + } + -re "$gdb_prompt p$" { + fail $test + } +} + +gdb_test "complete break $srcfile:ma" "break\.c:main" + +# End of gdb/17960 testing. + +# # Completion limiting. # |