From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yHdoDIbDfGhHdSoAWB0awg (envelope-from ) for ; Sun, 20 Jul 2025 06:23:02 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=blbRkcYe; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 2A1011E11E; Sun, 20 Jul 2025 06:23:02 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_SBL_CSS,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 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 (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D7E121E0C2 for ; Sun, 20 Jul 2025 06:22:59 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 83DBB3858019 for ; Sun, 20 Jul 2025 10:22:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83DBB3858019 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=blbRkcYe Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 56D1C3858C48 for ; Sun, 20 Jul 2025 10:20:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 56D1C3858C48 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 56D1C3858C48 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1753006855; cv=none; b=MvM85pDQ/h/L+vQMTcAA+YtKlq4EZFzuRQr8+YzwNPpsZwaQkVkUNXACU6eEZf4epVrdG1yGuYE7ALoIMczq4rN0aa8qWaZV5/s2Yk+R7kwPCwBIoKrvwv8Jf4Tn2axp5/ionAZNolIT8sRFnFuwlmSHr2QD437DZChGYP9ys10= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1753006855; c=relaxed/simple; bh=coxbhmX1vKedqHewRCxB5WMr92aMFeZlh2EPkTfUYFs=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=MtRAXbGzZor8LeI0blBcinCFqgqBvFU/Y9xsftZLXOKjyeYHxw5V1gRlkHQbYSZIs8x7dHGKFub5NvcIaKgZmMPqjbbn6zBA+jZ4IhHYT6p+yGmMKSz+c5NyzYbetpI9/fepZtDe6sDba0YHKTurtKu1Kl0unEd8dXWYtwpe++8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 56D1C3858C48 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1753006855; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qe5KMsRvtyp7cEnD4u16HHnvsO28UopvV/n1bOAW2bc=; b=blbRkcYeUp7RdmRGLGoQmqXAAT23IdRL66XiBwWS7Ahmg8o+4Jx+C8KJ5ipDfn9goEh3ut X7LlmmM4Qfn5hOJyvWsa2lIUEhDDzs3mD98jaQVWnZnOk8KkvDWa/YnNM6i/KcFfuWldRp DK6BqXwk90mlgKvOeJrkJU5MdbswKc4= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-91-H8NVdbugPY64ZMaCkfko8A-1; Sun, 20 Jul 2025 06:20:53 -0400 X-MC-Unique: H8NVdbugPY64ZMaCkfko8A-1 X-Mimecast-MFC-AGG-ID: H8NVdbugPY64ZMaCkfko8A_1753006852 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4561dbbcc7eso12174045e9.2 for ; Sun, 20 Jul 2025 03:20:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753006852; x=1753611652; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qe5KMsRvtyp7cEnD4u16HHnvsO28UopvV/n1bOAW2bc=; b=b7PrFwytmW8bJm93ujTnTiJXiiFELXEDo0QLLr6vSoPT29AMOIARYxSaj2riJ/mudu C2uJ2Y0+feimIDsDMP8oOlbmeZan47Ba9tOQI6P9/4JG+zhoziN2HtIYtUa0y+n3jD8C BJbYAY3IwX0aiNN5e36iJvchory0ZGr0HPX4eGXJJRItSCnnBGVEzMp6jaj1cU/PKqeW 5jEw70GU79YNSsocppr7bvBOsusNbPiPN3DMGwJ3Agj3tk6dXmFyJymZAwErw2hdE+x1 iOejVqDFHpZD7hSqV9rupyLeGM++UqToAHtmiNxGeEzlELui8KEEOzLtYF23bLGLfsTR J7Mg== X-Gm-Message-State: AOJu0YwgzoRMQdjsLHPiwbesMtbAiGdU2fj8rPTlMvyb5+/9rt9q3r9N SO03rcAYVekH2k8kYpODUDlHcHTfKYt12hxZHG5fMKVnHH6ffo8TZWIs+lqldKE301xFYcsCTiJ nKQGHzv+uxt/yZ/QIJySEXs8+dA0m/EZVdXQZVXHiaMuoX/OQpDa4knkjn5QpBN9+LcwL6qZnZ6 MaWBNVALEjmmWRQBCdYnGK/N98VesBX7NE+U4OApQlNYMf4F8= X-Gm-Gg: ASbGnctmv0195onM2T/K2fhiYLQ0O2iyomvd5jaApA+hSEkS0kE2VW683+tWeXNPk41 PppM7Mn+E5t1PsXoL0tckhbkhLRcKWxgV/Rtct5exdTaDaYUFL97i5gVgXzQskXKdFPCzA1LM6g wP0frOitQpKSYED2JHZNqJPaZUrXQ4nrAfcwFl2a6IbaDSDRWhEdUsP4uD5rKFoi576JSM4fkmF O4hM0QYsQwtNH2bNcoMYkeWa9eo9WveA17WWTQMFm0DzGVqLyMS9ClCM8JKHqafsAjQGMbKWw0Z whH74ftmUdQA8Y9ULedc07RIzxcH4TsuMPAe9pMGnoaiEW8d6jEXUK6r8asTDw== X-Received: by 2002:a05:600c:a305:b0:453:8bc7:5e53 with SMTP id 5b1f17b1804b1-4562e853505mr137587585e9.0.1753006851818; Sun, 20 Jul 2025 03:20:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH87vA2MIb0vdpUkfT6G910o6NpDWjw3lSVQaBUvDD17hUrcw64lZK3pPElpS5KzcbYQvrv7A== X-Received: by 2002:a05:600c:a305:b0:453:8bc7:5e53 with SMTP id 5b1f17b1804b1-4562e853505mr137587405e9.0.1753006851289; Sun, 20 Jul 2025 03:20:51 -0700 (PDT) Received: from localhost (92.40.185.56.threembb.co.uk. [92.40.185.56]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b61ca2549asm7023859f8f.18.2025.07.20.03.20.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jul 2025 03:20:50 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 0/7] Inline Function Optimised Code Debug Improvements Date: Sun, 20 Jul 2025 11:20:39 +0100 Message-ID: X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: p9aXGUgejZoiPl2poaC_Mz7PfvLI-E2QTIg_FPMCCMQ_1753006852 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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~public-inbox=simark.ca@sourceware.org This series presents some improvements to debugging inline functions, especially in optimised code. The first two patches of this series have been posted previously here: https://inbox.sourceware.org/gdb-patches/cover.1736865029.git.aburgess@redhat.com This series replaces that earlier work, though the patches are basically unchanged. This entire series is an alternative solution to the patches that were posted here: https://inbox.sourceware.org/gdb-patches/AS1PR01MB946510286FBF2497A6F03E83E4922@AS1PR01MB9465.eurprd01.prod.exchangelabs.com/ My reasons for writing an alternative patch set can be found in the commit messages of patches (2) and (7), I'm not going to repeat them here. However, Bernd, the original patch author, did amazing work identifying the problems GDB was having, and these patches likely wouldn't exist without the original patch series, so a big thanks there. For reviewing, this series can be considered in 3 parts: + Patches (1) and (2) are independent from the rest of the series, though related in theme. Both these patches could be approved and merged ahead of remaining work, and do offer an improvement to GDB on their own. + Patches (3), (4), (5), and (6) are refactoring work to support the last patch. These can be reviewed, but shouldn't be merged until the last patch is approved. + Patch (7) covers the final parts of this work, which deal with non-empty inline functions. All thoughts and feedback are welcome. Thanks, Andrew --- Andrew Burgess (7): gdb: improve line number lookup around inline functions gdb: handle empty ranges for inline subroutines gdb: split dwarf line table parsing in two gdb: move block range recording into its own function gdb: create address map after parsing all DIE gdb: record block end addresses while parsing DIEs gdb: fix-up truncated inline function block ranges gdb/buildsym.c | 42 +- gdb/buildsym.h | 13 +- gdb/dwarf2/cu.h | 7 + gdb/dwarf2/read.c | 288 +++++++-- gdb/symtab.c | 25 +- gdb/testsuite/gdb.cp/step-and-next-inline.exp | 171 ++++-- .../gdb.dwarf2/dw2-empty-inline-low-high.c | 39 ++ .../gdb.dwarf2/dw2-empty-inline-low-high.exp | 128 ++++ .../gdb.dwarf2/dw2-empty-inline-ranges.c | 54 ++ .../gdb.dwarf2/dw2-empty-inline-ranges.exp | 260 ++++++++ .../gdb.dwarf2/dw2-extend-inline-block.c | 78 +++ .../gdb.dwarf2/dw2-extend-inline-block.exp | 574 ++++++++++++++++++ gdb/testsuite/gdb.dwarf2/dw2-inline-bt.c | 79 +++ gdb/testsuite/gdb.dwarf2/dw2-inline-bt.exp | 227 +++++++ .../gdb.dwarf2/dw2-unexpected-entry-pc.exp | 75 ++- gdb/testsuite/gdb.opt/empty-inline-cxx.cc | 65 ++ gdb/testsuite/gdb.opt/empty-inline-cxx.exp | 95 +++ gdb/testsuite/gdb.opt/empty-inline.c | 40 ++ gdb/testsuite/gdb.opt/empty-inline.exp | 130 ++++ gdb/testsuite/gdb.opt/inline-bt.c | 28 + gdb/testsuite/gdb.opt/inline-bt.exp | 119 ++-- 21 files changed, 2342 insertions(+), 195 deletions(-) create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-empty-inline-low-high.c create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-empty-inline-low-high.exp create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-empty-inline-ranges.c create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-empty-inline-ranges.exp create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-extend-inline-block.c create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-extend-inline-block.exp create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-inline-bt.c create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-inline-bt.exp create mode 100644 gdb/testsuite/gdb.opt/empty-inline-cxx.cc create mode 100644 gdb/testsuite/gdb.opt/empty-inline-cxx.exp create mode 100644 gdb/testsuite/gdb.opt/empty-inline.c create mode 100644 gdb/testsuite/gdb.opt/empty-inline.exp base-commit: cfbf9925c1c34f9e9d47c8b29d165866557663e3 -- 2.47.1