From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24143 invoked by alias); 24 Jul 2002 17:23:58 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24134 invoked from network); 24 Jul 2002 17:23:57 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 24 Jul 2002 17:23:57 -0000 Received: by localhost.redhat.com (Postfix, from userid 469) id 57924108C9; Wed, 24 Jul 2002 13:22:18 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15678.57929.895918.500305@localhost.redhat.com> Date: Wed, 24 Jul 2002 10:29:00 -0000 To: tromey@redhat.com Cc: Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: Patch: RFA: operate-and-get-next fix In-Reply-To: <87it35ukud.fsf@fleche.redhat.com> References: <87n0vtc1n2.fsf@creche.redhat.com> <15632.50715.850955.747717@localhost.redhat.com> <87y9c2573v.fsf@fleche.redhat.com> <15678.54268.874096.154108@localhost.redhat.com> <87it35ukud.fsf@fleche.redhat.com> X-SW-Source: 2002-07/txt/msg00482.txt.bz2 Tom Tromey writes: > >>>>> "Elena" == Elena Zannoni writes: > > >> +/* This is like readline(), but it has some gdb-specific behavior. In > >> + particular, if the user is in the middle of an > >> + operate-and-get-next, we shuffle the hooks around so that the > >> + expected result occurs. This is ugly, but it is inevitable given > >> + that gdb switches between the two modes (async and not) of using > >> + readline and that rl_pre_input_hook doesn't work properly in async > >> + mode. */ > > Elena> Ok for the other changes, but I don't understand why you are > Elena> setting rl_pre_input_hook in the async case, while in top.c > Elena> there is a comment saying the opposite: > > The thing is, gdb uses both readline in both the synchronous and async > modes during a single invocation. > > At the ordinary top-level prompt we might be using the async > readline. That means we can't use rl_pre_input_hook, since it doesn't > work properly in async mode. > > However, for a secondary prompt (" >", such as occurs during a > `define'), gdb just calls readline() directly, running it in > synchronous mode. > > So for operate-and-get-next to work in this situation, we have to > switch the hooks around. That is what gdb_readline_wrapper is for. > Ah, ok. > I thought the comment quoted above explained the situation. > Apparently, though, it didn't. Can you suggest how I should change it > to be more clear? I'll make the changes and resubmit the patch. > Hey, just cut-n-paste what you wrote above. Seems pretty clear to me. > > Long term the best fix here, in my opinion, is to fix readline so that > rl_pre_input_hook works properly in all situations. That code is > pretty convoluted, though. When I looked at it (must have been a year > ago now) it didn't look fun. > I should look to see if the new readline has improved a bit in this sense. you can commit the changes, however, the testsuite change....is Fernando's. thanks Elena > Tom