From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12829 invoked by alias); 19 May 2011 03:08:30 -0000 Received: (qmail 12819 invoked by uid 22791); 19 May 2011 03:08:30 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 May 2011 03:08:15 +0000 Received: from wpaz17.hot.corp.google.com (wpaz17.hot.corp.google.com [172.24.198.81]) by smtp-out.google.com with ESMTP id p4J38FrF026630 for ; Wed, 18 May 2011 20:08:15 -0700 Received: from yib2 (yib2.prod.google.com [10.243.65.66]) by wpaz17.hot.corp.google.com with ESMTP id p4J38Dph002458 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 18 May 2011 20:08:14 -0700 Received: by yib2 with SMTP id 2so862762yib.38 for ; Wed, 18 May 2011 20:08:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.35.33 with SMTP id n33mr2109956agj.126.1305774493609; Wed, 18 May 2011 20:08:13 -0700 (PDT) Received: by 10.90.72.6 with HTTP; Wed, 18 May 2011 20:08:13 -0700 (PDT) In-Reply-To: References: <1305761175-10188-1-git-send-email-scottjg@vmware.com> Date: Thu, 19 May 2011 03:08:00 -0000 Message-ID: Subject: Re: [PATCH] Add support for `user-defined` python commands From: Doug Evans To: Scott Goldman Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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-05/txt/msg00417.txt.bz2 On Wed, May 18, 2011 at 7:54 PM, Scott Goldman wrote: > Hi Doug. > >> I think there's a problem to solve here (finding one's way in the >> myriad of available commands), but I'm not sure this is the way to go. >> [Maybe it is though.] > > I think you made some interesting points. From what I make of your email,= the question you've proposed is something like "should we even have user-d= efined category at all?". I'm sure there will be a lot of opinions on this.= UI debates are tougher for me than technical ones :) > > I can see the discussion branching in two directions: > 1) Yes, we should have a user-defined category, but we also want to eithe= r: subdivide the user-defined commands into prefix categories, or have addi= tional custom categories. > > In this case, I think it follows that my patch should be applied pretty m= uch as-is (pending any necessary refactoring as requested). If legacy gdb m= acros can enter the `user-defined` category, I don't see why new python gdb= macros should be excluded. Further patches can add the support for additio= nal custom categories, and this patch would be the first step: allowing pyt= hon macros to be classified as `user-defined` at all. > > 2) No, we should not have a user-defined category, and it should be repla= ced by custom categories or prefix categories. > > In this case, my patch is pretty irrelevant. I'm not sure it's either/or. One *could* have both python "user-defined" commands and the ability to add new command classes. I don't think I would ever use "user-defined" except as a throwaway for when I couldn't think of something better. :-) But your patch could *still* be useful enough to add. I think the absence of user-defined python commands is either an oversight or just left out pending an actual need. I only bring this up because after reading your patch, it made me wonder if there isn't a more general problem here. [At a former employer I think we did add user-specifiable command classes - we added a lot of commands: gdb macros, lots of new simulator commands, and commands from dlopen'd libraries. The need for organizing them was clear.]