From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ailzIhwqVmoCvwcAWB0awg (envelope-from ) for ; Tue, 14 Jul 2026 08:22:52 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=nTX6N9if; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7D2F41E033; Tue, 14 Jul 2026 08:22:52 -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.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 autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (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 CED7A1E033 for ; Tue, 14 Jul 2026 08:22:51 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 92C974BA2E19 for ; Tue, 14 Jul 2026 12:22:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92C974BA2E19 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=nTX6N9if Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 93BBD4BA2E05 for ; Tue, 14 Jul 2026 12:22:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 93BBD4BA2E05 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 93BBD4BA2E05 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784031747; cv=none; b=gejWSwVSR2fGzEEELr6LobF52zgapSGPBy94FcvKBf5h8hF1BxiDBu5xSzEj3P+rFWG0BB7lRMzaJcFUpCRs8X3UnyqCrbkHuQ0GNBBdYsR0gqiaHCanRckjZkioqpj3vmE+HHgBcKMSJS0n7StAeXmhnLbkr7nYoPT/RkMvSKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784031747; c=relaxed/simple; bh=vjP8NCfR0wQ3J/UnZMzlr/QAokqBZJpMuGz6YT7tyAg=; h=DKIM-Signature:Date:Message-Id:From:To:Subject:MIME-version; b=wwHJZyupX9nfPJj7lcsUgh5BFvh/yc3alj41uUjh6gxbsoZwwv9wOymCWfwSTPyHPKYFHXoRLNCnOedlip/9QSF+VbSl6oOF3KVxQko8LhosNqbQXQO/W2M8ntM/aYXVvVFwEKEzQT7AP72X4QriwCOjD/yR2u4BS8vWvxpELgQ= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=nTX6N9if DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 93BBD4BA2E05 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wjc9b-0003vh-3p; Tue, 14 Jul 2026 08:22:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=p5zoRDRYAaczHXBjAI7g/ZA+cYemCjZUYOIlzr1kwOI=; b=nTX6N9if7kyGzGGlmVEL nHK7YJFAmB2zoAmnldyCmVv79iwYmu9JEIIayj6uh9+vqm8gZedbmfvZTSygLNYhx0C67ehUT6Lgu 1uib5xLj1ZHwSlx4cQitp9RRWl9BU2g4W8lEQ0yaPT4LESVqlEHMxAmlBb8PtgFSvCMDfQTw0sxQy JFs+DSpNmJh8YJnlI4HuKahVeX35tWMllKs6X5Sk/eYABIAN+6wQ8qLAe4yn1wjNBNAbzgW0l83q+ Pj8ZMEmGcBXV0OVasVYWsA7yisgpYczTC9wXfdLNqECbDuVSx3Mb/yWMIJOSQlgER88nE49EZrLla ZIai2ojp59tslA==; Date: Tue, 14 Jul 2026 15:22:24 +0300 Message-Id: <868q7dg3r3.fsf@gnu.org> From: Eli Zaretskii To: Alexandra =?utf-8?B?SMOhamtvdsOh?= Cc: gdb-patches@sourceware.org In-Reply-To: <20260714094241.178097-1-ahajkova@redhat.com> (message from Alexandra =?utf-8?B?SMOhamtvdsOh?= on Tue, 14 Jul 2026 11:40:52 +0200) Subject: Re: [PATCH v8] gdb: Add source-tracking breakpoints feature References: <20260714094241.178097-1-ahajkova@redhat.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 > From: Alexandra Hájková > Cc: ahajkova@redhat.com > Date: Tue, 14 Jul 2026 11:40:52 +0200 > > > gdb/NEWS | 14 + > gdb/breakpoint.c | 487 ++++++++++++++++++ > gdb/breakpoint.h | 16 +- > gdb/doc/gdb.texinfo | 45 ++ > .../gdb.base/adjust_breakpoint-2.cpp | 39 ++ > .../gdb.base/adjust_breakpoint-3.cpp | 41 ++ > .../gdb.base/adjust_breakpoint-4.cpp | 37 ++ > .../adjust_breakpoint-missing-source.exp | 55 ++ > gdb/testsuite/gdb.base/adjust_breakpoint.cpp | 40 ++ > gdb/testsuite/gdb.base/adjust_breakpoint.exp | 168 ++++++ > .../gdb.base/source-tracking-inline-1.c | 50 ++ > .../gdb.base/source-tracking-inline-2.c | 49 ++ > .../gdb.base/source-tracking-inline.exp | 80 +++ > gdb/testsuite/gdb.base/test_source_tracking.c | 18 + > .../gdb.base/test_source_tracking.exp | 43 ++ > 15 files changed, 1181 insertions(+), 1 deletion(-) > create mode 100644 gdb/testsuite/gdb.base/adjust_breakpoint-2.cpp > create mode 100644 gdb/testsuite/gdb.base/adjust_breakpoint-3.cpp > create mode 100644 gdb/testsuite/gdb.base/adjust_breakpoint-4.cpp > create mode 100644 gdb/testsuite/gdb.base/adjust_breakpoint-missing-source.exp > create mode 100644 gdb/testsuite/gdb.base/adjust_breakpoint.cpp > create mode 100644 gdb/testsuite/gdb.base/adjust_breakpoint.exp > create mode 100644 gdb/testsuite/gdb.base/source-tracking-inline-1.c > create mode 100644 gdb/testsuite/gdb.base/source-tracking-inline-2.c > create mode 100644 gdb/testsuite/gdb.base/source-tracking-inline.exp > create mode 100644 gdb/testsuite/gdb.base/test_source_tracking.c > create mode 100644 gdb/testsuite/gdb.base/test_source_tracking.exp Thanks. > diff --git a/gdb/NEWS b/gdb/NEWS > index ec9b5a33787..553d8c49ff6 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -6,6 +6,13 @@ > * Support for the Common Trace Format (CTF) has been removed. GDB now > saves trace information exclusively in its own "tfile" format. > > +* GDB now supports source-tracking breakpoints, which automatically > + adjust their location when source code changes between rebuilds. > + When enabled, file and line breakpoints capture the surrounding > + source code context and use it to adjust the breakpoint line if the > + source is modified. Source tracking can be enabled with 'set > + breakpoint source-tracking enabled on'. This part is okay, but is this feature available in all builds of GDB? For example, is the availability of the 'compile' command or being able to rebuild the program while the GDB session is active necessary for this to work? If there are preconditions, we should mention them, so users won't expect this to work where it isn't supported. > +set breakpoint source-tracking enabled [on|off] > +show breakpoint source-tracking enabled > + Enable or disable source-tracking for file and line breakpoints. > + When enabled, breakpoints capture surrounding source code and > + automatically adjust their location when the source changes between > + recompilations. Why aren't the maintenance commands you add called out in NEWS? > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index a698b2b8451..d304f885def 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo This part is okay. Reviewed-By: Eli Zaretskii