On Thu, 23 May 2019 at 11:39, Alex Bennée <alex.ben...@linaro.org> wrote:
>
> This provides two functions for handling console output that handle
> the common backend behaviour for semihosting.
>
> Signed-off-by: Alex Bennée <alex.ben...@linaro.org>

> diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
> index 08363969c14..b2963547c48 100644
> --- a/include/exec/gdbstub.h
> +++ b/include/exec/gdbstub.h
> @@ -44,6 +44,17 @@ void gdb_do_syscall(gdb_syscall_complete_cb cb, const char 
> *fmt, ...);
>   * argument list.
>   */
>  void gdb_do_syscallv(gdb_syscall_complete_cb cb, const char *fmt, va_list 
> va);
> +/**
> + * gdb_do_console_out:
> + * @gs: guest address of string to send
> + * @len: length of string
> + *
> + * Sends a string to gdb console. Unlike the system call interface
> + * there is no callback and we assume the system call always
> + * succeeds.
> + */
> +void gdb_do_console_out(target_ulong s, int len);

I'm not sure about the "no callback" part of this API. The operation
here is genuinely asynchronous and providing no mechanism for the
caller to be able to say "ok, now wait til it completes" doesn't
seem like a good plan.

thanks
-- PMM

Reply via email to