From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15825 invoked by alias); 1 Jul 2008 21:38:04 -0000 Received: (qmail 15812 invoked by uid 22791); 1 Jul 2008 21:38:03 -0000 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 01 Jul 2008 21:37:44 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id m61LbeDV090042 for ; Tue, 1 Jul 2008 23:37:40 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402::142]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id m61LbeV4027164 for ; Tue, 1 Jul 2008 23:37:40 +0200 (CEST) Received: from d620muller ([130.79.244.150]) by mailserver.u-strasbg.fr (8.13.8/jtpda-5.5pre1) with ESMTP id m61Lba6A061078 for ; Tue, 1 Jul 2008 23:37:40 +0200 (CEST) From: "Pierre Muller" To: Subject: [RFA] use filename_completer for add_setshow_optional_filename_cmd Date: Tue, 01 Jul 2008 21:38:00 -0000 Message-ID: <000001c8dbc2$b1d7afe0$15870fa0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (mailhost.u-strasbg.fr [IPv6:2001:660:2402::155]); Tue, 01 Jul 2008 23:37:40 +0200 (CEST) X-Virus-Status: Clean 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: 2008-07/txt/msg00006.txt.bz2 I discovered that set debug-file-directory does not use filename_completer. This is because add_setshow_optional_filename_cmd does not set the set completer to filename completer, contrary to add_setshow_filename_cmd. Is there any reason for this? Or is it just a bug? The following small patch fixes this by setting the set part completer to filename_completer for add_setshow_optional_filename_cmd exactly as is done in add_setshow_filename_cmd. There are currently only three adffected commands: "set debug-file-directory" "set args" "set solib-search-path" Only the second one might be questionable, but I also find that it is reasonable to have filename completion for "set args" as this is now done on most shells. I ran the testsuite with that patch on cygwin, and the only difference I got was in gdb.trace/packetlen.exp but I can't see any relation with the patch, and this problem is probably due to some instabilities on the cygwin testsuite. Is this OK to commit? Pierre Muller Pascal language support maintainer for GDB ChangeLog entry: 2008-07-01 Pierre Muller cli/cli-decode.c (add_setshow_optional_filename_cmd): Set completer for set to filename_completer. Index: gdb/cli/cli-decode.c =================================================================== RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v retrieving revision 1.65 diff -u -p -r1.65 cli-decode.c --- gdb/cli/cli-decode.c 3 May 2008 23:24:17 -0000 1.65 +++ gdb/cli/cli-decode.c 1 Jul 2008 15:27:41 -0000 @@ -539,11 +539,16 @@ add_setshow_optional_filename_cmd (char struct cmd_list_element **set_list, struct cmd_list_element **show_list) { + struct cmd_list_element *set_result; + add_setshow_cmd_full (name, class, var_optional_filename, var, set_doc, show_doc, help_doc, set_func, show_func, set_list, show_list, - NULL, NULL); + &set_result, NULL); + + set_cmd_completer (set_result, filename_completer); + } /* Add element named NAME to both the set and show command LISTs (the