From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23610 invoked by alias); 7 Nov 2012 13:01:58 -0000 Received: (qmail 23600 invoked by uid 22791); 7 Nov 2012 13:01:57 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Nov 2012 13:01:26 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1TW5G2-0000m8-Dq from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 07 Nov 2012 05:01:26 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 7 Nov 2012 05:01:26 -0800 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Wed, 7 Nov 2012 05:01:25 -0800 From: Yao Qi To: Subject: [PATCH] partial fix PR 14777: Add abbrev cmd 'fo' for 'forward-search'. Date: Wed, 07 Nov 2012 13:01:00 -0000 Message-ID: <1352293267-6640-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes 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-11/txt/msg00140.txt.bz2 Hi, As reported in gdb/14777, when typing 'fo' in CLI, we will get, (gdb) fo Ambiguous command "fo": focus, forward-search. which is inconsistent to the doc about command 'forward-search' that "abbreviate the command name as fo". We can fix this problem in two ways, either remove this line above from the doc or define "fo" as the abbreviated command of 'forward-search'. IMO, latter is better, so this is what this patch does. Regression tested on x86_64-linux. Is it OK? gdb/doc: 2012-11-07 Yao Qi * gdb.texinfo (Search): Add kindex for 'fo'. gdb: 2012-11-07 Yao Qi PR gdb/14777. * source.c (_initialize_source): Call add_com_alias to abbreviate 'forward-search' as 'fo'. --- gdb/doc/gdb.texinfo | 1 + gdb/source.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index c2c7745..c7777e6 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -6955,6 +6955,7 @@ regular expression. @table @code @kindex search @kindex forward-search +@kindex fo @r{(@code{forward-search})} @item forward-search @var{regexp} @itemx search @var{regexp} The command @samp{forward-search @var{regexp}} checks each line, diff --git a/gdb/source.c b/gdb/source.c index bd11c63..307fecc 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -1953,6 +1953,7 @@ The address is also stored as the value of \"$_\".")); Search for regular expression (see regex(3)) from last line listed.\n\ The matching line number is also stored as the value of \"$_\".")); add_com_alias ("search", "forward-search", class_files, 0); + add_com_alias ("fo", "forward-search", class_files, 1); add_com ("reverse-search", class_files, reverse_search_command, _("\ Search backward for regular expression (see regex(3)) from last line listed.\n\ -- 1.7.7.6