From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11157 invoked by alias); 12 Jan 2012 18:30:57 -0000 Received: (qmail 11148 invoked by uid 22791); 12 Jan 2012 18:30:56 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vx0-f169.google.com (HELO mail-vx0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Jan 2012 18:30:42 +0000 Received: by vcge1 with SMTP id e1so1878993vcg.0 for ; Thu, 12 Jan 2012 10:30:42 -0800 (PST) Received: by 10.220.151.5 with SMTP id a5mr1591935vcw.41.1326393042199; Thu, 12 Jan 2012 10:30:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.151.5 with SMTP id a5mr1591929vcw.41.1326393042112; Thu, 12 Jan 2012 10:30:42 -0800 (PST) Received: by 10.220.229.1 with HTTP; Thu, 12 Jan 2012 10:30:42 -0800 (PST) In-Reply-To: <751D4ADF-BB24-4E23-BCFB-DB1F2BB11CFF@cs.umd.edu> References: <09787EF419216C41A903FD14EE5506DD030F1EB39B@AUSX7MCPC103.AMER.DELL.COM> <09787EF419216C41A903FD14EE5506DD030F1EB45D@AUSX7MCPC103.AMER.DELL.COM> <09787EF419216C41A903FD14EE5506DD030F1EB49D@AUSX7MCPC103.AMER.DELL.COM> <751D4ADF-BB24-4E23-BCFB-DB1F2BB11CFF@cs.umd.edu> Date: Thu, 12 Jan 2012 18:36:00 -0000 Message-ID: Subject: Re: Make the "python" command resemble the standard Python interpreter From: Doug Evans To: Khoo Yit Phang Cc: Paul_Koning@dell.com, gdb-patches@sourceware.org X-System-Of-Record: true Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg00423.txt.bz2 On Thu, Jan 12, 2012 at 10:19 AM, Khoo Yit Phang wrote: > Hi, > > On Jan 12, 2012, at 1:13 PM, Doug Evans wrote: > >> On Jan 12, 2012 9:51 AM, "Doug Evans" wrote: >> > >> > On Thu, Jan 12, 2012 at 9:47 AM, =A0 wrote: >> > >>... >> > >>> - I may want a script that invokes python interactively. >> > >>> - How do I write a gdb macro that invokes the python repl? >> > >>> >> > >>> Solve those problems, and provide a migration path away from the o= ld >> > >>> behaviour, and then you've got something. >> > >> >> > >>As a strawman, a new command, python-foo, could be provided [python-= code? =A0python-script?] that had the "old" behaviour. >> > > >> > > Nice solution. >> > >> > 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. >> >> Or preferably have a new command should the need arise (I like python-re= pl, but I realize repl may be too obscure :-) ). >> OK, I think I'm OK with where this is going. > > 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 retai= n compatibility with the current behavior. 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.]