From patchwork Mon Jan 29 18:37:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lancelot SIX X-Patchwork-Id: 84878 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1F1983857B93 for ; Mon, 29 Jan 2024 18:38:08 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2088.outbound.protection.outlook.com [40.107.102.88]) by sourceware.org (Postfix) with ESMTPS id 3C1F53858413 for ; Mon, 29 Jan 2024 18:37:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C1F53858413 Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3C1F53858413 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.102.88 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1706553462; cv=pass; b=VCc+tawEZJnPr370zvZUhnr6UWRD5rY1Deiu/gMFpuUaTarfMJiykZ5r6byZf+0M8zf2KUhD5vH1CAxPDEppDmuI0YENZM5V6tqN15RBqWrQc/kCJ7zZbHrgDXvZKt1OfoNVyc9l1aigBJIIH4bTbglBOK3i4y8JGj9Xhc3YSGI= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1706553462; c=relaxed/simple; bh=Q66LGrLd82c9qapPkGXYbiD8iBp7vuH1fb/zQnNDkC4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=IWZugRf3rmSPUQ8FcKLQEUEPpi0QVRCl6I/Y37rDqejFdjbxMa2l30F810kfccITePsFtw6W5QdqkjpVjMX95NRAQz8SVhuCjc+izI6Ca4DKi+mfOz3jquJNeAy2sJrdUx9+k9UOWIuKeiEOWYBHq8UBhdjzUQWfFxNhG7dRLwQ= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SsYCT/VD6UUr0eO4v2mjctUaN5vcWQ5QevlrBYP6IT2yEQSwm9M7MCSBxIu/S7mNLV/FcU6Z5wPppCBv5gSuiEemPZrTQRVotf9U1LohGEwqCPjznsTLoQBoV9bhARu6/qeTqb7P/Xgbx0Y7uHzJz8pp/sw71nMPY/3ahlS2p4kbLD4TsICx9Wk/IlqEydVOdsUN86FKa30j+r63qFICFrE8v0PCywph8hywQDkjPcDhpnocl6DKxsTmQz7AIuR5mLZCOlQT1gDTjm849gqQ/FmCwq16GOVH/8Yn5yVX87F7pjD0vTI3Gtw+CY3m7yJswnNC0d3kznepthcr+bsz2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dfG9nnYKJpASbN4JVwk/TMbugocsZIO0kFlF9VK1P8M=; b=H+9fyeumGKSrfjMP8AQEiVSU6ef58WxS4rMIGEASB1Mzj+7u/1lgppw93Vn3mXufVZ5mCLLrgwCo3YfBakoBzgVgP6mgrj4YD2c5z4mbi92eEYOX0SaKSkG85EiScatssC7zpWe4ozL8EglfWAyPA9aDJnKMqS17PW830NZpfq+8PdDqpcbut8nh+jTJ6gRQ6V5py6JsQ/g7YYWo4YxbbVabam25DQrhd8zPWzfvz8DMMJBhN1LCOvTqqRfAhf8OdKA50ttdVjZ22x5UAC6EvceFyeQP07MrGxLLT6Wy8/aXXUTiGUNt77FybQJZvCyTwKmuhVj4Oy23LCT1dFSXjA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dfG9nnYKJpASbN4JVwk/TMbugocsZIO0kFlF9VK1P8M=; b=r4YxkafImeBn19Tx0o6jxXzkOpIUvoyCEolk/LmbZLxyU5HxstQxXbPbXIk7PxkIQ/OB741kck00pmcL78OuHoudfW/aWLN3ctyHALxtQOFePdXEYJpi1Sx1yR69kkziedY55nVMIsemhMk5KKchK4BKC/a/XxH4hMMPaX1Kc3Y= Received: from PH0P220CA0021.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:d3::9) by IA0PR12MB9011.namprd12.prod.outlook.com (2603:10b6:208:488::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.32; Mon, 29 Jan 2024 18:37:33 +0000 Received: from SN1PEPF0002BA4B.namprd03.prod.outlook.com (2603:10b6:510:d3:cafe::f0) by PH0P220CA0021.outlook.office365.com (2603:10b6:510:d3::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.32 via Frontend Transport; Mon, 29 Jan 2024 18:37:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SN1PEPF0002BA4B.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Mon, 29 Jan 2024 18:37:33 +0000 Received: from khazad-dum.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Mon, 29 Jan 2024 12:37:31 -0600 From: Lancelot SIX To: CC: , , Lancelot SIX Subject: [PATCH] gdb: Use SYS_DOMAIN instead of DOMAIN when calling sym-domains.def Date: Mon, 29 Jan 2024 18:37:15 +0000 Message-ID: <20240129183715.761022-1-lancelot.six@amd.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002BA4B:EE_|IA0PR12MB9011:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b5d76f9-02f9-4c6e-c012-08dc20f95b6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rOGF0kw4ZIULBWTonTQUyfdvxBWvuWggBkKTDnuaejz7ztXvPMRhzGnGVb7gCzut2h8Qzl9smpnPviyGiQSAc8Ny77VxJC50DHuR9PhOmaY27byvt3hBVmlENIR17QWHic4SxLgDDfHVlNRqC7gTMfiHL0+cVyDOQJj/p1DQP8Te0Cv47BALu88G7O0jrq1tc+uAM5uZt5IjJPPfK7Y5OeJjxwRC8pLF01I6tYJDjV52tM5E39SyCu7pT2cerEp02RQazvpmdbD/20i4kTYljOtIWRjCpWELeeBmqyMXlhYzy2VJmWy/aC9iuYghsyMbZR8MWToZDp0vU4NfoT2FVbtunUOA53GFbSWBuqquJ9AAtHikoTrZQnGjweNhlEnuu9VMnqbjcvPYjf4IqT0MFvhXzpboPRs4UylRsx8/rZMz6cmwIkqmtUKTpfySpUjy9GYIgUXrY1Tl1YuTFxLOqkPIQznBV8ITjGD4DPsWD6JSgO+ulg2BdTCm9jrCYtP/KHFDO56pGarn5Fp6oVm6MFeo47c9ZDiM2+A0ah3DPfmJ6AiEDeiP3KzJXuS9QygFp5hC6boDkaBAf9loG6i0s2eCrzu9AiI6DGHfxntrtmvhcfu0rZcQ5pmryamJ5S3dVXqeSgc+seEftYOeCnWtHGorAKSqqEN4n38amOeSlQ7qhIZLDOMMRUrhsf05Q2+a3Qxaj5UHzHWttnVJzSFQfIQf43LJ3g9qPUIcW5T/wCVnZTRJGlosGMjwILG2dAsdYWOerfci3J5R+6l6qgZbZQ== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(136003)(346002)(376002)(396003)(39860400002)(230922051799003)(64100799003)(186009)(82310400011)(451199024)(1800799012)(46966006)(36840700001)(40470700004)(41300700001)(82740400003)(81166007)(356005)(40460700003)(40480700001)(36860700001)(47076005)(7696005)(70586007)(86362001)(316002)(54906003)(6916009)(8676002)(70206006)(8936002)(336012)(426003)(2616005)(5660300002)(26005)(478600001)(2906002)(4326008)(16526019)(6666004)(1076003)(36756003)(83380400001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2024 18:37:33.1876 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b5d76f9-02f9-4c6e-c012-08dc20f95b6b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002BA4B.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB9011 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_SPF_HELO, GIT_PATCH_0, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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+patchwork=sourceware.org@sourceware.org Since commit 6771fc6f1d9 "Use a .def file for domain_enum", the sym-domains.def file has been introduced, and requires the user to define the DOMAIN(x) macro. On older systems (centos-7 with glibc-1.17 for example), this DOMAIN macro conflicts with another macro defined in /usr/include/math.h. Fix this conflict by changing sym-domains.def to use a macro named SYM_DOMAIN instead of DOMAIN. Change-Id: I679df30e2bd2f4333343f16bbd2a3511a37550a3 --- gdb/guile/scm-symbol.c | 4 ++-- gdb/python/py-symbol.c | 4 ++-- gdb/sym-domains.def | 16 ++++++++-------- gdb/symtab.c | 16 ++++++++-------- gdb/symtab.h | 12 ++++++------ 5 files changed, 26 insertions(+), 26 deletions(-) base-commit: 1cb2b3dfd8992ced9e78a75cdfb4b9884c62185a diff --git a/gdb/guile/scm-symbol.c b/gdb/guile/scm-symbol.c index 7061ff58872..860ed522274 100644 --- a/gdb/guile/scm-symbol.c +++ b/gdb/guile/scm-symbol.c @@ -697,11 +697,11 @@ static const scheme_integer_constant symbol_integer_constants[] = X (LOC_REGPARM_ADDR), #undef X -#define DOMAIN(X) \ +#define SYM_DOMAIN(X) \ { "SYMBOL_" #X "_DOMAIN", to_scripting_domain (X ## _DOMAIN) }, \ { "SEARCH_" #X "_DOMAIN", to_scripting_domain (SEARCH_ ## X ## _DOMAIN) }, #include "sym-domains.def" -#undef DOMAIN +#undef SYM_DOMAIN /* Historical. */ { "SYMBOL_VARIABLES_DOMAIN", to_scripting_domain (SEARCH_VAR_DOMAIN) }, diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c index db8df891b29..1ebdf028a34 100644 --- a/gdb/python/py-symbol.c +++ b/gdb/python/py-symbol.c @@ -677,14 +677,14 @@ gdbpy_initialize_symbols (void) LOC_REGPARM_ADDR) < 0) return -1; -#define DOMAIN(X) \ +#define SYM_DOMAIN(X) \ if (PyModule_AddIntConstant (gdb_module, "SYMBOL_" #X "_DOMAIN", \ to_scripting_domain (X ## _DOMAIN)) < 0 \ || PyModule_AddIntConstant (gdb_module, "SEARCH_" #X "_DOMAIN", \ to_scripting_domain (SEARCH_ ## X ## _DOMAIN)) < 0) \ return -1; #include "sym-domains.def" -#undef DOMAIN +#undef SYM_DOMAIN return gdb_pymodule_addobject (gdb_module, "Symbol", (PyObject *) &symbol_object_type); diff --git a/gdb/sym-domains.def b/gdb/sym-domains.def index 7545631063b..dd5b1b6bc5a 100644 --- a/gdb/sym-domains.def +++ b/gdb/sym-domains.def @@ -21,38 +21,38 @@ none of the following apply. This usually indicates an error either in the symbol information or in gdb's handling of symbols. */ -DOMAIN (UNDEF) +SYM_DOMAIN (UNDEF) /* VAR_DOMAIN is the usual domain. In C, this contains variables, function names, typedef names and enum type values. */ -DOMAIN (VAR) +SYM_DOMAIN (VAR) /* STRUCT_DOMAIN is used in C to hold struct, union and enum type names. Thus, if `struct foo' is used in a C program, it produces a symbol named `foo' in the STRUCT_DOMAIN. */ -DOMAIN (STRUCT) +SYM_DOMAIN (STRUCT) /* MODULE_DOMAIN is used in Fortran to hold module type names. */ -DOMAIN (MODULE) +SYM_DOMAIN (MODULE) /* LABEL_DOMAIN may be used for names of labels (for gotos). */ -DOMAIN (LABEL) +SYM_DOMAIN (LABEL) /* Fortran common blocks. Their naming must be separate from VAR_DOMAIN. They also always use LOC_COMMON_BLOCK. */ -DOMAIN (COMMON_BLOCK) +SYM_DOMAIN (COMMON_BLOCK) /* TYPE_DOMAIN is for types and typedefs. Note that tags are not found here, see STRUCT_DOMAIN above. If a language does not have a tag namespace, then all types (including structures, etc) are here. */ -DOMAIN (TYPE) +SYM_DOMAIN (TYPE) /* FUNCTION_DOMAIN is for functions and methods. */ -DOMAIN (FUNCTION) +SYM_DOMAIN (FUNCTION) diff --git a/gdb/symtab.c b/gdb/symtab.c index 517e843244b..5221989e6f4 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -306,10 +306,10 @@ domain_name (domain_enum e) { switch (e) { -#define DOMAIN(X) \ +#define SYM_DOMAIN(X) \ case X ## _DOMAIN: return #X "_DOMAIN"; #include "sym-domains.def" -#undef DOMAIN +#undef SYM_DOMAIN default: gdb_assert_not_reached ("bad domain_enum"); } } @@ -320,10 +320,10 @@ std::string domain_name (domain_search_flags flags) { static constexpr domain_search_flags::string_mapping mapping[] = { -#define DOMAIN(X) \ +#define SYM_DOMAIN(X) \ MAP_ENUM_FLAG (SEARCH_ ## X ## _DOMAIN), #include "sym-domains.def" -#undef DOMAIN +#undef SYM_DOMAIN }; return flags.to_string (mapping); @@ -340,10 +340,10 @@ from_scripting_domain (int val) convert it to a search constant. */ switch (val) { -#define DOMAIN(X) \ +#define SYM_DOMAIN(X) \ case X ## _DOMAIN: break; #include "sym-domains.def" -#undef DOMAIN +#undef SYM_DOMAIN default: error (_("unrecognized domain constant")); } @@ -361,10 +361,10 @@ from_scripting_domain (int val) this. */ val &= ~SCRIPTING_SEARCH_FLAG; int check = val; -#define DOMAIN(X) \ +#define SYM_DOMAIN(X) \ check &= ~ (int) SEARCH_ ## X ## _DOMAIN; #include "sym-domains.def" -#undef DOMAIN +#undef SYM_DOMAIN if (check != 0) error (_("unrecognized domain constant")); return (domain_search_flag) val; diff --git a/gdb/symtab.h b/gdb/symtab.h index 3029f60cb4b..d43207ed70a 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -894,9 +894,9 @@ struct minimal_symbol : public general_symbol_info enum domain_enum { -#define DOMAIN(X) X ## _DOMAIN, +#define SYM_DOMAIN(X) X ## _DOMAIN, #include "sym-domains.def" -#undef DOMAIN +#undef SYM_DOMAIN }; /* The number of bits in a symbol used to represent the domain. */ @@ -909,19 +909,19 @@ extern const char *domain_name (domain_enum); let the search match multiple kinds of symbol. */ enum domain_search_flag { -#define DOMAIN(X) \ +#define SYM_DOMAIN(X) \ SEARCH_ ## X ## _DOMAIN = (1 << X ## _DOMAIN), #include "sym-domains.def" -#undef DOMAIN +#undef SYM_DOMAIN }; DEF_ENUM_FLAGS_TYPE (enum domain_search_flag, domain_search_flags); /* A convenience constant to search for any symbol. */ constexpr domain_search_flags SEARCH_ALL = ((domain_search_flags) 0 -#define DOMAIN(X) | SEARCH_ ## X ## _DOMAIN +#define SYM_DOMAIN(X) | SEARCH_ ## X ## _DOMAIN #include "sym-domains.def" -#undef DOMAIN +#undef SYM_DOMAIN ); /* A convenience define for "C-like" name lookups, matching variables,