From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67323 invoked by alias); 18 Feb 2020 20:42:44 -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 67315 invoked by uid 89); 18 Feb 2020 20:42:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.133) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Feb 2020 20:42:41 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 37164400C85E3 for ; Tue, 18 Feb 2020 14:42:40 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 49hYjFTEmvBMd49hYjCtc2; Tue, 18 Feb 2020 14:42:40 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Fm0VIHKMUDRqvvHp/6XoF3E7urdsp8csx1BehBj+j20=; b=JCeKkyp5yY4mmv4do0z6ytNl4K sIkRmT+dP0PkeqG06l/PphAq5eCvMVyBrbFRp0alH2G+uuTrVDbFWL2rpGjEYeDoSGCvOGoOB9O9H bkxPGUjqES0jDSyH/iKkL8GLO; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:49086 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1j49hX-001kiq-V6; Tue, 18 Feb 2020 13:42:40 -0700 From: Tom Tromey To: Simon Marchi Cc: Luis Machado , Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH 2/5] gdb: fix printing of flag enums with multi-bit enumerators References: <20200213203035.30157-1-simon.marchi@efficios.com> <20200213203035.30157-2-simon.marchi@efficios.com> <2e83ba29-99c4-d611-45ec-ee98ac81fc34@linaro.org> <78d03fba-9901-01d5-c1ed-9631986e2579@simark.ca> <6de31f86-c2b1-17a0-9db1-4cc5c26a315a@simark.ca> Date: Tue, 18 Feb 2020 20:42:00 -0000 In-Reply-To: <6de31f86-c2b1-17a0-9db1-4cc5c26a315a@simark.ca> (Simon Marchi's message of "Mon, 17 Feb 2020 14:20:22 -0500") Message-ID: <871rqr7hkw.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2020-02/txt/msg00739.txt.bz2 >>>>> "Simon" == Simon Marchi writes: Simon> enum hello { AAA = 0x1, BBB = 0xf0 }; Simon> (gdb) p (enum hello) 0x11 Simon> $1 = (AAA | BBB) Ouch. Simon> gdb/ChangeLog: Simon> * dwarf2/read.c: Include "count-one-bits.h". Simon> (update_enumeration_type_from_children): If an enumerator has Simon> multiple bits set, don't treat the enumeration as a "flag enum". Simon> * valprint.c (generic_val_print_enum_1): Assert that enumerators Simon> of flag enums have 0 or 1 bit set. Thanks, this looks good to me. Tom