From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15879 invoked by alias); 10 Jan 2012 20:26:50 -0000 Received: (qmail 15854 invoked by uid 22791); 10 Jan 2012 20:26:47 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-we0-f169.google.com (HELO mail-we0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Jan 2012 20:26:30 +0000 Received: by werf1 with SMTP id f1so5001735wer.0 for ; Tue, 10 Jan 2012 12:26:29 -0800 (PST) Received: by 10.180.94.102 with SMTP id db6mr7116840wib.0.1326227189454; Tue, 10 Jan 2012 12:26:29 -0800 (PST) Received: from [192.168.0.100] ([2.82.186.136]) by mx.google.com with ESMTPS id m13sm84773495wbh.0.2012.01.10.12.26.27 (version=SSLv3 cipher=OTHER); Tue, 10 Jan 2012 12:26:28 -0800 (PST) Message-ID: <4F0C9EF1.7090602@gmail.com> Date: Tue, 10 Jan 2012 20:28:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: RFC: enum pretty-printing support References: In-Reply-To: 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-01/txt/msg00310.txt.bz2 On 01/10/2012 07:54 PM, Tom Tromey wrote: > I'd appreciate comments on this patch. > > This adds a new helper class to gdb.printing to handle printing of enum > values which are or'd together. E.g.: > > print (enum flag_enum) (FLAG_1 | FLAG_3) > $8 = 0x5 [FLAG_1 | FLAG_3] I think this is great. On 01/10/2012 07:54 PM, Tom Tromey wrote: > +@item EnumerationPrinter (@var{name}) > +A pretty-printer which handles printing of @code{enum} values. Unlike > +@value{GDBN}'s built-in @code{enum} printing, this printer handles the > +case where enumerators are or'd together to create a value. > +@var{name} is the name of the printer and also the name of the > +@code{enum} type to look up. Is the intention to have this printer do more than work with flag enums? Otherwise, I'd suggest naming it FlagEnumerationPrinter (or some such). -- Pedro Alves