aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/server.cc
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2020-10-02 14:44:40 -0400
committerSimon Marchi <simon.marchi@efficios.com>2020-10-02 14:47:42 -0400
commit6b01403b25c0eb6ce9e7b2e3cc6f5da674089e72 (patch)
treebb4c228df496538c86485682474aee12791491c4 /gdbserver/server.cc
parentba98841943b085891eb4bf4debc3981ac95bb7fb (diff)
downloadgdb-6b01403b25c0eb6ce9e7b2e3cc6f5da674089e72.zip
gdb-6b01403b25c0eb6ce9e7b2e3cc6f5da674089e72.tar.gz
gdb-6b01403b25c0eb6ce9e7b2e3cc6f5da674089e72.tar.bz2
gdb: add debug prints in event loop
Add debug printouts about event loop-related events: - When a file descriptor handler gets invoked - When an async event/signal handler gets invoked gdb/ChangeLog: * async-event.c (invoke_async_signal_handlers): Add debug print. (check_async_event_handlers): Likewise. * event-top.c (show_debug_event_loop): New function. (_initialize_event_top): Register "set debug event-loop" setting. gdbserver/ChangeLog: * server.cc (handle_monitor_command): Handle "set debug-event-loop". (captured_main): Handle "--debug-event-loop". (monitor_show_help): Mention new setting. (gdbserver_usage): Mention new flag. gdbsupport/ChangeLog: * event-loop.h (debug_event_loop): New variable declaration. (event_loop_debug_printf_1): New function declaration. (event_loop_debug_printf): New macro. * event-loop.cc (debug_event_loop): New variable. (handle_file_event): Add debug print. (event_loop_debug_printf_1): New function. Change-Id: If78ed3a69179881368e7895b42940ce13b6a1a05
Diffstat (limited to 'gdbserver/server.cc')
-rw-r--r--gdbserver/server.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdbserver/server.cc b/gdbserver/server.cc
index d45154d..e6314e5 100644
--- a/gdbserver/server.cc
+++ b/gdbserver/server.cc
@@ -955,6 +955,8 @@ monitor_show_help (void)
monitor_output (" Enable h/w breakpoint/watchpoint debugging messages\n");
monitor_output (" set remote-debug <0|1>\n");
monitor_output (" Enable remote protocol debugging messages\n");
+ monitor_output (" set event-loop-debug <0|1>\n");
+ monitor_output (" Enable event loop debugging messages\n");
monitor_output (" set debug-format option1[,option2,...]\n");
monitor_output (" Add additional information to debugging messages\n");
monitor_output (" Options: all, none");
@@ -1389,6 +1391,16 @@ handle_monitor_command (char *mon, char *own_buf)
remote_debug = 0;
monitor_output ("Protocol debug output disabled.\n");
}
+ else if (strcmp (mon, "set event-loop-debug 1") == 0)
+ {
+ debug_event_loop = debug_event_loop_kind::ALL;
+ monitor_output ("Event loop debug output enabled.\n");
+ }
+ else if (strcmp (mon, "set event-loop-debug 0") == 0)
+ {
+ debug_event_loop = debug_event_loop_kind::OFF;
+ monitor_output ("Event loop debug output disabled.\n");
+ }
else if (startswith (mon, "set debug-format "))
{
std::string error_msg
@@ -3468,6 +3480,7 @@ gdbserver_usage (FILE *stream)
" none\n"
" timestamp\n"
" --remote-debug Enable remote protocol debugging output.\n"
+ " --event-loop-debug Enable event loop debugging output.\n"
" --disable-packet=OPT1[,OPT2,...]\n"
" Disable support for RSP packets or features.\n"
" Options:\n"
@@ -3683,6 +3696,8 @@ captured_main (int argc, char *argv[])
}
else if (strcmp (*next_arg, "--remote-debug") == 0)
remote_debug = 1;
+ else if (strcmp (*next_arg, "--event-loop-debug") == 0)
+ debug_event_loop = debug_event_loop_kind::ALL;
else if (startswith (*next_arg, "--debug-file="))
debug_set_output ((*next_arg) + sizeof ("--debug-file=") -1);
else if (strcmp (*next_arg, "--disable-packet") == 0)