From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1065 invoked by alias); 19 Jan 2004 06:14:43 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 1051 invoked from network); 19 Jan 2004 06:14:41 -0000 Received: from unknown (HELO monty-python.gnu.org) (199.232.76.173) by sources.redhat.com with SMTP; 19 Jan 2004 06:14:41 -0000 Received: from [207.232.27.5] (helo=WST0054) by monty-python.gnu.org with asmtp (Exim 4.24) id 1AiSfT-0005gD-3i; Mon, 19 Jan 2004 01:13:47 -0500 Date: Mon, 19 Jan 2004 06:14:00 -0000 Message-Id: From: Eli Zaretskii To: Daniel Jacobowitz CC: bug-readline@gnu.org, gdb@sources.redhat.com In-reply-to: <20040118224929.GA8226@nevyn.them.org> (message from Daniel Jacobowitz on Sun, 18 Jan 2004 17:49:29 -0500) Subject: Re: Difficulty with the readline completion interface in GDB Reply-to: Eli Zaretskii References: <20040118224929.GA8226@nevyn.them.org> X-SW-Source: 2004-01/txt/msg00228.txt.bz2 > Date: Sun, 18 Jan 2004 17:49:29 -0500 > From: Daniel Jacobowitz > > I've spent this morning trying to fix a long-standing bug in GDB's tab > completion. I think it's unsolvable with the current readline interface Agreed. This has come up before on GDB mailing lists, see, for example: http://sources.redhat.com/ml/gdb/2001-09/msg00247.html > There's a lot of possible solutions. There could be a hook called before > rl_complete generates the matches list, which could fudge the complete > characters - most direct solution, not very elegant. A function could be > called to get the list of complete characters, which would then be sensitive > to rl_point - not sure what other issues this could cause. The filename > completion code could search backwards according to the list of filename > wordbreak characters; this would solve the specific problem but not the > more general one. Probably there are others. I think the first solution is the easiest one and will do the job. The two others need to teach GDB functions dealing with completion too much context, which they are currently oblivious about. For example, the back-search method in the last proposal is not easy since you not always know where to stop the search (e.g., imagine a GDB command that has 2 file-name arguments, or the "foo.c:bar" case). It's not so hard to scan forward from some place, but much harder to scan backward. What is inelegant in the first solution you suggested, Daniel?