From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1020 invoked by alias); 16 Dec 2013 17:56:41 -0000 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 Received: (qmail 1010 invoked by uid 89); 16 Dec 2013 17:56:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f175.google.com Received: from mail-we0-f175.google.com (HELO mail-we0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 16 Dec 2013 17:56:40 +0000 Received: by mail-we0-f175.google.com with SMTP id t60so4917865wes.6 for ; Mon, 16 Dec 2013 09:56:36 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.180.14.195 with SMTP id r3mr14468111wic.51.1387216596853; Mon, 16 Dec 2013 09:56:36 -0800 (PST) Received: by 10.194.123.4 with HTTP; Mon, 16 Dec 2013 09:56:36 -0800 (PST) In-Reply-To: References: Date: Mon, 16 Dec 2013 17:56:00 -0000 Message-ID: Subject: Re: [PATCH] Debug Methods in GDB Python From: Doug Evans To: Siva Chandra Cc: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00589.txt.bz2 On Fri, Dec 13, 2013 at 11:24 AM, Siva Chandra wrote: >> On Fri, Dec 6, 2013 at 3:24 PM, Siva Chandra wrote: >> I have removed DEFAULT_DEBUG_METHOD_GROUP from the code in my latest >> patch. However, there is one reference to it in the brief (really >> brief!) doc change I have in the patch [1]. About grouping in >> libstdc++, is it not doing a grouping within what is facilitated by >> the pretty printing API? > > dje > Not sure I understand the question. > > libstdc++ pretty printers use the pretty printing API provided by GDB > Python. So, if we are to compare debug methods API to something, > shouldn't we be comparing with the pretty printing API? About the > matching API provided by the debug methods API in my patch, there > isn't anything specific at all. The users can match class name and > method name in whatever manner they please. If they like the libstdc++ > pretty printers way, then they can do it that way. Ah. Note that the grouping in the pretty-printer API is because one pretty-printer can pretty-print several objects, and the functionality is split into two steps: the lookup object returns a separate object which is then later used to do the printing, and the lookup can record in the returned pretty-printer-worker object whatever state it wants. In dm-v6 AFAICT lookup and functionality exist in the same object so that's not possible (e.g., the DebugMethod.match method returns True/False instead of, e.g., a debug-method-worker object). We could, I think(!), go with debug-methods as in v6, sans method groups, and later extend it if a more formal grouping is needed. I wonder, though, about the match method returning True/False vs the pretty-printer way of the lookup object returning an object that then does the printing. [In the debug method case the lookup method might want to return a list if the method is overloaded.] Unless there's a compelling reason to be different, I like "Consistency Is Good", so that's what I'm shooting for. [But if there is a compelling reason to be different, I'm not opposed to being different here.]