From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24434 invoked by alias); 3 Dec 2006 05:25:55 -0000 Received: (qmail 24423 invoked by uid 22791); 3 Dec 2006 05:25:54 -0000 X-Spam-Check-By: sourceware.org Received: from mpv3.TIS.CWRU.Edu (HELO mpv3.TIS.cwru.edu) (129.22.105.35) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 03 Dec 2006 05:25:47 +0000 Received: from [192.168.1.101] (h160.251.40.69.ip.alltel.net [69.40.251.160]) by mpv3.TIS.cwru.edu (MOS 3.8.2-GA) with ESMTP id BPH03869 (AUTH cpr); Sun, 3 Dec 2006 00:25:32 -0500 (EST) Message-ID: <45725FC9.9070304@case.edu> Date: Sun, 03 Dec 2006 05:25:00 -0000 From: Chet Ramey Reply-To: chet.ramey@case.edu User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025) MIME-Version: 1.0 To: "H. J. Lu" CC: GDB , jkratoch@redhat.com, bug-readline@gnu.org, chet@case.edu Subject: Re: PATCH: PR tui/2173: Arrow keys no longer works in breakpoint command list References: <20061121213205.GA13310@lucon.org> <20061128164658.GB20882@nevyn.them.org> <20061128165844.GA13667@lucon.org> <20061202184344.GA2197@lucon.org> <4571CF2A.3040608@case.edu> <20061202221541.GA9776@lucon.org> In-Reply-To: <20061202221541.GA9776@lucon.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2006-12/txt/msg00017.txt.bz2 H. J. Lu wrote: > On Sat, Dec 02, 2006 at 02:08:26PM -0500, Chet Ramey wrote: >> H. J. Lu wrote: >> >>>>> I'm pretty sure this isn't right. I got as far as figuring out that we >>>>> should be calling rl_callback_handler_install and >>>>> rl_callback_handler_remove at different times, always removing the >>>>> handler before calling readline recursively, but I couldn't quite work >>>>> out the right conditions. >>>> I assume by "this isn't right", you mean my patch may break something. >>>> Do you have a testcase? It may get into readline: >> Unless the calling application is careful, this code will leave readline >> in an inconsistent state in the presence of a longjmp(). It relies on >> private state kept local to a single call to readline(). >> >> I am leaning towards not including it for that reason. >> >> There should be no reason that the application cannot remove the callback >> handler and re-add it before calling readline synchronously, as Daniel or >> H.J. suggested. The application is the only one in a position to know >> which is right. >> > > Did you mean > > http://sources.redhat.com/ml/gdb-patches/2006-11/msg00234.html > > is more appropriate? More appropriate in the sense that the application controls the state and switches between the callback and synchronous readline modes. Since it's the app that's supposed to be calling into readline when in callback mode anyway, I think this patch will work better. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Live Strong. No day but today. Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/