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 C5BA7385771C for ; Tue, 9 May 2023 16:14:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C5BA7385771C 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 1pwPyn-0003RC-Ae; Tue, 09 May 2023 12:14:21 -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=T1FJxOyNb6Duxes85zPZX46KtkEGO2R9IGM0UrftATU=; b=GajZ4Fhd6w8p 0eaf9wMaKazY6gqpteBeBK5iWD/36t/w6w8rSxkuRF0A5H8b0Imxsmi/BHULUEXX+Efblg8JTmS4T XVY0HvD1xYUv1jOWiJsyCM55TvyU5pIxg/AeX5lHlF/jL6zdGro+edBMQlWu+RwHljeqNF+PJbdV5 TMN0IHAVQzhShFBpyYs+e3k9pR1qBn9j1buEeGbqYMTZaxso+p04ca9fYHXWVcCmO5+Ou0bBqAWAU 9fquI0svo+lz5R7LY8ezuYcqDRMo4gXsFp3ut7UduoWObSSr3OcBS+ux+5L9TkEkh1HKrlAROzEaV P7+FvRGeqwfzS4MPp3oQxA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pwPym-0000pT-Pf; Tue, 09 May 2023 12:14:21 -0400 Date: Tue, 09 May 2023 19:15:23 +0300 Message-Id: <83y1lxa3c4.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey Cc: gdb-patches@sourceware.org In-Reply-To: <20230509-dap-args-v1-1-16b5f0aa5cd6@adacore.com> (message from Tom Tromey via Gdb-patches on Tue, 09 May 2023 10:01:59 -0600) Subject: Re: [PATCH 1/2] Add attributes and methods to gdb.Inferior References: <20230509-dap-args-v1-0-16b5f0aa5cd6@adacore.com> <20230509-dap-args-v1-1-16b5f0aa5cd6@adacore.com> X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Date: Tue, 09 May 2023 10:01:59 -0600 > From: Tom Tromey via Gdb-patches > > This adds two new attributes and three new methods to gdb.Inferior. > > The attributes let Python code see the command-line arguments and the > name of "main". Argument setting is also supported. > > The methods let Python code manipulate the inferior's environment > variables. > --- > gdb/NEWS | 10 ++ > gdb/doc/python.texi | 43 ++++++++ > gdb/python/py-inferior.c | 168 +++++++++++++++++++++++++++++++ > gdb/testsuite/gdb.ada/py_range.exp | 4 + > gdb/testsuite/gdb.python/py-inferior.exp | 36 +++++++ > 5 files changed, 261 insertions(+) Thanks. > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -170,6 +170,16 @@ info main > (program-counter) values, and can be used as the frame-id when > calling gdb.PendingFrame.create_unwind_info. > > + ** gdb.Inferior now has a new "arguments" attribute. This holds the > + command-line arguments to the inferior, if known. > + > + ** gdb.Inferior now has a new "main_name" attribute. This holds the > + name of the inferior's "main", if known. > + > + ** gdb.Inferior now has new methods "clear_env", "set_env", and > + "unset_env". These can be used to modify the inferior's > + environment before it is started. > + > *** Changes in GDB 13 This part is OK. > +The environment that will be passed to the inferior can be changed > +from Python. These methods only take effect when the inferior is "These methods" seems to allude to something that was described before, but there's nothing. So I would suggest either The methods described below only take effect when... or The environment that will be passed to the inferior can be changed from Python by using the following methods. These methods only take effect when... Reviewed-By: Eli Zaretskii