This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Discrepancy between Python and Guile wrt exiting the interpreter
- From: Simon Marchi <simark at simark dot ca>
- To: Eli Zaretskii <eliz at gnu dot org>, gdb-patches at sourceware dot org
- Date: Sun, 19 Jan 2020 11:07:14 -0500
- Subject: Re: Discrepancy between Python and Guile wrt exiting the interpreter
- References: <83a76l10r6.fsf@gnu.org>
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