aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2020-08-24 15:50:19 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2020-08-24 15:50:19 -0400
commitc426fddb87d29034b50c2433e12a08aa23b7fb9f (patch)
treead01131718b794781fa9bf10ee550e7e9acd181a /gdb/linux-nat.c
parent1eb8556f5a8b5712e765b9615f7c18ffb50253b6 (diff)
downloadgdb-c426fddb87d29034b50c2433e12a08aa23b7fb9f.zip
gdb-c426fddb87d29034b50c2433e12a08aa23b7fb9f.tar.gz
gdb-c426fddb87d29034b50c2433e12a08aa23b7fb9f.tar.bz2
gdb: add debug_prefixed_vprintf
To help ensure that all debug statements have the same format, introduce the debug_prefixed_vprintf helper. Implement linux_nat_debug_printf_1 and infrun_debug_printf_1 with it. I would eventually like to style the module and function name with some color, to help them stick out, but I don't really know how to do that yet, it can always be done later. gdb/ChangeLog: * debug.h: New file. * debug.c (debug_prefixed_vprintf): New function. * infrun.c (infrun_debug_printf_1): Use debug_prefixed_vprintf. * linux-nat.c (linux_nat_debug_printf_1): Likewise. Change-Id: Iccc290a2dc6b5fffcbe1c2866ed8d804ad380764
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 7a4387f..b810140 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -68,6 +68,7 @@
#include "gdbsupport/fileio.h"
#include "gdbsupport/scope-exit.h"
#include "gdbsupport/gdb-sigmask.h"
+#include "debug.h"
/* This comment documents high-level logic of this file.
@@ -203,14 +204,10 @@ show_debug_linux_nat (struct ui_file *file, int from_tty,
static void ATTRIBUTE_PRINTF (2, 3)
linux_nat_debug_printf_1 (const char *func_name, const char *fmt, ...)
{
- debug_printf ("[linux-nat] %s: ", func_name);
-
va_list ap;
va_start (ap, fmt);
- debug_vprintf (fmt, ap);
+ debug_prefixed_vprintf ("linux-nat", func_name, fmt, ap);
va_end (ap);
-
- debug_printf ("\n");
}
#define linux_nat_debug_printf(fmt, ...) \