From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5374 invoked by alias); 14 Feb 2012 12:48:56 -0000 Received: (qmail 5364 invoked by uid 22791); 14 Feb 2012 12:48:55 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Feb 2012 12:48:34 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1ECmY5j022675 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 14 Feb 2012 07:48:34 -0500 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q1ECmWsH029880; Tue, 14 Feb 2012 07:48:33 -0500 Message-ID: <4F3A5820.3080905@redhat.com> Date: Tue, 14 Feb 2012 12:48:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Scott Goldman CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH] Allow user-defined as a category for python gdb macros (resend) References: <03E840D17E263A48A5766AD576E0423A03D72B653F@exch-mbx-111.vmware.com> In-Reply-To: <03E840D17E263A48A5766AD576E0423A03D72B653F@exch-mbx-111.vmware.com> Content-Type: text/plain; charset=ISO-8859-1 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: 2012-02/txt/msg00260.txt.bz2 On 02/14/2012 12:48 AM, Scott Goldman wrote: > This patch allows python macros to coexist with legacy gdb macros in > user-defined category. This way, it's possible to organize your macros > such that `help user` shows both legacy and python macros. I also > modified the documentation to use the `user` category in the example > python macro. It seemed like a more reasonable default category than > `obscure`. Thanks. > 2012-02-13 Scott J. Goldman > > * gdb.texinfo: put example python macro in COMMAND_USER category > rather than COMMAND_OBSCURE. Documentation entries have their own ChangeLog in doc/. Also, you should put the node in the () where that change occurs. Also, ChangeLogs require complete sentences with punctuation/capitalization; here, and other entries. > * py-cmd.c (cmdpy_init): treat class_user as a valid class in error check > (gdbpy_initialize_commands): Add COMMAND_USER as a constant in > gdb python api. Paths have to be complete in ChangeLogs relative to where the ChangeLog is located, so in this case: python/py-cmd.c > * top.c (execute_command): only execute a user-defined command as a > legacy macro if c->user_commands is set. I think this patch is generally fine, but I think it needs a test-case. It should be fairly simple to write one. Any new feature, or regression fix generally requires a test-case to catch any future regression. This is especially relevant in the Python areas of GDB which are under constant development. Cheers, Phil