mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-20 12:51:10 +08:00
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
This commit is contained in:

committed by
Simon Marchi

parent
1eb8556f5a
commit
c426fddb87
13
gdb/debug.c
13
gdb/debug.c
@ -19,6 +19,8 @@
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#include "debug.h"
|
||||
|
||||
/* See gdbsupport/common-debug.h. */
|
||||
|
||||
void
|
||||
@ -26,3 +28,14 @@ debug_vprintf (const char *fmt, va_list ap)
|
||||
{
|
||||
vfprintf_unfiltered (gdb_stdlog, fmt, ap);
|
||||
}
|
||||
|
||||
/* See debug.h. */
|
||||
|
||||
void
|
||||
debug_prefixed_vprintf (const char *module, const char *func, const char *format,
|
||||
va_list args)
|
||||
{
|
||||
debug_printf ("[%s] %s: ", module, func);
|
||||
debug_vprintf (format, args);
|
||||
debug_printf ("\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user