From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31730 invoked by alias); 26 Oct 2012 17:20:10 -0000 Received: (qmail 31714 invoked by uid 22791); 26 Oct 2012 17:20:06 -0000 X-SWARE-Spam-Status: No, hits=-7.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Oct 2012 17:19:53 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9QHJqZ4021736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 26 Oct 2012 13:19:52 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q9QHJpxA004672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 26 Oct 2012 13:19:52 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Subject: Patch: fix catch syscall completion Date: Fri, 26 Oct 2012 17:20:00 -0000 Message-ID: <87fw512ls8.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00519.txt.bz2 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 * breakpoint.c (catch_syscall_completer): Pass 'word' as second argument to complete_on_enum. 2012-10-26 Tom Tromey * 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 }