From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62900 invoked by alias); 19 Jan 2020 16:07:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 62892 invoked by uid 89); 19 Jan 2020 16:07:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=saying X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 19 Jan 2020 16:07:17 +0000 Received: from [10.0.0.11] (unknown [192.222.164.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 5C7131E573; Sun, 19 Jan 2020 11:07:15 -0500 (EST) Subject: Re: Discrepancy between Python and Guile wrt exiting the interpreter To: Eli Zaretskii , gdb-patches@sourceware.org References: <83a76l10r6.fsf@gnu.org> From: Simon Marchi Message-ID: Date: Sun, 19 Jan 2020 16:11:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <83a76l10r6.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2020-01/txt/msg00581.txt.bz2 On 2020-01-18 6:07 a.m., Eli Zaretskii wrote: > If you invoke the Guile interpreter from GDB: > > (gdb) gr > > then typing ,q followed by Enter exits the Guile interpreter back to > GDB. However, if the Python interpreter is started: > > (gdb) pi > > then typing quit() and Enter exits GDB, not just the Python > interpreter. Why do these two interpreters behave differently in this > context? Is there some other Python command to exit the interpreter? > (I know about Ctrl-D, but I'm asking about commands.) > > Thanks. > I looked into it, but didn't find a way to exit the Python interpreter and come back in GDB by typing a Python command. That command would somehow have to fool the Python interpreter in thinking that its input stream, which we pass here: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=gdb/python/python.c;h=d6f7f99c457300cba8e6dbe590ac15b4b2e2b110;hb=HEAD#l302 has reached EOF. I'm not saying it can't be done, just that I haven't found a way. Simon