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 C105E393BC17 for ; Fri, 23 Apr 2021 10:31:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C105E393BC17 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43176) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lZt5g-0003lb-Am; Fri, 23 Apr 2021 06:31:16 -0400 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1411 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lZt5e-0008Q5-I8; Fri, 23 Apr 2021 06:31:15 -0400 Date: Fri, 23 Apr 2021 13:31:06 +0300 Message-Id: <83lf99nvh1.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess Cc: gdb-patches@sourceware.org In-Reply-To: (message from Andrew Burgess on Thu, 22 Apr 2021 22:02:48 +0100) Subject: Re: [PATCH 7/7] gdb: startup commands to control Python extension language References: X-Spam-Status: No, score=1.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 10:31:18 -0000 > From: Andrew Burgess > Date: Thu, 22 Apr 2021 22:02:48 +0100 > > gdb/ChangeLog: > > * NEWS: Mention new commands. > * python/python.c (python_ignore_environment): New static global. > (show_python_ignore_environment): New function. > (set_python_ignore_environment): New function. > (python_dont_write_bytecode): New static global. > (show_python_dont_write_bytecode): New function. > (set_python_dont_write_bytecode): New function. > (_initialize_python): Register new commands. > > gdb/doc/ChangeLog: > > * python.texinfo (Python Commands): Mention new commands. > > gdb/testsuite/ChangeLog: > > * gdb.python/py-startup-opt.exp: New file. Thanks. The documentation parts are approved, provided that the few minor nits below are taken care of. > +@kindex set python ignore-environment > +@item set python ignore-environment @r{[}on@r{|}off@r{]} > +By default this option is @samp{off}, and, when @value{GDBN} > +initializes its internal Python interpreter, the Python interpreter > +will check the environment for variables that will effect how it > +behaves, for example @samp{PYTHONHOME}, and > +@samp{PYTHONPATH}@footnote{See the ENVIRONMENT VARIABLES section of > +@code{man 1 python} for a comprehensive list.}. Please use @env as markup for environment variables, not @samp. > +This option is equivalent to passing @samp{-E} to the real ^^^^^^^^^ @option{-E} > +@samp{python} executable. ^^^^^^^^^^^^^ @command{python} > +@kindex set python dont-write-bytecode > +@item set python dont-write-bytecode @r{[}auto@r{|}on@r{|}off@r{]} > +When this option is @samp{off}, then, once @value{GDBN} has > +initialized the Python interpreter, the interpreter will byte-compile > +any Python modules that it imports and write the byte code to disk in > +@code{.pyc} files. ^^^^^^^^^^^ @file{*.pyc} > +By default this option is set to @samp{auto}, in this mode Python will > +check the environment variable @samp{PYTHONDONTWRITEBYTECODE} to see ^^^^^ @env > +This option is equivalent to passing @samp{-B} to the real > +@samp{python} executable. @option and @command, as before.