From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id DF76A3858C39 for ; Sun, 30 Jun 2024 19:46:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF76A3858C39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DF76A3858C39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719776812; cv=none; b=eURpe5Z/MjRd9hiHCyHCyA0c0lwMI6RpVx7TEAeJrNZNA448b7xChieHu0DghzkKSilHB0lFK1c2tIxHOQQ1Esm5hERkKVLWUGNpusx1ZOQybK1ZFCaegjMRX8f62DzpncFDcP0ibqYt4/QWKurTzP6PDe8bjlDveP10jysB55g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719776812; c=relaxed/simple; bh=7LbM6LEA/vy2oXRe6DjkrQV5TXglvePmKulrWd6jL/U=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=OkDM4H/+9zVtIKf9efBINtgtfEF4jPEZ/96vDA2qci+JSJrkck61Hf/66mEMwW4fvxLjvAn7R4qmscfTkb6Sd6Lrf7SquIaZPw18hiVpaQhv7OFENNlsYBEUlVQiJ8x1sJMix3YS4fyprUDrCml7jZXDL7ZxZ9Vlq7oltHrdvOg= ARC-Authentication-Results: i=1; server2.sourceware.org From: Sam James To: Bernd Edlinger Cc: "gdb-patches@sourceware.org" , arsen@gentoo.org Subject: Re: [PATCH v2 0/3] Improve debugging of optimized code In-Reply-To: (Bernd Edlinger's message of "Fri, 28 Jun 2024 09:46:56 +0200") Organization: Gentoo References: Date: Sun, 30 Jun 2024 20:46:44 +0100 Message-ID: <87ikxqp61n.fsf@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Bernd Edlinger writes: > I've rebased and re-tested the following patches > which are trying to improve the debug experience of > optimized gcc code. This work was previously posted > quite some time ago here: > https://sourceware.org/pipermail/gdb-patches/2021-January/175617.html > > These patches improve the debug experience with optimized > gcc code significantly, as can be seen by the test cases. > The problem is that there are cases where an inline function > has line table entries at the end of the inline subrange, > and it is unclear by the dwarf-5 debug info if these line > table entries belong to the called inline function or to > the calling outer function, while there are at least some > corner cases where by stepping into these lines e.g. the > return value might be inspected. Also the call stack is > often displayed wrong because the line table entries > do not match with the block structure i.e. are obviously > not in the correct function. > > Therefore this patch series tries to improve the issue by > introducing a heuristic, that marks some of the line table > entries that happen to be at the exact end of an inline > function range as weak. This new line table flag can be > used to avoid to step into the inline function when a > step over was requested, and display the line belonging > to the correct function in the callstack. > > I'm sorry, that this solution has quite some complexity, > but I promise it is worth it. Please give this patch > a try and look for yourself how the debug experience is > improved in the test cases, and certainly also a number of > other programs, especially with C++, where inline functions > are pretty much used everywhere. I can't review this but I'm going to daily-drive it for a while and I'll let you know of any issues. It sounds rather exciting to say the least. thanks, sam > > > Bernd Edlinger (3): > Fix handling of DW_AT_entry_pc of inlined subroutines > Introduce a new line table flag is_weak > Fix range end handling of inlined subroutines > > gdb/block.c | 15 +- > gdb/buildsym.c | 106 ++++++++-- > gdb/buildsym.h | 3 + > gdb/dwarf2/read.c | 89 +++----- > gdb/infcmd.c | 3 +- > gdb/infrun.c | 30 ++- > gdb/jit.c | 1 + > gdb/symmisc.c | 6 +- > gdb/symtab.c | 17 +- > gdb/symtab.h | 5 + > gdb/testsuite/gdb.base/empty-inline.c | 39 ++++ > gdb/testsuite/gdb.base/empty-inline.exp | 56 +++++ > gdb/testsuite/gdb.cp/empty-inline.cc | 33 +++ > gdb/testsuite/gdb.cp/empty-inline.exp | 51 +++++ > gdb/testsuite/gdb.cp/step-and-next-inline.cc | 6 +- > gdb/testsuite/gdb.cp/step-and-next-inline.exp | 194 +++++++----------- > gdb/testsuite/gdb.dwarf2/dw2-ranges-base.exp | 2 +- > gdb/xcoffread.c | 1 + > 18 files changed, 444 insertions(+), 213 deletions(-) > create mode 100644 gdb/testsuite/gdb.base/empty-inline.c > create mode 100644 gdb/testsuite/gdb.base/empty-inline.exp > create mode 100644 gdb/testsuite/gdb.cp/empty-inline.cc > create mode 100644 gdb/testsuite/gdb.cp/empty-inline.exp