From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29141 invoked by alias); 19 May 2011 01:59:07 -0000 Received: (qmail 29089 invoked by uid 22791); 19 May 2011 01:59:06 -0000 X-SWARE-Spam-Status: No, hits=-2.4 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) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 May 2011 01:58:52 +0000 Received: from hpaq7.eem.corp.google.com (hpaq7.eem.corp.google.com [172.25.149.7]) by smtp-out.google.com with ESMTP id p4J1wo9V029321 for ; Wed, 18 May 2011 18:58:50 -0700 Received: from yxe1 (yxe1.prod.google.com [10.190.2.1]) by hpaq7.eem.corp.google.com with ESMTP id p4J1wgEl027897 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 18 May 2011 18:58:49 -0700 Received: by yxe1 with SMTP id 1so1063817yxe.11 for ; Wed, 18 May 2011 18:58:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.2.30 with SMTP id e30mr2120522agi.153.1305770328878; Wed, 18 May 2011 18:58:48 -0700 (PDT) Received: by 10.90.72.6 with HTTP; Wed, 18 May 2011 18:58:48 -0700 (PDT) In-Reply-To: <1305761175-10188-1-git-send-email-scottjg@vmware.com> References: <1305761175-10188-1-git-send-email-scottjg@vmware.com> Date: Thu, 19 May 2011 01:59:00 -0000 Message-ID: Subject: Re: [PATCH] Add support for `user-defined` python commands From: Doug Evans To: "Scott J. Goldman" Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 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/msg00415.txt.bz2 On Wed, May 18, 2011 at 4:26 PM, Scott J. Goldman wrote: > For codebases with a large pre-existing set of legacy gdb macros, it's > nice to be able to use `help user-defined`, to refresh your memory wrt > to existing macros. Currently, python gdb commands can't put themselves > under the `user-defined` category. This patch aims to rectify that. 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.] What does "help user-defined" buy? It *does* buy a way to see a list of a particular set of available commands, but the list isn't categorized along functional lines (like managing breakpoints or examining data). What the user will get is a list of a random set of commands. For completeness sake, prefix commands provide another way of categorizing commands - one *could* put a set of new commands in a prefix command, and then "help " would list all of the commands. But it doesn't always fit what one wants to do. E.g. it wouldn't list anything added as a set/show or info command (python commands mightn't be able to be implemented as set/show/info today, I forget, but it seems like a useful thing to at least not preclude). Question: What if we had the ability to add new command classes? And what if "help " could print all the commands in that command class? Then one could add a whole suite of python commands to deal with foo (which needn't necessarily match any existing command class), and "help foo" would list them all. Just a thought.