From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id tc/ECJSlFGq5LxoAWB0awg (envelope-from ) for ; Mon, 25 May 2026 15:40:04 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=H9ErMBpZ; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 000EA1E024; Mon, 25 May 2026 15:40:03 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 75D961E024 for ; Mon, 25 May 2026 15:40:02 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E6FCA4BA23C4 for ; Mon, 25 May 2026 19:40:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E6FCA4BA23C4 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=H9ErMBpZ Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id B25D74BA2E1E for ; Mon, 25 May 2026 19:39:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B25D74BA2E1E Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B25D74BA2E1E Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779737974; cv=none; b=I09pLsEFZocc0Jm2y/lMAWzBgXUCqQjGZUPSIAp7b23P2GYbwMRpVPtnNJLes1ZC532VgV/rEQcMscB6J7g9RMmpUf0vOYQtXSD33bEwGgu9jp9suSVJgHFURIGNK/uLVxjxMKLrICizJwzVR/wummgsJVPoc//WNrJ+xlWJ6f8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779737974; c=relaxed/simple; bh=mg/5n8di+t3GBmJltxoFh3TO1nueGou5J5al2wik0Es=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=AicLiAF8AlOLfPJ8GbMAu1vSgQ05fKf5EcasVKiv+p9URhjvCfhoOzbMaV6/QU3JzQL0/CEncq2wkmiGZr7JaTvy7LzQ3UGRcAXZWb14X++z0Pv8OkouID4mHrSKK28VvFJjWUSG55wvAqIdwjSQDWqrAWnjeJ6f4jwzw0TWhdE= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=H9ErMBpZ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B25D74BA2E1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779737974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hlwZqSXe7VkrI4Su1cbwnQaXWgP/I7J06fs72G8pJxg=; b=H9ErMBpZg4fHgXseaKb9aCe57IPEtPjd48fBDFs3Vzs2DMkzr3XTpPjtoXeNuUgJTimV7G y8kJEYIHR2MUn5o3oFfKN314X1uijZJrZ42LjlSaMni3Ug2j8moaXrSigaYomCRYKRjIj3 Te3frWgkP2PRR0AWM2aEckaE7T9FiYQ= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-659-1iAEbe5eOlSXxe4vUfyArg-1; Mon, 25 May 2026 15:39:33 -0400 X-MC-Unique: 1iAEbe5eOlSXxe4vUfyArg-1 X-Mimecast-MFC-AGG-ID: 1iAEbe5eOlSXxe4vUfyArg_1779737973 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-8ba8a1f3dd7so42928756d6.3 for ; Mon, 25 May 2026 12:39:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779737972; x=1780342772; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hlwZqSXe7VkrI4Su1cbwnQaXWgP/I7J06fs72G8pJxg=; b=r2JC5Leipnej431c2Yh4EesonlRizKGCAQl2prV9KAxYbmcpLFjP1LJg9Hr7+XqnGG YMbMcOLrr7Yu3ynvlyrDK0vN+ZgGQ68gMslugpjby8OUWXAzDFfNNa2qUgXWsMiqgvbr MUOYkXkFgjuwhEqAcAfhi0pGUdmF+5wKXIj59U8TZTVtpUqyfrycj9N4KPxZ13wojAvE jkOuszZt4fVY0oeQmDu/33vnHFfN+XRwfTggQ86iXwc5iBrYUBwvutglB7gzMMc97Rgy q4r42eSJ1/syTaFkXKEJwvUeZHoGYmR9iRBPTgg+bnUlZOCZpYde64ah0jEcBBipXhvU a+Xg== X-Forwarded-Encrypted: i=1; AFNElJ/uF3ycFLU/zHO3fnI38rThq0r7IjNRD3/RMsGoQhGwH3oerm2CCK423jz/iUHLr43sX673ilEw2uhXdw==@sourceware.org X-Gm-Message-State: AOJu0Yw5ri2TkfObDBejVBTomcC26CERnt6B7MvwrwanbdLy1zZuex5U n0PW9WPgfNa5k+qGz0Hm/gnb5UVLuB6NjArZFWmwmUf8C0GdsE6kmFy9lr58HEcGL4yiWhua5g8 iNQGiAbSDvVvkipEc+mS6+PMlxMm8N3dlDqWd6fFD1PEXUZj6BEno939BnesgNZoE/mg8HD0= X-Gm-Gg: Acq92OGY7FIrXiYYmQsAZ5aAhhn5kn1fYFQvq2MHrAoSCFBtMsx4GsQCG1vhOXzzvBY IJMoJwHb4IzxOoUzfPa+/i1boin9FscOsbfN2Ctbf4hPCljtVuX/bifOvGtF6a5uLFf5xxzqzqn 1iVn8Y6EJOG6HuZniE98iGWrS6CIS6ryCqmDoSNInDMVA0fgv3eJSLZMQ1DWJXDGcr9HR81S4BD Xv4ZSrKdl9hasGeGa4Xtvo8DWS1GFvoFmP0ftIbYpHeRYy6n+jADxsVeNvPU9GXCWoFNu5ghn/i 47I6s1aJCxUSHZdAg/zJ9wVFFwIS36COSSvr9ePe05d/ot2q0BtNaoS4WdcPgcYjwfecVDFVTA9 1iF87LZWwVkj43xVXqsl956EP2coodkXxxY453ijbh9Yt8xfFxIoeqNG8WOrSQQSoM8EK2FPTUu IqLSU= X-Received: by 2002:a05:6214:2e43:b0:89a:622e:d32c with SMTP id 6a1803df08f44-8cc7b612b82mr234728676d6.36.1779737972472; Mon, 25 May 2026 12:39:32 -0700 (PDT) X-Received: by 2002:a05:6214:2e43:b0:89a:622e:d32c with SMTP id 6a1803df08f44-8cc7b612b82mr234728196d6.36.1779737971860; Mon, 25 May 2026 12:39:31 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:993e:2d5d:7adb:2b6:a50e? ([2804:14d:8084:993e:2d5d:7adb:2b6:a50e]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-8cc80ded529sm117587186d6.16.2026.05.25.12.39.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 May 2026 12:39:31 -0700 (PDT) Message-ID: Date: Mon, 25 May 2026 16:39:28 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Do not use ENUM_BITFIELD To: Tom Tromey , gdb-patches@sourceware.org References: <20260524202940.1870575-1-tom@tromey.com> From: Guinevere Larsen In-Reply-To: <20260524202940.1870575-1-tom@tromey.com> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: uDWcyLI7nhM_ELU9R2ghJEEFcPKaLGOt1xsuSovWQPg_1779737973 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 5/24/26 5:29 PM, Tom Tromey wrote: > C++ always allows enum bitfields, so gdb no longer needs to use the > ENUM_BITFIELD macro. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32821 Reading over what the macro does, this patch seems pretty obvious. I tested this by rebuilding quickly and see no issues, so Reviewed-By: Guinevere Larsen -- Cheers, Guinevere Larsen It/she > --- > gdb/cli/cli-decode.h | 2 +- > gdb/dwarf2/abbrev.h | 6 +++--- > gdb/dwarf2/attribute.h | 4 ++-- > gdb/dwarf2/call-site.h | 2 +- > gdb/dwarf2/cooked-index-entry.h | 2 +- > gdb/dwarf2/die.h | 2 +- > gdb/frame-id.h | 2 +- > gdb/gdbtypes.h | 14 +++++++------- > gdb/macrotab.h | 2 +- > gdb/symtab.h | 12 ++++++------ > gdbsupport/packed.h | 4 ++-- > 11 files changed, 26 insertions(+), 26 deletions(-) > > diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h > index 865f89ed9b5..49384f4a04d 100644 > --- a/gdb/cli/cli-decode.h > +++ b/gdb/cli/cli-decode.h > @@ -177,7 +177,7 @@ struct cmd_list_element > > /* Type of "set" or "show" command (or SET_NOT_SET if not "set" > or "show"). */ > - ENUM_BITFIELD (cmd_types) type : 2; > + cmd_types type : 2; > > /* Function definition of this command. NULL for command class > names and for help topics that are not really commands. NOTE: > diff --git a/gdb/dwarf2/abbrev.h b/gdb/dwarf2/abbrev.h > index c5a3c6c39a6..78ad1e164ad 100644 > --- a/gdb/dwarf2/abbrev.h > +++ b/gdb/dwarf2/abbrev.h > @@ -34,8 +34,8 @@ > > struct attr_abbrev > { > - ENUM_BITFIELD(dwarf_attribute) name : 16; > - ENUM_BITFIELD(dwarf_form) form : 16; > + dwarf_attribute name : 16; > + dwarf_form form : 16; > > /* It is valid only if FORM is DW_FORM_implicit_const. */ > LONGEST implicit_const; > @@ -47,7 +47,7 @@ struct abbrev_info > /* Number identifying abbrev. */ > unsigned int number; > /* DWARF tag. */ > - ENUM_BITFIELD (dwarf_tag) tag : 16; > + dwarf_tag tag : 16; > /* True if the DIE has children. */ > bool has_children; > bool interesting; > diff --git a/gdb/dwarf2/attribute.h b/gdb/dwarf2/attribute.h > index 776ce43825d..f2648747d9c 100644 > --- a/gdb/dwarf2/attribute.h > +++ b/gdb/dwarf2/attribute.h > @@ -338,7 +338,7 @@ struct attribute > will issue a complaint and return false. */ > bool as_boolean () const; > > - ENUM_BITFIELD(dwarf_attribute) name : 15; > + dwarf_attribute name : 15; > > /* A boolean that is used for forms that require reprocessing. A > form may require data not directly available in the attribute. > @@ -351,7 +351,7 @@ struct attribute > forms. */ > unsigned int requires_reprocessing : 1; > > - ENUM_BITFIELD(dwarf_form) form : 15; > + dwarf_form form : 15; > > /* Has u.str already been updated by dwarf2_canonicalize_name? This > field should be in u.str but it is kept here for better struct > diff --git a/gdb/dwarf2/call-site.h b/gdb/dwarf2/call-site.h > index e5519721390..5e2e270e383 100644 > --- a/gdb/dwarf2/call-site.h > +++ b/gdb/dwarf2/call-site.h > @@ -152,7 +152,7 @@ struct call_site_parameter > gdb::array_view data_value_expr () const > { return gdb::make_array_view (data_value, data_value_size); } > > - ENUM_BITFIELD (call_site_parameter_kind) kind : 2; > + call_site_parameter_kind kind : 2; > > union call_site_parameter_u u; > > diff --git a/gdb/dwarf2/cooked-index-entry.h b/gdb/dwarf2/cooked-index-entry.h > index 9f7a7c42de4..60ea581cbbe 100644 > --- a/gdb/dwarf2/cooked-index-entry.h > +++ b/gdb/dwarf2/cooked-index-entry.h > @@ -267,7 +267,7 @@ struct cooked_index_entry : public allocate_on_obstack > situation where the language is initially unknown, and then only > filled in later. In particular this can happen when using > .gdb_index. See also cooked_index_functions::search. */ > - mutable ENUM_BITFIELD (language) lang : LANGUAGE_BITS; > + mutable language lang : LANGUAGE_BITS; > /* The offset of this DIE. */ > sect_offset die_offset; > /* The CU from which this entry originates. This may point to a > diff --git a/gdb/dwarf2/die.h b/gdb/dwarf2/die.h > index c5f8a8e89f1..a8bc147b1c8 100644 > --- a/gdb/dwarf2/die.h > +++ b/gdb/dwarf2/die.h > @@ -114,7 +114,7 @@ struct die_info > } > > /* DWARF-2 tag for this DIE. */ > - ENUM_BITFIELD(dwarf_tag) tag : 16; > + dwarf_tag tag : 16; > > /* Number of attributes */ > unsigned char num_attrs; > diff --git a/gdb/frame-id.h b/gdb/frame-id.h > index 50de31133a6..677b159b26b 100644 > --- a/gdb/frame-id.h > +++ b/gdb/frame-id.h > @@ -95,7 +95,7 @@ struct frame_id > CORE_ADDR special_addr; > > /* Flags to indicate the above fields have valid contents. */ > - ENUM_BITFIELD(frame_id_stack_status) stack_status : 3; > + frame_id_stack_status stack_status : 3; > unsigned int code_addr_p : 1; > unsigned int special_addr_p : 1; > > diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h > index b32056ce530..027b814fe6a 100644 > --- a/gdb/gdbtypes.h > +++ b/gdb/gdbtypes.h > @@ -756,7 +756,7 @@ struct field > > /* * Discriminant for union field_location. */ > > - ENUM_BITFIELD(field_loc_kind) m_loc_kind : 3; > + field_loc_kind m_loc_kind : 3; > > /* Accessibility of the field. */ > enum accessibility m_accessibility; > @@ -902,7 +902,7 @@ struct main_type > { > /* * Code for kind of type. */ > > - ENUM_BITFIELD(type_code) code : 8; > + type_code code : 8; > > /* * Flags about this type. These fields appear at this location > because they packs nicely here. See the TYPE_* macros for > @@ -942,11 +942,11 @@ struct main_type > /* * A discriminant telling us which field of the type_specific > union is being used for this type, if any. */ > > - ENUM_BITFIELD(type_specific_kind) type_specific_field : 3; > + type_specific_kind type_specific_field : 3; > > /* The language for this type. */ > > - ENUM_BITFIELD(language) m_lang : LANGUAGE_BITS; > + language m_lang : LANGUAGE_BITS; > > /* * Number of fields described for this type. This field appears > at this location because it packs nicely here. */ > @@ -1667,7 +1667,7 @@ struct fn_field > /* * DW_AT_defaulted attribute for this function. The value is one > of the DW_DEFAULTED constants. */ > > - ENUM_BITFIELD (dwarf_defaulted_attribute) defaulted : 2; > + dwarf_defaulted_attribute defaulted : 2; > > /* Accessibility of the field. */ > enum accessibility accessibility; > @@ -1745,7 +1745,7 @@ struct cplus_struct_type > DW_AT_calling_convention attribute. The value is one of the > DW_CC constants. */ > > - ENUM_BITFIELD (dwarf_calling_convention) calling_convention : 8; > + dwarf_calling_convention calling_convention : 8; > > /* * The base class which defined the virtual function table pointer. */ > > @@ -1821,7 +1821,7 @@ struct func_type > DW_AT_calling_convention attribute. The value is one of the > DW_CC constants. */ > > - ENUM_BITFIELD (dwarf_calling_convention) calling_convention : 8; > + dwarf_calling_convention calling_convention : 8; > > /* * Whether this function normally returns to its caller. It is > set from the DW_AT_noreturn attribute if set on the > diff --git a/gdb/macrotab.h b/gdb/macrotab.h > index 4e66c7ac915..1a4c46a1cb1 100644 > --- a/gdb/macrotab.h > +++ b/gdb/macrotab.h > @@ -291,7 +291,7 @@ struct macro_definition > struct macro_table *table; > > /* What kind of macro it is. */ > - ENUM_BITFIELD (macro_kind) kind : 1; > + macro_kind kind : 1; > > /* If `kind' is `macro_function_like', the number of arguments it > takes, and their names. The names, and the array of pointers to > diff --git a/gdb/symtab.h b/gdb/symtab.h > index 5a3db47d84f..0a7ad3668b4 100644 > --- a/gdb/symtab.h > +++ b/gdb/symtab.h > @@ -404,11 +404,11 @@ typedef bool (symbol_name_matcher_ftype) > struct partial_symbol > > These structures are laid out to encourage good packing. > - They use ENUM_BITFIELD and short int fields, and they order the > + They use bitfields and short int fields, and they order the > structure members so that fields less than a word are next > to each other so they can be packed together. */ > > -/* Rearranged: used ENUM_BITFIELD and rearranged field order in > +/* Rearranged: used bitfields and rearranged field order in > all the space critical structures (plus struct minimal_symbol). > Memory usage dropped from 99360768 bytes to 90001408 bytes. > I measured this with before-and-after tests of > @@ -586,7 +586,7 @@ struct general_symbol_info > This is used to select one of the fields from the language specific > union above. */ > > - ENUM_BITFIELD(language) m_language : LANGUAGE_BITS; > + enum language m_language : LANGUAGE_BITS; > > /* This is only used by Ada. If set, then the 'demangled_name' field > of language_specific is valid. Otherwise, the 'obstack' field is > @@ -815,7 +815,7 @@ struct minimal_symbol : public general_symbol_info > > /* Classification type for this minimal symbol. */ > > - ENUM_BITFIELD(minimal_symbol_type) m_type : MINSYM_TYPE_BITS; > + minimal_symbol_type m_type : MINSYM_TYPE_BITS; > > /* Non-zero if this symbol was created by gdb. > Such symbols do not appear in the output of "info var|fun". */ > @@ -1468,7 +1468,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack > > /* Domain code. */ > > - ENUM_BITFIELD(domain_enum) m_domain : SYMBOL_DOMAIN_BITS; > + domain_enum m_domain : SYMBOL_DOMAIN_BITS; > > /* Location class. This holds an index into the 'symbol_impls' > table. The actual location_class value is stored there, > @@ -1498,7 +1498,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack > > /* The concrete type of this symbol. */ > > - ENUM_BITFIELD (symbol_subclass_kind) subclass : 2; > + symbol_subclass_kind subclass : 2; > > /* Whether this symbol is artificial. */ > > diff --git a/gdbsupport/packed.h b/gdbsupport/packed.h > index 16564d5312e..70ffb712e19 100644 > --- a/gdbsupport/packed.h > +++ b/gdbsupport/packed.h > @@ -25,8 +25,8 @@ > defines a type that behaves like a given scalar type, but that has > byte alignment, and, may optionally have a smaller size than the > given scalar type. This is typically used as alternative to > - bit-fields (and ENUM_BITFIELD), when the fields must have separate > - memory locations to avoid data races. */ > + bit-fields, when the fields must have separate memory locations to > + avoid data races. */ > > /* There are two implementations here -- one standard compliant, using > a byte array for internal representation, and another that relies