]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbserver: introduce threads_debug_printf, THREADS_SCOPED_DEBUG_ENTER_EXIT
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 17 Jan 2022 02:27:58 +0000 (21:27 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 18 Jan 2022 18:44:32 +0000 (13:44 -0500)
commitc058728c31684d08da396f1bf50fabaa196dc9d9
tree8e0d08d18cf135f7071fa9ee37dd549ee86656a8
parentc68665c7260985ac8497ccafcea961f4a261c675
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
13 files changed:
gdbserver/ax.cc
gdbserver/debug.cc
gdbserver/debug.h
gdbserver/fork-child.cc
gdbserver/linux-aarch64-low.cc
gdbserver/linux-low.cc
gdbserver/linux-s390-low.cc
gdbserver/linux-x86-low.cc
gdbserver/mem-break.cc
gdbserver/remote-utils.cc
gdbserver/server.cc
gdbserver/thread-db.cc
gdbserver/tracepoint.cc