From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32025 invoked by alias); 8 Aug 2007 19:59:30 -0000 Received: (qmail 31970 invoked by uid 22791); 8 Aug 2007 19:59:29 -0000 X-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DK_POLICY_SIGNSOME,SPF_HELO_PASS,SPF_PASS,TW_FH X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 08 Aug 2007 19:59:23 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l78JxMB8020187 for ; Wed, 8 Aug 2007 15:59:22 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l78JxL7I002218 for ; Wed, 8 Aug 2007 15:59:21 -0400 Received: from [172.16.57.153] (multics.rdu.redhat.com [172.16.57.153]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l78JxKh1002172 for ; Wed, 8 Aug 2007 15:59:20 -0400 Subject: tab completion From: Stan Cox To: Frysk List Content-Type: text/plain Date: Wed, 08 Aug 2007 19:59:00 -0000 Message-Id: <1186603143.6921.45.camel@multics.rdu.redhat.com> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-1.fc7) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00281.txt.bz2 Tab completion is a feature of jline. fhpd.java sets it up by defining a class FhpdCompletor which defines CLI.complete as the completor. This method uses heuristics to determine what is being completed. If the fhpd request line doesn't contain spaces then it is assumed that request names are being completed. This is done by calling candidates.add to add each request names that match the input thus far. Then complete returns the position in the input line where completion will continue to jline. If request names are not being completed then debugInfo.complete is called as the completor. This method interrogates the debuginfo to find candidate names. DwarfDie.getScopeVarNames does most of the work of finding candidate names. candidates.add is called to add matching names. Structure members are handled specially by getScopeVarNames by returning the structure members.