public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/16699] New: GDB Python command completion with overriden complete vs. completer class
@ 2014-03-12 19:52 sergiodj at redhat dot com
  2014-03-12 19:53 ` [Bug python/16699] " sergiodj at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sergiodj at redhat dot com @ 2014-03-12 19:52 UTC (permalink / raw)
  To: gdb-prs

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<TAB>
it completes to /home/ and offers files within that directory

However for:
(gdb) mysecondcommand /h<TAB>
it completes to /home<SPACE> 

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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-04-08 22:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-12 19:52 [Bug python/16699] New: GDB Python command completion with overriden complete vs. completer class sergiodj at redhat dot com
2014-03-12 19:53 ` [Bug python/16699] " sergiodj at redhat dot com
2014-03-13  2:10 ` sergiodj at redhat dot com
2014-05-05 20:09 ` jan.kratochvil at redhat dot com
2014-09-03 20:35 ` cvs-commit at gcc dot gnu.org
2014-09-03 20:37 ` sergiodj at redhat dot com
2015-04-08 22:29 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).