From patchwork Sat Jun 29 22:06:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Harmstone X-Patchwork-Id: 93075 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 F0B723810287 for ; Sat, 29 Jun 2024 22:07:36 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.burntcomma.com (mail.burntcomma.com [IPv6:2a02:8012:8cf0:250::6d61:696c]) by sourceware.org (Postfix) with ESMTPS id ED2DC389EC99 for ; Sat, 29 Jun 2024 22:07:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED2DC389EC99 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=harmstone.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=harmstone.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ED2DC389EC99 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a02:8012:8cf0:250::6d61:696c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719698824; cv=none; b=YxrR8Uq3pZfCB7v+6xLRCcdTnnMOTlp/E2C2ebIfLb7D0gx8bGV+PuMXOlg0IOCke/RR4c/sW9AQSx8jID0ymtpC2LHXQ2bcBG9aheRlcg3FHYFZjbhbbbvREuE4ZRzFwvp0VCnw7bA7eGkRdbnKjwntskzXhcmg5iIMjqTy54I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719698824; c=relaxed/simple; bh=g6Yv585tdeRegoC+HkjNdhyqWD6HW/lyq8C4G5KAkhg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:Mime-Version; b=Qw5rip62lb5Y0+T2fVm0hGGxRz8GuA/P0w0vH6TsfVNZm3c0YdyHLwqRZmmSjVYCcDQ8uuB20DirRXARwokXVp6ke/zQw5l7zu2OJMgKy7vrL4TCUI/4j7HuaXI6247YyCOhVKaTbCZICT/p4CuIAq8K5AZOx1kfq/Cpm0AkuzQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost.localdomain (beren.burntcomma.com [IPv6:2a02:8012:8cf0:0:b62e:99ff:fee9:ad9f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mail.burntcomma.com (Postfix) with ESMTPSA id 1D0C83DA80EC; Sat, 29 Jun 2024 23:07:02 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=harmstone.com; s=mail; t=1719698822; bh=V/6a7tUS5DY4Ya4HB7vE8ymz2Pox64IcD/EXO07931g=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xVY8dKnv/0Ap7u5Ajl0QL8Kh+laUikTJfi9UpmbqVREh+6cj+5SPfC2xX8m+ytBSc cYzLi1dIDRsfDhe8v/dLNr7CoMNzMSrPVvYAaR0DT9C/5cWMpP7pNjvhjU9MCOOu4W khMISM5bbc0waPtTHJKa0BlP2K1UchWMXc2VzcF8= From: Mark Harmstone To: gcc-patches@gcc.gnu.org Cc: Mark Harmstone Subject: [PATCH 2/5] Add CodeView enum cv_sym_type Date: Sat, 29 Jun 2024 23:06:50 +0100 Message-ID: <20240629220653.4445-2-mark@harmstone.com> In-Reply-To: <20240629220653.4445-1-mark@harmstone.com> References: <20240629220653.4445-1-mark@harmstone.com> Mime-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_STOCKGEN, SPF_HELO_NONE, SPF_PASS, TXREP 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Make everything more gdb-friendly by using an enum for symbol constants rather than #defines. gcc/ * dwarf2codeview.cc (S_LDATA32, S_GDATA32, S_COMPILE3): Undefine. (enum cv_sym_type): Define. (struct codeview_symbol): Use enum cv_sym_type. (write_codeview_symbols): Add default to switch. --- gcc/dwarf2codeview.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/gcc/dwarf2codeview.cc b/gcc/dwarf2codeview.cc index 5155aa70139..921d5f41e5a 100644 --- a/gcc/dwarf2codeview.cc +++ b/gcc/dwarf2codeview.cc @@ -46,10 +46,6 @@ along with GCC; see the file COPYING3. If not see #define CHKSUM_TYPE_MD5 1 -#define S_LDATA32 0x110c -#define S_GDATA32 0x110d -#define S_COMPILE3 0x113c - #define CV_CFL_80386 0x03 #define CV_CFL_X64 0xD0 @@ -70,6 +66,14 @@ along with GCC; see the file COPYING3. If not see #define HASH_SIZE 16 +/* This is enum SYM_ENUM_e in Microsoft's cvinfo.h. */ + +enum cv_sym_type { + S_LDATA32 = 0x110c, + S_GDATA32 = 0x110d, + S_COMPILE3 = 0x113c +}; + /* This is enum LEAF_ENUM_e in Microsoft's cvinfo.h. */ enum cv_leaf_type { @@ -168,7 +172,7 @@ struct codeview_function struct codeview_symbol { codeview_symbol *next; - uint16_t kind; + enum cv_sym_type kind; union { @@ -983,6 +987,8 @@ write_codeview_symbols (void) case S_GDATA32: write_data_symbol (sym); break; + default: + break; } free (sym);