From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7292 invoked by alias); 12 Mar 2014 19:52:56 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 7272 invoked by uid 48); 12 Mar 2014 19:52:56 -0000 From: "sergiodj at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug python/16699] New: GDB Python command completion with overriden complete vs. completer class Date: Wed, 12 Mar 2014 19:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sergiodj at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: sergiodj at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q1/txt/msg00354.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=16699 Bug ID: 16699 Summary: GDB Python command completion with overriden complete vs. completer class Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: python Assignee: sergiodj at redhat dot com Reporter: sergiodj at redhat dot com This bug is a clone of a Red Hat bug. create a file completion.py and add the below lines: --------------------------------------- class MyFirstCommand(gdb.Command): def __init__(self): gdb.Command.__init__(self,'myfirstcommand',gdb.COMMAND_USER,gdb.COMPLETE_FILENAME) def invoke(self,argument,from_tty): raise gdb.GdbError('not implemented') class MySecondCommand(gdb.Command): def __init__(self): gdb.Command.__init__(self,'mysecondcommand',gdb.COMMAND_USER) def invoke(self,argument,from_tty): raise gdb.GdbError('not implemented') def complete(self,text,word): return gdb.COMPLETE_FILENAME MyFirstCommand () MySecondCommand () -------------------------------------------------- >gdb (gdb) source completion.py (gdb) mysecondcommand /home <- that is the issue (gdb) myfirstcommand /home/ fotis/ lost+found/ Actual results: (gdb) myfirstcommand /h it completes to /home/ and offers files within that directory However for: (gdb) mysecondcommand /h it completes to /home My command doesn't take directories, so I really want completion to work as for the first command. Is this expected GDB behavior? How do I make it work? Expected results: (gdb) mysecondcommand /home/ fotis lost+found -- You are receiving this mail because: You are on the CC list for the bug.