aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-low.c
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2019-04-16 10:37:47 +0100
committerAlan Hayward <alan.hayward@arm.com>2019-04-17 10:42:46 +0100
commita7e559cc087b10b9ea337b58e52cc13964aae3fb (patch)
tree9d37b96a5ec1c3c53df5d92c2f2d86fcad65523c /gdb/gdbserver/linux-low.c
parentaeb2e706e1b9c491d20c88c8ead1ae9df9cee04a (diff)
downloadbinutils-a7e559cc087b10b9ea337b58e52cc13964aae3fb.zip
binutils-a7e559cc087b10b9ea337b58e52cc13964aae3fb.tar.gz
binutils-a7e559cc087b10b9ea337b58e52cc13964aae3fb.tar.bz2
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.
Diffstat (limited to 'gdb/gdbserver/linux-low.c')
-rw-r--r--gdb/gdbserver/linux-low.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 168f4b2..917b1c2 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -6185,10 +6185,9 @@ sigchld_handler (int signo)
{
do
{
- /* fprintf is not async-signal-safe, so call write
- directly. */
- if (write (2, "sigchld_handler\n",
- sizeof ("sigchld_handler\n") - 1) < 0)
+ /* Use the async signal safe debug function. */
+ if (debug_write ("sigchld_handler\n",
+ sizeof ("sigchld_handler\n") - 1) < 0)
break; /* just ignore */
} while (0);
}