From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30200 invoked by alias); 12 Jan 2012 18:36:55 -0000 Received: (qmail 29997 invoked by uid 22791); 12 Jan 2012 18:36:54 -0000 X-SWARE-Spam-Status: No, hits=-1.3 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 18:36:41 +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 6B26AB409D3; Thu, 12 Jan 2012 13:36:39 -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 18:48:00 -0000 Cc: Khoo Yit Phang , Paul_Koning@dell.com, gdb-patches@sourceware.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <09787EF419216C41A903FD14EE5506DD030F1EB39B@AUSX7MCPC103.AMER.DELL.COM> <09787EF419216C41A903FD14EE5506DD030F1EB45D@AUSX7MCPC103.AMER.DELL.COM> <09787EF419216C41A903FD14EE5506DD030F1EB49D@AUSX7MCPC103.AMER.DELL.COM> <751D4ADF-BB24-4E23-BCFB-DB1F2BB11CFF@cs.umd.edu> To: Doug Evans X-CSD-MailScanner-ID: 6B26AB409D3.ABAAA 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: 1326998199.78502@btToNCcvG1U1HR3R6Ndfig 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/msg00424.txt.bz2 Hi, On Jan 12, 2012, at 1:30 PM, Doug Evans wrote: > On Thu, Jan 12, 2012 at 10:19 AM, Khoo Yit Phang wrot= e: >> Hi, >>=20 >> On Jan 12, 2012, at 1:13 PM, Doug Evans wrote: >>=20 >>> On Jan 12, 2012 9:51 AM, "Doug Evans" wrote: >>>>=20 >>>> On Thu, Jan 12, 2012 at 9:47 AM, wrote: >>>>>> ... >>>>>>> - I may want a script that invokes python interactively. >>>>>>> - How do I write a gdb macro that invokes the python repl? >>>>>>>=20 >>>>>>> Solve those problems, and provide a migration path away from the old >>>>>>> behaviour, and then you've got something. >>>>>>=20 >>>>>> As a strawman, a new command, python-foo, could be provided [python-= code? python-script?] that had the "old" behaviour. >>>>>=20 >>>>> Nice solution. >>>>=20 >>>> btw, would we ever want to pass options to the python repl? >>>> If that might ever occur, then we don't want python with arguments to >>>> be the old behaviour. >>>=20 >>> Or preferably have a new command should the need arise (I like python-r= epl, but I realize repl may be too obscure :-) ). >>> OK, I think I'm OK with where this is going. >>=20 >> Instead of making a new command, we can add an option to, say "python /i= ", that forces the interpreter to start, so that you can define a GDB macro= that starts a Python interpreter (when from_tty is false). That would reta= in compatibility with the current behavior. >=20 > Heh. / is for display options (e.g. x/i $pc), - is for other kinds of > options (e.g. symbol-file -readnow foo). > But yeah, that's another alternative. [It feels more problematic, > e.g. the caveat you mention.] For reference, the caveat I mentioned was in an email rejected by the maili= ng list server: that was for "python -i" which would disallow the python sc= ript "-i". "python /i" would not have this caveat, since "/i" isn't a valid Python exp= ression. Yit January 12, 2012