aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2020-10-31 09:01:25 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-10-31 09:15:13 -0400
commit17417fb0ec9842de1774e1e76f1f11c00cdafc47 (patch)
tree861a3725250f36d393f8fbb222b303191cdc3511 /gdbsupport/common-debug.h
parentgdbserver: replace AC_TRY_COMPILE in acinclude.m4 (diff)
downloadbinutils-gdb-17417fb0ec9842de1774e1e76f1f11c00cdafc47.tar.gz
binutils-gdb-17417fb0ec9842de1774e1e76f1f11c00cdafc47.tar.bz2
binutils-gdb-17417fb0ec9842de1774e1e76f1f11c00cdafc47.zip
gdb, gdbsupport: add debug_prefixed_printf, remove boilerplate functions
The *_debug_print_1 functions are all very similar, the only difference being the subsystem name. Remove them all and make the logging macros use a new debug_prefixed_printf function directly. gdb/ChangeLog: * infrun.c (infrun_debug_printf_1): Remove. (displaced_debug_printf_1): Remove. (stop_all_threads): Use debug_prefixed_printf. * infrun.h (infrun_debug_printf_1): Remove. (infrun_debug_printf): Use debug_prefixed_printf. (displaced_debug_printf_1): Remove. (displaced_debug_printf): Use debug_prefixed_printf. * linux-nat.c (linux_nat_debug_printf_1): Remove. (linux_nat_debug_printf): Use debug_prefixed_printf. gdbsupport/ChangeLog: * common-debug.cc (debug_prefixed_printf): New. * common-debug.h (debug_prefixed_printf): New declaration. * event-loop.cc (event_loop_debug_printf_1): Remove. * event-loop.h (event_loop_debug_printf_1): Remove. (event_loop_debug_printf): Use debug_prefixed_printf. (event_loop_ui_debug_printf): Use debug_prefixed_printf. Change-Id: Ib323087c7257f0060121d302055c41eb64aa60c6
Diffstat (limited to 'gdbsupport/common-debug.h')
-rw-r--r--gdbsupport/common-debug.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdbsupport/common-debug.h b/gdbsupport/common-debug.h
index afb427e1800..f9ddccab063 100644
--- a/gdbsupport/common-debug.h
+++ b/gdbsupport/common-debug.h
@@ -41,6 +41,12 @@ extern void debug_vprintf (const char *format, va_list ap)
/* Print a debug statement prefixed with the module and function name, and
with a newline at the end. */
+extern void ATTRIBUTE_PRINTF (3, 4) debug_prefixed_printf
+ (const char *module, const char *func, const char *format, ...);
+
+/* Print a debug statement prefixed with the module and function name, and
+ with a newline at the end. */
+
extern void ATTRIBUTE_PRINTF (3, 0) debug_prefixed_vprintf
(const char *module, const char *func, const char *format, va_list args);