From a7e559cc087b10b9ea337b58e52cc13964aae3fb Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Tue, 16 Apr 2019 10:37:47 +0100 Subject: gdbserver: Ensure all debug output uses debug functions All debug output needs to go via debug functions to ensure it writes to the correct output stream. gdb/ChangeLog: * nat/linux-waitpid.c (linux_debug): Call debug_vprintf. gdb/gdbserver/ChangeLog: * ax.c (ax_vdebug): Call debug_printf. * debug.c (debug_write): New function. * debug.h (debug_write): New declaration. * linux-low.c (sigchld_handler): Call debug_write. --- gdb/gdbserver/debug.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdb/gdbserver/debug.h') diff --git a/gdb/gdbserver/debug.h b/gdb/gdbserver/debug.h index f65c91c..29e58ad 100644 --- a/gdb/gdbserver/debug.h +++ b/gdb/gdbserver/debug.h @@ -35,6 +35,9 @@ void debug_flush (void); void do_debug_enter (const char *function_name); void do_debug_exit (const char *function_name); +/* Async signal safe debug output function that calls write directly. */ +size_t debug_write (const void *buf, size_t nbyte); + /* These macros are for use in major functions that produce a lot of debugging output. They help identify in the mass of debugging output when these functions enter and exit. debug_enter is intended to be -- cgit v1.1