From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15444 invoked by alias); 9 Mar 2011 13:54:50 -0000 Received: (qmail 15436 invoked by uid 22791); 9 Mar 2011 13:54:49 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,T_TO_NO_BRKTS_FREEMAIL 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 13:54:41 +0000 Received: by fxm5 with SMTP id 5so581162fxm.0 for ; Wed, 09 Mar 2011 05:54:39 -0800 (PST) Received: by 10.223.143.86 with SMTP id t22mr2141807fau.74.1299678879443; Wed, 09 Mar 2011 05:54:39 -0800 (PST) Received: from [172.21.0.61] ([86.125.99.77]) by mx.google.com with ESMTPS id f15sm783556fax.34.2011.03.09.05.54.38 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Mar 2011 05:54:38 -0800 (PST) Message-ID: <4D7786A1.8020806@gmail.com> Date: Wed, 09 Mar 2011 14:03: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: gdb-patches@sourceware.org Subject: Re: [patch] Add support for hooking prefix commands References: <4D776143.4000200@gmail.com> <83oc5kpivg.fsf@gnu.org> <4D777894.5040204@gmail.com> <83k4g8pg4x.fsf@gnu.org> In-Reply-To: <83k4g8pg4x.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/msg00597.txt.bz2 On 03/09/2011 03:39 PM, Eli Zaretskii wrote: >> Date: Wed, 09 Mar 2011 14:54:44 +0200 >> From: Sorin Otescu >> CC: gdb-patches@sourceware.org >> >>> 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). > That could be a problem. What do others think? > >>> 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. > Are you saying that 7.2 already supports this feature? Or are you > saying that it's documented there, but doesn't work? > It's documented there, but I can't test it ATM, because I'm using a gdb from a toolchain and it's not easy for me to switch to 7.2. Maybe somebody can shed a light on the issue. I see some problems with that approach, even if it works. What happens if two or more commands have the same second word ? Which one would be used ?