diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2022-01-16 21:27:58 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2022-01-18 13:44:32 -0500 |
commit | c058728c31684d08da396f1bf50fabaa196dc9d9 (patch) | |
tree | 8e0d08d18cf135f7071fa9ee37dd549ee86656a8 /gdbserver/debug.cc | |
parent | c68665c7260985ac8497ccafcea961f4a261c675 (diff) | |
download | binutils-gdb-c058728c31684d08da396f1bf50fabaa196dc9d9.tar.gz |
gdbserver: introduce threads_debug_printf, THREADS_SCOPED_DEBUG_ENTER_EXIT
Add the threads_debug_printf and THREADS_SCOPED_DEBUG_ENTER_EXIT, which
use the logging infrastructure from gdbsupport/common-debug.h. Replace
all debug_print uses that are predicated by debug_threads with
threads_dethreads_debug_printf. Replace uses of the debug_enter and
debug_exit macros with THREADS_SCOPED_DEBUG_ENTER_EXIT, which serves
essentially the same purpose, but allows showing what comes between the
enter and the exit in an indented form.
Note that "threads" debug is currently used for a bit of everything in
GDBserver, not only threads related stuff. It should ideally be cleaned
up and separated logically as is done in GDB, but that's out of the
scope of this patch.
Change-Id: I2d4546464462cb4c16f7f1168c5cec5a89f2289a
Diffstat (limited to 'gdbserver/debug.cc')
-rw-r--r-- | gdbserver/debug.cc | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/gdbserver/debug.cc b/gdbserver/debug.cc index 372b5577958..8b3e95e65cd 100644 --- a/gdbserver/debug.cc +++ b/gdbserver/debug.cc @@ -110,30 +110,6 @@ debug_flush (void) fflush (debug_file); } -/* Notify the user that the code is entering FUNCTION_NAME. - FUNCTION_NAME is the name of the calling function, or NULL if unknown. - - This is intended to be called via the debug_enter macro. */ - -void -do_debug_enter (const char *function_name) -{ - if (function_name != NULL) - debug_printf (">>>> entering %s\n", function_name); -} - -/* Notify the user that the code is exiting FUNCTION_NAME. - FUNCTION_NAME is the name of the calling function, or NULL if unknown. - - This is intended to be called via the debug_exit macro. */ - -void -do_debug_exit (const char *function_name) -{ - if (function_name != NULL) - debug_printf ("<<<< exiting %s\n", function_name); -} - /* See debug.h. */ ssize_t |