From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id nI4rHSmCjGiifgEAWB0awg (envelope-from ) for ; Fri, 01 Aug 2025 05:00:25 -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=jOUIDHGp; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 65F511E102; Fri, 1 Aug 2025 05:00:25 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-10.1 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, 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 C16A51E089 for ; Fri, 1 Aug 2025 05:00:22 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DE66F3858C54 for ; Fri, 1 Aug 2025 09:00:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DE66F3858C54 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=jOUIDHGp 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 B66383858D1E for ; Fri, 1 Aug 2025 08:58:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B66383858D1E 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 B66383858D1E 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=1754038709; cv=none; b=V12JHLISB6ARjVaOY1kD5Y2U3MhaSFB2Xn6zeKOkaeH/3zy+T2NSfdST7WWjhI+SbPUAj5VnEiTYT2eEyYZXhjrOF+VNr2iiMoi2FglHu6SBY/uukpL5E8qb4clD7uRyIWZlVyZcLDYLLY3vVqYe0MqSAeCohzkHXXSFUSXuQjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1754038709; c=relaxed/simple; bh=G40fjl36+KM9Q8h9TxN/UVZswN/JH1h380xSiUUoiI8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=wd0AfX7wjNNhVfw9M779+U46zmukvnNRJouFCKpLXmCVPdx/4x43s145cGu+lVlQeK1e43NMno/GNyPzuGqzFNwjlM5Ct1pCPHqAOdjps/THVXX8QuAtWTf0U2X8MbZNcQ0acClNEsA282bcDKOy2rt3v+Mu0dB40CGdKtr+5ec= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B66383858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1754038709; 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=1J5sT1eA5FeY8y2UFr1yhVA7DOyNWJB/eSOsLv9wiqs=; b=jOUIDHGpNenaOePZHcU6DUjpZV+X2xvGiVaChLnVaabfwr1D9Uij+2Hme/APs/9KTyPoje BNZcGv/mfojGZ/LnFR7tJgye1rKjvxpqWcohSeC2lxUa3YPN1nvKBvYszoPr4d2AAUMhpy k2lBiSrqssVpZSxdlYl+cSAc4DJGGgc= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-179-Rfli8XDNNOGdlDn62T-D6w-1; Fri, 01 Aug 2025 04:58:28 -0400 X-MC-Unique: Rfli8XDNNOGdlDn62T-D6w-1 X-Mimecast-MFC-AGG-ID: Rfli8XDNNOGdlDn62T-D6w_1754038707 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-458a31421a3so6170005e9.0 for ; Fri, 01 Aug 2025 01:58:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754038706; x=1754643506; 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=1J5sT1eA5FeY8y2UFr1yhVA7DOyNWJB/eSOsLv9wiqs=; b=HAAELnKLsjjELC2qi8xLqXGPf5I4pg1PYj3uGE0YhbLEyCL7Fc6NV2/AnWSMDhvWkU mlmNHMQ30VkYHDg2vgVx9GQ9BR20jbSTDmCdjbQX2TzcfGGMzTtgCccbCGLEjfP72axu YbvAdF17JozmQi0PPVFqYTjcxLCIIHDiE5X904x3n2KLuk1T073vuISVvaftrGNKbJGG kJC+jN5NlimbdByp1qdRSgy18QjEi1OjMDWHo6UMoX7yGErIAEwdcgGcWsImQviN58z/ EmUxQLSazIWzJdNyZhfx6MgQNIHvm/5uSeONank2IC/jiTe/DX6KxKsEeq3WO2xCdBvN elOA== X-Gm-Message-State: AOJu0Yzw8Br3BOV2kxteTNw+X7fauNRY+7e4Gy/Tunwf6Y5eBbeqCcIc f4HCAsJf29FAp+80JpNW6+Rl6WhZ71rwhYsgh1jE8XlnHvJxxMDlzEdoe+jemPFpO2L078Kz/RO IDvrYOvmV/O0I0yUiAtle3JGUK+CocBlBMEp04dnaENJIeaAccP9gYOPqBJv0erPC+bbqRNDyPf uKZN8vfDmJ0M7cbuxcHgWdU/99PGFv5URABkCZUuyS/GzR8CM= X-Gm-Gg: ASbGnctsqNYbnKnL3eLLTavNQwE9sWtbBhDT+1j+tcfsobCqkI21IKdHvg0ZaCxRPnf 1OPUdTMVp1UdijRl0imq7MX97Cj0QctDeKA5gSONIHBpqomHQ6RP2Kbxw3nBmJIbxIV8Coqml3Y ftmhctULeqDlPHVqfLc6KH503QOxRqVkvVjbGyFHZBZfebB1XoFvJ5xJg9Yr95zzl9DNS88qNLO RMnJuyX3jxQ1UOi4p+OEE7tqv1hViR8bKEAm+XETk0PPsExnNoikeTWCkmMjV470YoKQdumLWDL Qwtk8URzfLgNXmvLjU+NKrrd302YOkfR1vCjJE2WXt2uTRQVqmuBwySBPsI= X-Received: by 2002:a05:600c:1f82:b0:456:207e:fd83 with SMTP id 5b1f17b1804b1-458aa31840emr13583055e9.4.1754038706470; Fri, 01 Aug 2025 01:58:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IET8ds0Fe6y26hptRXgVWLm2tJ57MrIMwUSLiRMHROPJMzHBgfCKk2/YgxhnNRgAlT5fiNtLg== X-Received: by 2002:a05:600c:1f82:b0:456:207e:fd83 with SMTP id 5b1f17b1804b1-458aa31840emr13582835e9.4.1754038705990; Fri, 01 Aug 2025 01:58:25 -0700 (PDT) Received: from localhost (27.81.93.209.dyn.plus.net. [209.93.81.27]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-458953cff16sm95767805e9.19.2025.08.01.01.58.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Aug 2025 01:58:25 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 0/7] Inline Function Optimised Code Debug Improvements Date: Fri, 1 Aug 2025 09:58:13 +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: GzxvWC7GKqG-PuRRZ0zvCFW_I0uyyA08cr357W4ifDY_1754038707 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 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/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 | 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 ++-- 21 files changed, 2344 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: c7c272f06d2d456d1d99762325fd0dd7db31d540 -- 2.47.1