From patchwork Tue Jun 18 00:17:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Harmstone X-Patchwork-Id: 1948904 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=harmstone.com header.i=@harmstone.com header.a=rsa-sha256 header.s=mail header.b=xOSPXA+w; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W36mc580Vz20Wb for ; Tue, 18 Jun 2024 10:18:40 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 98F193882117 for ; Tue, 18 Jun 2024 00:18:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.burntcomma.com (mail2.burntcomma.com [217.169.27.34]) by sourceware.org (Postfix) with ESMTPS id B66673882050 for ; Tue, 18 Jun 2024 00:17:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B66673882050 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 B66673882050 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.169.27.34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718669861; cv=none; b=x+ImKHBCxvsJaZ+8wD3cNWKkxsh40TWNyGCZByzFoc+AlaZkRKxzzp1+rz9A3nET3D6eWUvIBvUPj4/twzyrg897Ctf/e+pI3BMa+9+MneLN+nvBzmokwM/xp/KleYFYOjYDl8yKl6UYB8KQbTiaCmS6BUHcXP7MOja/hhAVF2c= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718669861; c=relaxed/simple; bh=C4+7YicXKELuClCUD5+7ghJRYGr4L7TUjbwkmML9LAY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:Mime-Version; b=pFhOIfzYYMs1jAuCO2Yfq8cwTm74QLyjRLvUGjqap1WYtqz37PSHlYpKL+c8v2j7UFSX8JYl7b+l4F1mvlzyJwKyFvK6c7FLlKOiVAj7qBS5vlJBkt2vIxU5D+VTT+oPvIX3YBAh3D0njINwZHFbyBGy3Ud49eDNmBKecVxLnU0= 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 197813CF000B; Tue, 18 Jun 2024 01:17:21 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=harmstone.com; s=mail; t=1718669841; bh=IOsPwhqovgXlp4Jto8I0eQn8lDbGwggbUuqbtwhLjcA=; h=From:To:Cc:Subject:Date; b=xOSPXA+w0CyZNWbycv0t/76sBN1qD0iLOJB4TbxExChHbaLyRrxboGQwF9LqpF8rO xw+jfsmeTpW4bHqK2AixndWFK00c1PRtRifuFqWpX0Kbq0uwkb+Uyj7Yhk5lFv3Vb1 FIFBdlNwkGaLC//y6Qk7GbdQBlo7aua5GOYD3eXI= From: Mark Harmstone To: gcc-patches@gcc.gnu.org Cc: Mark Harmstone Subject: [PATCH 00/11] CodeView variables and type system Date: Tue, 18 Jun 2024 01:17:02 +0100 Message-ID: <20240618001713.24034-1-mark@harmstone.com> Mime-Version: 1.0 X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_EXEURI, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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+incoming=patchwork.ozlabs.org@gcc.gnu.org This patch series adds support for outputting global variables when the -gcodeview option is provided, along with the type system to go along with this. As with previous patches, the best way to see the output is run Microsoft's cvdump.exe against the object file: https://github.com/microsoft/microsoft-pdb/raw/master/cvdump/cvdump.exe You'll also need a recentish version of binutils in order to get ld to output an actual PDB file that can be read by MSVC or windbg. This ought to be fairly complete as far as C is concerned. Still to come are functions, local variables, and some C++ things. Mark Harmstone (11): Output CodeView data about variables Handle CodeView base types Handle typedefs for CodeView Handle pointers for CodeView Handle const and varible modifiers for CodeView Handle enums for CodeView Handle structs and classes for CodeView Handle unions for CodeView. Handle arrays for CodeView Handle bitfields for CodeView Handle subroutine types in CodeView gcc/dwarf2codeview.cc | 2278 ++++++++++++++++++++++++++++++++++++++++- gcc/dwarf2codeview.h | 67 ++ gcc/dwarf2out.cc | 5 + 3 files changed, 2341 insertions(+), 9 deletions(-)