From patchwork Mon Apr 7 17:51:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 109998 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 CB40A3860769 for ; Mon, 7 Apr 2025 17:54:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB40A3860769 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=default header.b=tOTemm+R X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 64F853857C4F for ; Mon, 7 Apr 2025 17:52:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 64F853857C4F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 64F853857C4F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744048376; cv=none; b=dH5f7XFmQJsQbO5dC8pS+iJuZGcQLvEotY3cMM/lTUYI5JV+xHM7ztzFKGIyKyffArpLf5nF9vWYYfCKF/F4mvwtG4JDc6BB+1QiaxP+3yd1nKw0azcxmoHM+m87/L+SK5MDonyhvNF3m8XujusT6ZS7mOXQNIMvHAGbDgoF+i4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744048376; c=relaxed/simple; bh=Kj0us8EFfonto/+KHplnbYnFfpxZ5mZI9fqfHD1WNmM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=MNxHjBaeJdalce6PDlsmxMwBWd+3YBnyG9zMfOWdVl8rAEAm0IQbFSPz/F7dZ+1TIEm1pSL9oPFHOLguAjhsvVDW/MuN56yXi5diL73lFqktSbTiF9MaNNjEuTcBdnx2JFsSJa8sLtUJzrz2/0YhZR22Gz2dvUIZGZ1ROzTlj+Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 64F853857C4F Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 537Hqp1A218487 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 7 Apr 2025 13:52:55 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 537Hqp1A218487 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1744048376; bh=Wcypm0J5vNSFxrfvGoDDEwip/mHXEFWTyHxj2fO2Uos=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=tOTemm+R26z6lh6zCVyX/5wzlMJqPZpzuk+GMjzzBwXtNNVK9O3fUASZXRV5arZi0 wMBulrDJ+9VqK+DD4jP8fhya3w9Ga58mzbN95tP1BbHJoN52epyO5mpZTy5IXxdZjr GnLXo+E3FH/Tnt99gSYuDzjEf6O2CyBUhZXeZQcc= Received: by simark.ca (Postfix, from userid 112) id 2F7E91E11E; Mon, 7 Apr 2025 13:52:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-Spam-Level: X-Spam-Status: No, score=-3187.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 Received: from simark.localdomain (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (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 ESMTPSA id A92E31E0C2; Mon, 7 Apr 2025 13:52:48 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 1/4] gdb/testsuite: add DWARF 5 + split DWARF + type units board Date: Mon, 7 Apr 2025 13:51:58 -0400 Message-ID: <20250407175247.3312551-2-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250407175247.3312551-1-simon.marchi@polymtl.ca> References: <20250407175247.3312551-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 7 Apr 2025 17:52:51 +0000 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 From: Simon Marchi I'm currently fixing bugs and performance issues when GDB encounters this particular configuration. Since split DWARF + type units makes GDB take some code paths not taken by any other board files, I think it deserves to be its own board file. One particularity is that the produced .dwo files have a .debug_info.dwo section that contains some ype units, in addition to the compile unit. Add that board to make-check-all.sh. Change-Id: I245e6f600055a27e0c31f1a4a9af1f68292fe18c --- .../boards/dwarf5-fission-debug-types.exp | 33 +++++++++++++++++++ gdb/testsuite/make-check-all.sh | 1 + 2 files changed, 34 insertions(+) create mode 100644 gdb/testsuite/boards/dwarf5-fission-debug-types.exp diff --git a/gdb/testsuite/boards/dwarf5-fission-debug-types.exp b/gdb/testsuite/boards/dwarf5-fission-debug-types.exp new file mode 100644 index 000000000000..189a5911d9cd --- /dev/null +++ b/gdb/testsuite/boards/dwarf5-fission-debug-types.exp @@ -0,0 +1,33 @@ +# Copyright 2025 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# A board that compiles with DWARF 5, split DWARF (fission) and type units. +# This results in .dwo files containing one compilation unit and (possibly) +# multiple type units each. + +# This is copied from baseboards/unix.exp. +# At the moment this only supports things that unix.exp supports. +load_generic_config "unix" +process_multilib_options "" +set_board_info compiler "[find_gcc]" + +set_board_info debug_flags \ + [join { "-gdwarf-5" \ + "-gsplit-dwarf" \ + "-fdebug-types-section" }] + +# This is needed otherwise dejagnu tries to rsh to host with the board name +# as its hostname. +load_board_description "local-board" diff --git a/gdb/testsuite/make-check-all.sh b/gdb/testsuite/make-check-all.sh index 28a89b6b15b6..df4319908750 100755 --- a/gdb/testsuite/make-check-all.sh +++ b/gdb/testsuite/make-check-all.sh @@ -74,6 +74,7 @@ target_boards=( cc-with-gnu-debuglink debug-types dwarf4-gdb-index + dwarf5-fission-debug-types dwarf64 fission fission-dwp From patchwork Mon Apr 7 17:51:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 110000 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 D5D033860769 for ; Mon, 7 Apr 2025 17:59:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5D033860769 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=default header.b=HiZa0ZYw X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id EC034385C6EC for ; Mon, 7 Apr 2025 17:58:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC034385C6EC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EC034385C6EC Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744048702; cv=none; b=BQTpBVG5j3ToLq/r53ItGTwAr/zBoeSaJoEwgmhX438QkGvMsuHYKdyQ35BNsCmOr9DEpTwG/EOJwRg8/WCUOZovbPFaUMDQMCgY28EltCJOJm4NPCm1IiZ827rLKlgalN7HlLIUp91DS1MRNkTKEb0czX1PZuZbGWxZ2I7ywVA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744048702; c=relaxed/simple; bh=qob/h6pf0mkgxNMgDjHJw3ETgcMbIb8av5UIjGmKeC0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=DhLxApAt7FQ3eF5xCN6UCfcY74Lkw1UTKb/V+n0N0OGi0feZkn2IRyHruQFza4CjgzFJWocUi4tWPNNuEGBu9vnIivPvUTRcvuGZ4FRZCT9qZ6XgeIYDUYkbmUzM+qiF6JbHnW2SS6YMFaqyYKBCYABfoSyhcCh27qnh0uw+1e8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC034385C6EC Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 537HwG90220466 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 7 Apr 2025 13:58:21 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 537HwG90220466 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1744048701; bh=OJ4o/H8lIz7v6Vs71ckh88+hYWpMxT+gIj2XfZ5G6oM=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=HiZa0ZYw4wSrL3RJUA4T1SK+lPhaunHCFyVOnTijdriEHAd3TahisROlMFUrma1e9 +JTFYrlxAa6vhf3lkIOP7LZila49BOJJQMvV0QeeYL9+vHwGtLSueKefGSW9yiDqw3 +8MvD9Fi0Q+VXt3XGJTQo31C30arXBNSW8FJ4ZgQ= Received: by simark.ca (Postfix, from userid 112) id C1ED71E126; Mon, 7 Apr 2025 13:52:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-Spam-Level: X-Spam-Status: No, score=-3187.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 Received: from simark.localdomain (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (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 ESMTPSA id C48611E0C3; Mon, 7 Apr 2025 13:52:48 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 2/4] gdb/testsuite/dwarf: add support to generate DWARF 5 split compile units Date: Mon, 7 Apr 2025 13:51:59 -0400 Message-ID: <20250407175247.3312551-3-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250407175247.3312551-1-simon.marchi@polymtl.ca> References: <20250407175247.3312551-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 7 Apr 2025 17:58:16 +0000 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 From: Simon Marchi Add support to the DWARF assembler to generate DWARF 5 split compile units. The assembler knows how to generate DWARF < 5 split compile units (fission), DWARF 5 compile units, but not DWARF 5 split compile units. What's missing is: - using the right unit type in the header: skeleton for the unit in the main file and split_compile for the unit in the DWO file - have a way for the caller to specify the DWO ID that will end up in the unit header Add a dwo_id parameter to the cu proc. In addition to specifying the DWO ID, the presence of this parameter tells the assembler to use the skeleton or split_compile unit type. This is used in a subsequent patch. Change-Id: I05d9b189a0843ea6c2771b1d5e5a91762426dea9 --- gdb/testsuite/lib/dwarf.exp | 48 ++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index 7dcf13f2ce7b..308ab852bd15 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -1441,6 +1441,17 @@ namespace eval Dwarf { # default = default # fission 0|1 - boolean indicating if generating Fission debug info # default = 0 + # dwo_id - The value to use as the dwo_id field of skeleton and + # split_compile unit headers. May only be used with DWARF + # version 5. + # + # If a dwo_id value is specified (is non-zero), this unit is + # assumed to be part of a skeleton/split_unit pair. The unit + # type will be chosen according to the `fission` value. + # + # When using DWARF version 5 and fission is non-zero, it is + # mandatory to provide a non-zero dwo_id value. + # default = 0 # label