diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2020-12-11 13:48:11 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2020-12-11 14:01:12 -0500 |
commit | 74b773fcd658c52554a6af07c657f677c52f8102 (patch) | |
tree | b192e163ad6ce311802e338938c9fd7e8dfddb51 /gdb/infrun.h | |
parent | 346e7e192370a4d602e14466825c329ed5920c8f (diff) | |
download | fsf-binutils-gdb-74b773fcd658c52554a6af07c657f677c52f8102.zip fsf-binutils-gdb-74b773fcd658c52554a6af07c657f677c52f8102.tar.gz fsf-binutils-gdb-74b773fcd658c52554a6af07c657f677c52f8102.tar.bz2 |
gdb: factor out debug_prefixed_printf_cond
The same pattern happens often to define a "debug_printf" macro:
#define displaced_debug_printf(fmt, ...) \
do \
{ \
if (debug_displaced) \
debug_prefixed_printf ("displaced", __func__, fmt, ##__VA_ARGS__); \
} \
while (0)
Move this pattern behind a helper macro, debug_prefixed_printf_cond and
update the existing macros to use it.
gdb/ChangeLog:
* displaced-stepping.h (displaced_debug_printf): Use
debug_prefixed_printf_cond.
* dwarf2/read.c (dwarf_read_debug_printf): Likewise.
(dwarf_read_debug_printf_v): Likewise.
* infrun.h (infrun_debug_printf): Likewise.
* linux-nat.c (linux_nat_debug_printf): Likewise.
gdbsupport/ChangeLog:
* common-debug.h (debug_prefixed_printf_cond): New.
* event-loop.h (event_loop_debug_printf): Use
debug_prefixed_printf_cond.
Change-Id: I1ff48b98b8d1cc405d1c7e8da8ceadf4e3a17f99
Diffstat (limited to 'gdb/infrun.h')
-rw-r--r-- | gdb/infrun.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/gdb/infrun.h b/gdb/infrun.h index d5e6d27..4a4db84 100644 --- a/gdb/infrun.h +++ b/gdb/infrun.h @@ -34,12 +34,7 @@ extern unsigned int debug_infrun; /* Print an "infrun" debug statement. */ #define infrun_debug_printf(fmt, ...) \ - do \ - { \ - if (debug_infrun) \ - debug_prefixed_printf ("infrun", __func__, fmt, ##__VA_ARGS__); \ - } \ - while (0) + debug_prefixed_printf_cond (debug_infrun, "infrun",fmt, ##__VA_ARGS__) /* Nonzero if we want to give control to the user when we're notified of shared library events by the dynamic linker. */ |