This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Discrepancy between Python and Guile wrt exiting the interpreter


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]