Make the "python" command resemble the standard Python interpreter
Khoo Yit Phang
khooyp@cs.umd.edu
Thu Jan 12 16:52:00 GMT 2012
Hi,
On Jan 12, 2012, at 11:40 AM, Doug Evans wrote:
> There already is an established behaviour for python without arguments
> (with or without a terminal).
>
> (gdb) python
>> print 1 + 2
>> end
> 3
> (gdb)
>
> I've read the thread and I don't seen anyone raising this issue (could
> have missed it though. I saw Tom's message re: what output CLI will
> generate, but this is about behaviour).
> I've read the patch and I don't think using from_tty is ok to select
> between the different behaviours.
Can you explain why?
> Can we pick a different way of invoking the python interpreter?
I had suggested in my original patch to use PyRun_FileExFlags when from_tty is false, which is how the Python interpreter picks the different behavior (Py_Main), so both from_tty and not from_tty would resemble Python. This would also eliminate the need for handling python in cli/cli-script.c and other places.
Yit
January 12, 2012
More information about the Gdb-patches
mailing list