From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10531 invoked by alias); 16 Dec 2013 22:43:57 -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 10518 invoked by uid 89); 16 Dec 2013 22:43:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ee0-f42.google.com Received: from mail-ee0-f42.google.com (HELO mail-ee0-f42.google.com) (74.125.83.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 16 Dec 2013 22:43:55 +0000 Received: by mail-ee0-f42.google.com with SMTP id e53so2526201eek.29 for ; Mon, 16 Dec 2013 14:43:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=deTE2uWFfHQG4a+sSJqMfRhQWzUfMlffpzQQ1bh8yas=; b=ksZztcPujQQFYYWuO0N7CZOtV+XBF5j9yTRTAhfbO3H53zA+vJ4P/QZadBMzSyvm0p 2hW/RoVU+sVZ6VlzgHIGeC5tUsiN3YidV0qK9QXx1L25IcOCBesrAwn6+2N4n5GCXFFx hLqoV4qHBz5YiU5OsiSWY+lobw14CRK5n+JNFHKNFNUodQ9yoNjoy2uwiBr6IHXfIeMp Dd3aYq+4U22J3on0fgXNZWC4mwN8Ip94yHDoEM81A91htguZBz65kOFgWSfsbK/NPIDh iFRlJ6+3e80qW/0DxiiYYPc3MYGJmCj6NtBx/EkoVnIHywnp/vXRDjb8kist8WgN67wz +a0w== X-Gm-Message-State: ALoCoQl6ee4Mxi/K7xoC+tyFgTuiGcTnKjDBiNphlEs8I8zy2xrEmuuBhQk2JINq/ghycO/AyHjfFVP3oCTSt97hGWaFOuEkCFwnlzZOcrkXvdfRUxGXCqjQih9vmBwPdtz3od8LBuz6B9qhmkRl0t+xbnwSPv8Nhu9ZrsoNe1hWwTeJDvjIgy3hHDc64jaAAUfWJpwmFfiE0JqhJMgq737Wisg5W60RPw== MIME-Version: 1.0 X-Received: by 10.15.108.73 with SMTP id cc49mr19512127eeb.93.1387233832609; Mon, 16 Dec 2013 14:43:52 -0800 (PST) Received: by 10.14.151.72 with HTTP; Mon, 16 Dec 2013 14:43:52 -0800 (PST) In-Reply-To: References: Date: Mon, 16 Dec 2013 22:43:00 -0000 Message-ID: Subject: Re: [PATCH] Debug Methods in GDB Python From: Siva Chandra To: Doug Evans Cc: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00607.txt.bz2 On Mon, Dec 16, 2013 at 9:56 AM, Doug Evans wrote: > 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.] I do not have a compelling reason to be different here. I only have couple of personal reasons for doing it that way: 1. .pretty_printers is actually not a list of pretty printers, but a list of functions which return a pretty printer. I wanted .debug_methods to be a list of actual debug methods. 2. Debug methods are queried for a match twice; Once for object type and name match, next for argument type match. I wanted these to be together instead of in separate places (as in, an object-method matching function and a stateful worker object which does arg type matching). But I agree that this makes the debug methods stateless (almost! They do have a name and enabled flag.) for most cases. I can modify and send a new patch if you feel debug methods should parallel pretty printers here. Thanks, Siva Chandra