From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ReZoH7kw8WgUNTkAWB0awg (envelope-from ) for ; Thu, 16 Oct 2025 13:51:53 -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=B9XILEV2; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 71B6E1E0BA; Thu, 16 Oct 2025 13:51:53 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 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_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED 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 94F021E047 for ; Thu, 16 Oct 2025 13:51:52 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1CB9B385842E for ; Thu, 16 Oct 2025 17:51:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CB9B385842E 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=B9XILEV2 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 EC6EF3858D1E for ; Thu, 16 Oct 2025 17:50:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EC6EF3858D1E 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 EC6EF3858D1E 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=1760637002; cv=none; b=g32zDo6TczEFyFgyQeD+aQdInt3/wnyBNLiy0k8xF9tZjhygzlUrO5mVQdZdRzYKliuL9Qgsvrii0C1ERfj+IaeuC7tdfsVJhNjEeWPYIZZQTDZyfM2BfVRjmVFjuSeHt/t4DgUqvcsEKH0rFJgedfLD7PW3dmfvcPvcxTMKCqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760637002; c=relaxed/simple; bh=fcmov+FoWhvzfBMIzFtywiOV2r9hkO7rHVe0QSUJItw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZDjs7O8J1J2ZIZbpf2dJ8tpgawwNTFU0VaKGGa2/06PIH6JvN7y6n5rzkx30NRpB1J2byOEIitcGrX5YXKxRZNKISnEbvBYgSXlgGl/mKMXBTatdBZt6mjCxdiOIS/gF0dqhyc9VLtnAXdTDp5rwmCcFnjGQ+KVI1vDsOjF5RaU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC6EF3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1760637001; 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: in-reply-to:in-reply-to:references:references; bh=J4ZwTyA6OPU/jhQWtVnOZHM+1miy9Jm5E4xNm4qAKFA=; b=B9XILEV2SgkTPqNUkDyPyYhsWAxa9xtRJWFWHEBQm4+MfiR784iq2uQ1ffstPJyimd4cKE f0cLArx9E6XXxjUabidCv8LLJ9oyusYSrPoHxLciTKt8kuIT/qoDcJ7MxnBi2VNLM8AiRP L6SQpiMGpILoPGHQBA0WPgHJbjl2zPg= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-635-TojISR5dOM2T61oe-yUIFQ-1; Thu, 16 Oct 2025 13:49:59 -0400 X-MC-Unique: TojISR5dOM2T61oe-yUIFQ-1 X-Mimecast-MFC-AGG-ID: TojISR5dOM2T61oe-yUIFQ_1760636998 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-46e47d14dceso8138825e9.2 for ; Thu, 16 Oct 2025 10:49:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760636997; x=1761241797; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J4ZwTyA6OPU/jhQWtVnOZHM+1miy9Jm5E4xNm4qAKFA=; b=KXEXjreGi7A438+IF5UO/z5OfEkREEFZv+QzowdjpDPpehZFCk1+ZB0tLY/t3NhVos ncXSWwRUxYSyKltOMayz1A+doeeiKKa2jNM8ulh5AumTQJF+EDR+rdPwO8+sD5Hly1rX PZb8Ayej4LUCpbQqS02LJA63NmTQvebmJoMAPW9Sp9sElLty5mJZQQ3LZCTMqq4uotsb GjQNrNPwCjVAuQSX8bjWwVsaoge7c0gt402xmPNEDV+Im4aaXe7e5HPOKIiasF4kaaUT RnY21XfUjsnsjUoOiH7FNmW3G2DGTKhIy6IXoQXyOW3ECR4GnkQF3Pcfp4ZK1zN/kwSU mwdA== X-Gm-Message-State: AOJu0Ywo/itGbW7/xSyvZhxADeEzaM+8AKOa3zbn2V8mHYAFIA+RszO7 LD2i3cJI6mhIgBCuUognGlrtwQXnHZ0Gwk0/Emxe6k5pGKOPi7lZJXSG+VZiS01wLQ8xn3+TnRx E33Lw3/lZXdI6w14c2LGEt43AIM/YSkMCgNsZtnsUjJbpsiov62URCLWmrOA2SetbXWXW9NjQXj C4E46AWYhLmbkDcZIGDRS6qoW5M5roUUSDYYcGIZA/NEW8F/c= X-Gm-Gg: ASbGncuBWxDH9gVa+pWCNpt67vMoaaHXd9jH4ybGefZvWHiJAg3lF+YbtNhupSsr+B6 MZKepcfq4RPCE/SKIuc4MIya5qzk97M053XkFBpH9cqOncsah9PSjliTYCV6e0fgh3F8UHTHbiM jO8PJIiXbdhxZuLY0YP7PrG/U9z2mg541mSjP4y3o0VIfst4mt+TaxUb8YMKPX0luDNfCKs47GF 6w+qc9xpmC7dw1Z1SqwhBXwxwD2F+3J7DmGLJ5PcP7g1oux+XEO3EKu31rSGlqYy4dDMApFOaTK vkUcWIM0ijQ5P5XEU0hFjiW1DO+eYrfeS0UzjenlU6F3ZJdyYyHOWSS3QKqpz/KeEClV6A== X-Received: by 2002:a05:600c:310e:b0:471:786:94d3 with SMTP id 5b1f17b1804b1-4711791185emr6492125e9.22.1760636997568; Thu, 16 Oct 2025 10:49:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEo/y3rs3ACol5tmIm/ncxTsqo5svszWljdfYLDsrYB7+JnVCHJE9uXp+dFUefD3ocn1wcyHw== X-Received: by 2002:a05:600c:310e:b0:471:786:94d3 with SMTP id 5b1f17b1804b1-4711791185emr6491945e9.22.1760636997081; Thu, 16 Oct 2025 10:49:57 -0700 (PDT) Received: from localhost ([31.111.84.207]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-471144b5c91sm38363125e9.11.2025.10.16.10.49.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Oct 2025 10:49:56 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv3 0/7] Inline Function Optimised Code Debug Improvements Date: Thu, 16 Oct 2025 18:49:46 +0100 Message-ID: X-Mailer: git-send-email 2.47.1 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: LuL4TOf7v4SOaxXcpb8NjulD0XAeqJYD_hVxrf4mTbQ_1760636998 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 In v3: - Rebased to current upstream HEAD. Resolved merged conflicts, and retested. - Reread all the patches, and updated / tweaked some of the comment and commit messages, but no changes to the code other than as required to fix merge conflicts. - Updated the tests to take account of changes to the DWARF assembler. In v2: - Fixes to the test added in patch (2) to address failures reported from Linaro CI. The issues all relate to compiling the DWARF assembler test with `-pie` which is on by default for the Linaro CI machines. The issues were all DWARF generation issues. - Rebased series to more recent upstream/master. --- 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/line-program.c | 120 +++- gdb/dwarf2/line-program.h | 25 +- gdb/dwarf2/read.c | 181 +++++- 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 | 262 ++++++++ .../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 ++-- 23 files changed, 2352 insertions(+), 225 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: b6753354fbbe7c2c66ae9f452ba7aa049db0fe0c -- 2.47.1