From aeb2e706e1b9c491d20c88c8ead1ae9df9cee04a Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Fri, 12 Apr 2019 15:49:11 +0100 Subject: gdbserver: Add debug-file option Add command line option to send all debug output to a given file. Always default back to stderr. Add matching monitor command. Add documentation. gdb/doc/ChangeLog: * gdb.texinfo (Other Command-Line Arguments for gdbserver): Add debug-file option. (Monitor Commands for gdbserver): Likewise. (gdbserver man): Likewise. gdb/gdbserver/ChangeLog: * debug.c (debug_set_output): New function. (debug_vprintf): Send output to debug_file. (debug_flush): Likewise. * debug.h (debug_set_output): New declaration. * server.c (handle_monitor_command): Add debug-file option. (captured_main): Likewise. --- gdb/gdbserver/debug.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gdb/gdbserver/debug.h') diff --git a/gdb/gdbserver/debug.h b/gdb/gdbserver/debug.h index c8d5e33..f65c91c 100644 --- a/gdb/gdbserver/debug.h +++ b/gdb/gdbserver/debug.h @@ -21,6 +21,11 @@ #if !defined (IN_PROCESS_AGENT) extern int remote_debug; + +/* Switch all debug output to DEBUG_FILE. If DEBUG_FILE is nullptr or an + empty string, or if the file cannot be opened, then debug output is sent to + stderr. */ +void debug_set_output (const char *debug_file); #endif extern int debug_threads; -- cgit v1.1