From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32258 invoked by alias); 12 Jan 2012 16:48:36 -0000 Received: (qmail 32242 invoked by uid 22791); 12 Jan 2012 16:48:34 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from router-304.cs.umd.edu (HELO bacon.cs.umd.edu) (128.8.127.145) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Jan 2012 16:48:21 +0000 Received: from wireless-206-196-163-53.umd.edu (wireless-206-196-163-53.umd.edu [206.196.163.53]) (Authenticated sender: khooyp) by bacon.cs.umd.edu (Postfix) with ESMTPSA id 162ACB40395; Thu, 12 Jan 2012 11:48:15 -0500 (EST) Subject: Re: Make the "python" command resemble the standard Python interpreter Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Khoo Yit Phang In-Reply-To: Date: Thu, 12 Jan 2012 16:52:00 -0000 Cc: Khoo Yit Phang , gdb-patches@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Doug Evans X-CSD-MailScanner-ID: 162ACB40395.AECE6 X-CSD-MailScanner: Found to be clean X-CSD-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-50, required 5, autolearn=not spam, ALL_TRUSTED -50.00) X-CSD-MailScanner-From: khooyp@cs.umd.edu X-CSD-MailScanner-Watermark: 1326991696.80791@dwdnmU0q2JSVspXEWxQxFg 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 X-SW-Source: 2012-01/txt/msg00409.txt.bz2 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). >=20 > (gdb) python >> print 1 + 2 >> end > 3 > (gdb) >=20 > 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 w= ould also eliminate the need for handling python in cli/cli-script.c and ot= her places. Yit January 12, 2012