[PATCH 10/10] Command line input handling TLC

Simon Marchi simon.marchi@ericsson.com
Fri Feb 19 16:01:00 GMT 2016


On 16-02-18 12:40 PM, Pedro Alves wrote:
> I didn't manage to usefully split this further into smaller
> independent pieces, so:
> 
>  - Use "struct buffer" more.
> 
>  - Split out the responsability of composing a complete command line

responsibility

> -/* Handle a complete line of input.  This is called by the callback
> -   mechanism within the readline library.  Deal with incomplete
> -   commands as well, by saving the partial input in a global
> -   buffer.  */
> +/* Append RL, an input line returned by readline or one of its
> +   emulations, to CMD_LINE_BUFFER.  Returns false if more input is
> +   expected (input line ends in a backslash), true if we have a whole
> +   command line ready to be processed by the command interpreter.
> +   Takes ownership of RL.  */
>  
> -/* NOTE: 1999-04-30 This is the asynchronous version of the
> -   command_line_input function; command_line_input will become
> -   obsolete once we use the event loop as the default mechanism in
> -   GDB.  */
> -static void
> -command_line_handler (char *rl)
> +static char *
> +command_line_append_input_line (struct buffer *cmd_line_buffer, char *rl)

The comment seems outdated, the function doesn't return true/false, but NULL
or non-NULL. I suppose it did return true/false in an earlier version of the
patch :).



More information about the Gdb-patches mailing list