Re: [patch/rfc] mi interpreter-complete enh req 8058.

Nick Roberts
2009-10-02T23:10:16Z

Tom Tromey writes:
> >>>>> "Matt" == Matt Rice <ratmice@gmail.com> writes:
>
> Matt> Attached is a patch i've ported from Apple's gdb...
> Matt> it implements a tab-completion like function for MI
> Matt> http://sourceware.org/bugzilla/show_bug.cgi?id=8058
> Matt> I figured I would post a basic port of the patch for discussion,
> Matt> before doing to much to it.
>
> Thanks.

PR 8058 goes back to 2003. I don't see the need for MI to duplicate all of
the CLI functionality. Emacs just uses the CLI command "complete" which is
clearly just intended for front end use:

complete b ma
&"complete b ma\n"
~"b main\n"
~"b malloc\n"
~"b malloc@plt\n"
^done

The lisp function, gud-gdb-complete-command. is bound to TAB to it works
in the GUD buffer (Emacs' console) just as it does on the command line.

> ...
> Matt> -interpreter-complete console "b ma"
> Matt> ^done,completions=[c="main",c="malloc",c="malloc@plt"]
>
> It is weird to see all those useless "c=" strings in there :-)

Well, if they are going to be present, could we please stick to the syntax
suggested in the manual:

`TUPLE ==>'
` "{}" | "{" RESULT ( "," RESULT )* "}" '

and

* New GDB/MI commands should only output LISTS containing VALUES.

So either

^done,completions={c="main",c="malloc",c="malloc@plt"}

or

^done,completions=["main","malloc","malloc@plt"]

--
Nick http://users.snap.net.nz/~nickrob