[RFA] completion in command definition

Jerome Guitton guitton@adacore.com
Thu Jan 12 10:05:00 GMT 2017


Simon Marchi (simon.marchi@polymtl.ca):

> Actually, I think you are confusing pointer and pointee.
> lookup_cmd_1 checks if result_list is NULL, not if *result_list is
> NULL.  So with your version, since result_list is not NULL
> (&last_line is not NULL, it's the address of the variable)
> lookup_cmd_1 will set the last_line variable.  There's no harm, but
> since we don't care about that value it's not useful either.  I
> think what you want is:
> 
> cmd = lookup_cmd_1 (&cmd_name, cmdlist, NULL, 1);

You are absolutely right; I got confused by lookup_cmd_1's doc somehow.
New patch in attachment. Thanks again!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2017-01-12-cli-script.diff
Type: text/x-diff
Size: 7923 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20170112/28370704/attachment.bin>


More information about the Gdb-patches mailing list