From b45627a0393fefeea5ea68b98c6f76932f53d943 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 2 Nov 2012 19:05:12 +0000 Subject: [PATCH] * breakpoint.c (catch_syscall_completer): Pass 'word' as second argument to complete_on_enum. testsuite * gdb.base/catch-syscall.exp (do_syscall_tests): Add completion test. --- gdb/ChangeLog | 5 +++++ gdb/breakpoint.c | 2 +- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.base/catch-syscall.exp | 5 +++++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e2a2253867..0fc9a86816 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-11-02 Tom Tromey + + * breakpoint.c (catch_syscall_completer): Pass 'word' as second + argument to complete_on_enum. + 2012-11-02 Tom Tromey * configure: Rebuild. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 76e3e89bb9..0023ba5a37 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -14972,7 +14972,7 @@ catch_syscall_completer (struct cmd_list_element *cmd, { const char **list = get_syscall_names (); VEC (char_ptr) *retlist - = (list == NULL) ? NULL : complete_on_enum (list, text, word); + = (list == NULL) ? NULL : complete_on_enum (list, word, word); xfree (list); return retlist; diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 91287e34ae..e3376d1316 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-11-02 Tom Tromey + + * gdb.base/catch-syscall.exp (do_syscall_tests): Add completion + test. + 2012-11-02 Pedro Alves PR gdb/14766 diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp index 9054cfe048..8aa81e01b2 100644 --- a/gdb/testsuite/gdb.base/catch-syscall.exp +++ b/gdb/testsuite/gdb.base/catch-syscall.exp @@ -288,6 +288,11 @@ proc do_syscall_tests {} { set thistest "catch syscall to a nonsense syscall is prohibited" gdb_test "catch syscall nonsense_syscall" "Unknown syscall name .*" $thistest + # Regression test for syscall completer bug. + gdb_test "complete catch syscall close chroo" \ + "catch syscall close chroot" \ + "complete catch syscall with multiple words" + # Testing the 'catch syscall' command without arguments. # This test should catch any syscalls. if [runto_main] then { test_catch_syscall_without_args }