* Patch: fix catch syscall completion
@ 2012-10-26 17:20 Tom Tromey
2012-10-26 17:40 ` Pedro Alves
0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2012-10-26 17:20 UTC (permalink / raw)
To: gdb-patches
I noticed that the "catch syscall" completer doesn't work quite right.
It will complete "catch syscall vfor" ok, but not a multi-word
use like "catch syscall read vfor".
This patch fixes the bug. New test case included.
Built and regtested on x86-64 Fedora 16.
Tom
2012-10-26 Tom Tromey <tromey@redhat.com>
* breakpoint.c (catch_syscall_completer): Pass 'word' as second
argument to complete_on_enum.
2012-10-26 Tom Tromey <tromey@redhat.com>
* gdb.base/catch-syscall.exp (do_syscall_tests): Add completion
test.
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 76e3e89..0023ba5 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/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp
index 9054cfe..8aa81e0 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 }
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Patch: fix catch syscall completion
2012-10-26 17:20 Patch: fix catch syscall completion Tom Tromey
@ 2012-10-26 17:40 ` Pedro Alves
0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2012-10-26 17:40 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On 10/26/2012 06:19 PM, Tom Tromey wrote:
> I noticed that the "catch syscall" completer doesn't work quite right.
> It will complete "catch syscall vfor" ok, but not a multi-word
> use like "catch syscall read vfor".
>
> This patch fixes the bug. New test case included.
> Built and regtested on x86-64 Fedora 16.
Looks OK to me.
> 2012-10-26 Tom Tromey <tromey@redhat.com>
>
> * breakpoint.c (catch_syscall_completer): Pass 'word' as second
> argument to complete_on_enum.
>
> 2012-10-26 Tom Tromey <tromey@redhat.com>
>
> * gdb.base/catch-syscall.exp (do_syscall_tests): Add completion
> test.
--
Pedro Alves
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-26 17:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-26 17:20 Patch: fix catch syscall completion Tom Tromey
2012-10-26 17:40 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox