From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4301 invoked by alias); 1 Aug 2011 14:13:29 -0000 Received: (qmail 4291 invoked by uid 22791); 1 Aug 2011 14:13:28 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Aug 2011 14:13:05 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p71ED41g015998 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 1 Aug 2011 10:13:04 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p71ED2X4024902; Mon, 1 Aug 2011 10:13:02 -0400 From: Phil Muldoon To: Matt Rice Cc: gdb-patches@sourceware.org Subject: Re: [patch] python prompt additions at first prompt. References: Reply-to: pmuldoon@redhat.com X-URL: http://www.redhat.com Date: Mon, 01 Aug 2011 14:13:00 -0000 In-Reply-To: (Matt Rice's message of "Mon, 1 Aug 2011 07:08:26 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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: 2011-08/txt/msg00007.txt.bz2 Matt Rice writes: > On Mon, Aug 1, 2011 at 2:50 AM, Phil Muldoon wrote: >> Matt Rice writes: >> >>> little bug with the new python prompt stuff, the prompt_hook doesn't >>> take effect until the second prompt. >> >> Thanks for doing this. =C2=A0This looks fine to me, apart from one quest= ion. >> >> For tests, there are prompt tests in the python.exp file for prompt >> substitutions. =C2=A0For passing arguments to GDB at start-up, see usage= of >> $GDBFLAGS in the testsuite. > > I'd tried that, but didn't have much luck, > i'll give it another shot. Look at gdb.base/args.exp You may not be declaring GDBFLAGS as global. >> display_gdb_prompt removes any handler that is present, and then >> installs a handler. =C2=A0As this is the first prompt, the above code do= es >> not (because there could not have been a handler installed). =C2=A0I thi= nk >> attempting to remove a handler that does not exist just results in a >> NOOP, but it is worth checking. =C2=A0I know very little about readline, >> however. =C2=A0So my question is: with GDB's copy of readline, is this o= kay? > > Yes, the effect of it seems to turn zero's into zero's. > by my reading and valgrind, it seems fine, > > the documentation doesn't specify one way or the other though. > > If it is deemed not OK, it needs to be handled in display_gdb_prompt rega= rdless, > because gdb -ex 'set editing off' ' followed by a 'set editing on', at > the gdb prompt, results in 2 calls to _remove before the callback is > installed > from display_gdb_prompt, and change_line_handler. I'm fine with this, display_gdb_prompt has been around since 1999 I think, and it has not failed in those years. I think you did a reasonable analysis. Cheers, Phil