From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by sourceware.org (Postfix) with ESMTPS id A50143851C04 for ; Fri, 21 Aug 2020 14:45:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A50143851C04 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wr1-f52.google.com with SMTP id a15so2168523wrh.10 for ; Fri, 21 Aug 2020 07:45:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=TdQqPMIyChJgrMfIm4a7Az8QAwljGpsHZXIJQUyoxA4=; b=XADrld3Z6M0vHfN6NLcbc4YQk2lr3orf357TT03IWFeNOKO6pRcwFT1uugOay8RMo3 5EBBeY1TUKI/6TR4Fo0dJWfricALirc6mZrJbkaU22GGCASs4f94NM8pf4SYp80Nx/sL EdKnjb8SKaB45QCRWfucPKkA2h5Phhlv3Sv7LIJJ9vkNBMMtv9uPZxMwxqnasZF5/+o9 yTJxHDvxyrJo6RnlkGGqOCU03CQ08Yl5l7dFWK3QUE/DYubwrF2M2HYOlgVXXuVeD4xS vLv3HVWRNBKgHWUYpkZMSpvIkZHMpUKUVzFkMp6B1EwiQIc5tE3STKnoFdNN/0PFrbso XdZg== X-Gm-Message-State: AOAM532PwoJpwW0O0eaIQr+GCR8WGYXEPyPvJyARgaVCAQxEM+FotP47 XTDzE150edLHV42wKOB4sysilvejr/cpCA== X-Google-Smtp-Source: ABdhPJxhCsDEfY9arMX/6CuLfsnkPv6kEYlJ5jHy0TiU1Nq8SF+Ya2EoOVF7VdTJtm9vpLlGGucYng== X-Received: by 2002:adf:92a1:: with SMTP id 30mr3302271wrn.56.1598021129032; Fri, 21 Aug 2020 07:45:29 -0700 (PDT) Received: from localhost ([2001:8a0:f905:5600:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id o124sm5084234wmb.2.2020.08.21.07.45.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 21 Aug 2020 07:45:28 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 0/3] Rewrite enum_flags, add unit tests, fix problems Date: Fri, 21 Aug 2020 15:45:20 +0100 Message-Id: <20200821144523.19451-1-pedro@palves.net> X-Mailer: git-send-email 2.14.5 X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2020 14:45:32 -0000 This is an update of a version of this series that I posted back in 2016: [PATCH 0/3] enum_flags: Fix problems and add comprehensive unit tests https://sourceware.org/legacy-ml/gdb-patches/2016-11/msg00079.html But I never followed thorough with it, leaving it collecting dust on my github. Over the following years, I polished it and tweaked it further and extended the unit tests, but never managed to re-submit it all upstream. Since the subject of enum_flags came up again this week, I thought I'd try it again. This is the result. Pedro Alves (3): Rewrite valid-expr.h's internals in terms of the detection idiom (C++17/N4502) Use type_instance_flags more throughout Rewrite enum_flags, add unit tests, fix problems gdb/Makefile.in | 1 + gdb/btrace.c | 4 +- gdb/compile/compile-c-types.c | 3 +- gdb/compile/compile-cplus-symbols.c | 4 +- gdb/compile/compile-cplus-types.c | 10 +- gdb/dwarf2/read.c | 7 +- gdb/eval.c | 2 +- gdb/gdbarch.c | 6 +- gdb/gdbarch.h | 12 +- gdb/gdbarch.sh | 8 +- gdb/gdbtypes.c | 58 ++-- gdb/gdbtypes.h | 15 +- gdb/go-exp.y | 2 +- gdb/record-btrace.c | 10 +- gdb/stabsread.c | 2 +- gdb/type-stack.c | 4 +- gdb/unittests/enum-flags-selftests.c | 586 +++++++++++++++++++++++++++++++++++ gdbsupport/enum-flags.h | 366 +++++++++++++++++----- gdbsupport/traits.h | 67 ++++ gdbsupport/valid-expr.h | 35 ++- 20 files changed, 1035 insertions(+), 167 deletions(-) create mode 100644 gdb/unittests/enum-flags-selftests.c base-commit: b70e516e89d95d06252cb04ded3397ec0a0a3212 -- 2.14.5