This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 5/5] gdb: change print format of flag enums with value 0


On 2020-02-18 3:45 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> gdb/ChangeLog:
> 
> Simon> 	* valprint.c (generic_val_print_enum_1): When printing a flag
> Simon> 	enum with value 0 and there is no enumerator with value 0, print
> Simon> 	just "0" instead of "(unknown: 0x0)".
> 
> This looks reasonable.  Thanks.
> 
> Simon>        /* We have a "flag" enum, so we try to decompose it into
> Simon>  	 pieces as appropriate.  A flag enum has disjoint
> Simon>  	 constants by definition.  */
> 
> I guess this comment is stale now, because an earlier patch changed it
> so that identical constants are allowed.

Right, I would then change this comment to this in patch 3/5:

 634       /* We have a "flag" enum, so we try to decompose it into pieces as
 635          appropriate.  The enum may have multiple enumerators representing
 636          the same bit, in which case we choose to only print the first one
 637          we find.  */

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]