[RFA 1/2] Add completion for COMMAND in 'thread apply all|ID... COMMAND'

Philippe Waroquiers philippe.waroquiers@skynet.be
Sat May 11 15:01:00 GMT 2019


On Fri, 2019-05-10 at 01:53 +0100, Pedro Alves wrote:
> I'm pretty happy and excited with the result.
Yes, really a (lot of) nice work.
Wondering if/where I can help.
In the meantime, I quickly read the (big :) patch and played
a little bit with it.

Some feedback below, it is not yet perfect, but it gets
closer :). 

* I run the regression tests.  I have not seen any regression,
  so that it all good.

* print /x does not combine with the new options e.g.
    (gdb) print /x 4
    $2 = 0x4
    (gdb) print -pretty -- 4
    $3 = 4
    (gdb) print -pretty -- /x 4
    A syntax error in expression, near `/x 4'.
    (gdb) print /x -pretty -- 4
    No symbol "pretty" in current context.
    (gdb) 
  The problem is because the function print_command_parse_format
  is called with *expp pointing at the space character following --.
  Wondering where this is better fixed.
  Maybe at the lowest level (i.e. check_for_argument) : if an argument
  is followed by spaces, I guess these spaces should be 'eaten' by
  check_for_argument.

* print usage should probably better mention /FMT e.g.
   Usage: print [[OPTION]... --] [/FMT] [EXP]
  instead of
   Usage: print [[OPTION]... --] [EXP]

* compile usage does not mention the new print options:
   Usage: compile print[/FMT] [EXPR]

* Some 'enum' values (on, off, unlimited, ...) are not accepted as
  abbreviations, while some others are.
  E.g.  bt -e b works
  while  p -e u -- 4 does not
   (but u will complete to unlimited)

* bt fu<TAB> has changed of behaviour.
  It now gives a lot more completion possibilities.
  This comment can probably just be ignored, as HEAD does in any case
  produce not very relevant completions.
  Alternatively, it might maybe be also be possible to complete on the
  'old option qualifier style'.

* bt accepts now 2 'counts' to  limit on the nr of frame to show.
  This is a little bit confusing, so maybe the interactions between
  the 2 might be explained in the help.
  E.g. explain that the below will only give 2 frames:
    bt -limit 2 3

* The 'print' examples in the commit log are missing the trailing --

* Now that we have nice command options completions, I wonder
  if the -q -c -s options should/could not be reworded as
    -quiet -continue -silent
  That will be backward compatible, and is better ergonomy.
  I can do that as a follow-up patch if that will help you.

* display and output commands have no OPTIONS yet. 
  For display, I guess this means the 'struct display' has to store
  the option values (or maybe the string options ?).

* (gdb) thread apply 1 3 -ascenTAB will complete
  but the resulting command fails:
   (gdb) thread apply 1 3 -ascending p $pc
   Invalid thread ID: -ascending p $pc
  (gdb) 


* frame apply 10 -pasTAB completes as
   frame apply 10 -passwd 

* the help frame apply  only shows the qcs options
  (same for frame apply all)

* help thread apply: the second line for the help for -ascending
  should probably better be indented to the right, like the first line.




More information about the Gdb-patches mailing list