From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13633 invoked by alias); 9 Mar 2011 12:54:52 -0000 Received: (qmail 13621 invoked by uid 22791); 9 Mar 2011 12:54:51 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f41.google.com (HELO mail-fx0-f41.google.com) (209.85.161.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Mar 2011 12:54:45 +0000 Received: by fxm5 with SMTP id 5so518201fxm.0 for ; Wed, 09 Mar 2011 04:54:43 -0800 (PST) Received: by 10.223.65.196 with SMTP id k4mr507080fai.9.1299675282928; Wed, 09 Mar 2011 04:54:42 -0800 (PST) Received: from [172.21.0.61] ([86.125.99.77]) by mx.google.com with ESMTPS id c11sm873254fav.26.2011.03.09.04.54.41 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Mar 2011 04:54:42 -0800 (PST) Message-ID: <4D777894.5040204@gmail.com> Date: Wed, 09 Mar 2011 13:36:00 -0000 From: Sorin Otescu User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: Eli Zaretskii CC: gdb-patches@sourceware.org Subject: Re: [patch] Add support for hooking prefix commands References: <4D776143.4000200@gmail.com> <83oc5kpivg.fsf@gnu.org> In-Reply-To: <83oc5kpivg.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: 2011-03/txt/msg00593.txt.bz2 On 03/09/2011 02:40 PM, Eli Zaretskii wrote: >> Date: Wed, 09 Mar 2011 13:15:15 +0200 >> From: Sorin Otescu >> >> I recently needed to add a hook for the "info threads" command. >> Unfortunately, this was not possible because GDB only allows hooking of >> single word commands. >> This patch adds support for multi-word command (prefix command) hooks. >> In my case, the format of the hook commands is: > Thanks. > >> define hook-info_threads >> define hookpost-info_threads > Can we have underscore characters in commands? If so, this > implementation would defeat hooking them. > It is possible to define commands containing underscores, but none of the built-in commands contain any (they all use dash). > Anyway, if this is accepted, please write a short patch for the manual > as well. > The documentation for 7.2 suggests this functionality is already there; the difference is that you need to hook the last word of the command (in this case, hook-threads). I wonder if that's enough / better... This patch was generated from 7.0 and adapted to 7.2.