From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 2910F3858D37 for ; Sat, 16 Sep 2023 11:03:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2910F3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org 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 1qhT56-0001uJ-QD; Sat, 16 Sep 2023 07:03:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=vjFV6EOYPWEzW1AG5vLUF6IHEWuhA4XmHGfL0+WVEFU=; b=aPRmzz9vfsSF ar649KZ+vYkEUghTd+TwGYRxq1sdFsreeCUh8T498tI9qHW1TNpjMYAnDK+P0e1+QmLCFrP//7DGN Ew1oJXi9vIJakrV9uTM9EpbmcBnDoG1ESzD4fLys3o8ahRQMLzJaOypt3x3ygISn/xTa0wQGvk8uV HFz+h1OAiHaauaUGJrrq/YU9pe71dcF5iLcNYyZqsQaGIfUDIVQavYrdCesqCLptCu6fvyh5abXPg v7bfK1usVmL9t094EtP9KH0j9gwqIZQXM95J35J5N99Sob0SeBFPSIKMMRqg6hkWDsvzdKbvC84LJ XeAU4GuKbZwkX+j1ry1hdA==; Date: Sat, 16 Sep 2023 14:03:16 +0300 Message-Id: <838r96idmz.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess Cc: gdb-patches@sourceware.org In-Reply-To: (message from Andrew Burgess via Gdb-patches on Sat, 16 Sep 2023 11:18:09 +0100) Subject: Re: [PATCH 8/9] gdb/python: make the executable_changed event available from Python References: X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Sat, 16 Sep 2023 11:18:09 +0100 > From: Andrew Burgess via Gdb-patches > > gdb/NEWS | 5 ++ > gdb/doc/python.texi | 32 +++++++ > gdb/python/py-all-events.def | 1 + > gdb/python/py-event-types.def | 5 ++ > gdb/python/py-progspace.c | 54 ++++++++++++ > gdb/testsuite/gdb.python/py-exec-file.exp | 100 ++++++++++++++++++++++ > 6 files changed, 197 insertions(+) Thanks. > diff --git a/gdb/NEWS b/gdb/NEWS > index 93bc9c6a2c0..10975dbb27b 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -297,6 +297,11 @@ info main > exact string passed by the user to these commands; the path will > have been partially resolved to an absolute path. > > + ** A new executable_changed event registry is available. This event > + emits ExecutableChangedEvent objects, which have 'progspace' (a > + gdb.Progspace) and 'reload' (a Boolean) attributes. This event > + is emitted when gdb.Progspace.executable_filename changes. > + > *** Changes in GDB 13 This part is OK. > diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi > index 206cf6b4e18..9f7c7cb076a 100644 > --- a/gdb/doc/python.texi > +++ b/gdb/doc/python.texi > @@ -3893,6 +3893,38 @@ > The @code{gdb.TargetConnection} that is being removed. > @end defvar > > +@item events.executable_changed > +Emit @code{gdb.ExecutableChangedEvent} which indicates that the > +@code{gdb.Progspace.executable_filename} has changed. > + > +Changed can mean that either, the value in > +@code{gdb.Progspace.executable_filename} has changed to a new path, or > +the executable pointed to by @code{gdb.Progspace.executable_filename} > +has changed on disk, and @value{GDBN} has reloaded it. This reads awkwardly, and uses "path" when it means "file name". Suggest to rephrase: This event is emitted when either the value of @code{gdb.Progspace.executable_filename} has changed to name a different file, or the executable file named by @code{gdb.Progspace.executable_filename} has changed on disk, and @value{GDBN} has therefore reloaded it. > +@defvar ExecutableChangedEvent.progspace > +The @code{gdb.Progspace} in which the current executable has changed. > +The path to the updated executable will be visible in ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "The file name of the updated executable..." > +This attribute will be @code{True} if the value of > +@code{gdb.Progspace.executable_filename} didn't change, but the file > +pointed to instead changed on disk, and @value{GDBN} reloaded it. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "...but the file it names changed on disk instead, ...." > +When this attribute is @code{False}, the value in > +@code{gdb.Progspace.executable_filename} was changed to point to a new > +file. ^^^^^^^^^^^^^^^^^ ^^^^ "...to name a different file." > +Remember that @value{GDBN} tracks the executable file, and the symbol ^ That comma is redundant. Reviewed-By: Eli Zaretskii