aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2021-01-26 08:49:09 -0700
committerTom Tromey <tromey@adacore.com>2021-01-26 08:49:38 -0700
commit4ef367bffd73d50002339deba40983530ccb9d15 (patch)
treeac8dfce86b54c0a06df34d4a130f68365df61c5f /gdb/nat
parent4cb1265b3f906cbfd092715b61bb81a8f6179a49 (diff)
downloadgdb-4ef367bffd73d50002339deba40983530ccb9d15.zip
gdb-4ef367bffd73d50002339deba40983530ccb9d15.tar.gz
gdb-4ef367bffd73d50002339deba40983530ccb9d15.tar.bz2
Use debug_prefixed_printf_cond in windows-nat.c
This changes windows-nat.c and nat/windows-nat.c to use the new debug_prefixed_printf_cond facility. I tried this out on a Windows build and I think it makes the output look a little nicer. 2021-01-26 Tom Tromey <tromey@adacore.com> * windows-nat.c (DEBUG_EXEC, DEBUG_EVENTS, DEBUG_MEM) (DEBUG_EXCEPT): Use debug_prefixed_printf_cond. (windows_init_thread_list, windows_nat::handle_load_dll) (windows_nat::handle_unload_dll, windows_nat_target::resume) (windows_nat_target::resume) (windows_nat_target::get_windows_debug_event) (windows_nat_target::interrupt, windows_xfer_memory) (windows_nat_target::close): Update. * nat/windows-nat.c (DEBUG_EVENTS): Use debug_prefixed_printf_cond. (matching_pending_stop, fetch_pending_stop) (continue_last_debug_event): Update.
Diffstat (limited to 'gdb/nat')
-rw-r--r--gdb/nat/windows-nat.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c
index bdf6f3f..659a756 100644
--- a/gdb/nat/windows-nat.c
+++ b/gdb/nat/windows-nat.c
@@ -47,7 +47,9 @@ bool ignore_first_breakpoint = false;
/* Note that 'debug_events' must be locally defined in the relevant
functions. */
-#define DEBUG_EVENTS(x) if (debug_events) debug_printf x
+#define DEBUG_EVENTS(fmt, ...) \
+ debug_prefixed_printf_cond (debug_events, "windows events", fmt, \
+ ## __VA_ARGS__)
windows_thread_info::~windows_thread_info ()
{
@@ -334,9 +336,8 @@ matching_pending_stop (bool debug_events)
if (desired_stop_thread_id == -1
|| desired_stop_thread_id == item.thread_id)
{
- DEBUG_EVENTS (("windows_continue - pending stop anticipated, "
- "desired=0x%x, item=0x%x\n",
- desired_stop_thread_id, item.thread_id));
+ DEBUG_EVENTS ("pending stop anticipated, desired=0x%x, item=0x%x",
+ desired_stop_thread_id, item.thread_id);
return true;
}
}
@@ -360,9 +361,8 @@ fetch_pending_stop (bool debug_events)
result = *iter;
current_event = iter->event;
- DEBUG_EVENTS (("get_windows_debug_event - "
- "pending stop found in 0x%x (desired=0x%x)\n",
- iter->thread_id, desired_stop_thread_id));
+ DEBUG_EVENTS ("pending stop found in 0x%x (desired=0x%x)",
+ iter->thread_id, desired_stop_thread_id);
pending_stops.erase (iter);
break;
@@ -377,11 +377,11 @@ fetch_pending_stop (bool debug_events)
BOOL
continue_last_debug_event (DWORD continue_status, bool debug_events)
{
- DEBUG_EVENTS (("ContinueDebugEvent (cpid=%d, ctid=0x%x, %s);\n",
- (unsigned) last_wait_event.dwProcessId,
- (unsigned) last_wait_event.dwThreadId,
- continue_status == DBG_CONTINUE ?
- "DBG_CONTINUE" : "DBG_EXCEPTION_NOT_HANDLED"));
+ DEBUG_EVENTS ("ContinueDebugEvent (cpid=%d, ctid=0x%x, %s)",
+ (unsigned) last_wait_event.dwProcessId,
+ (unsigned) last_wait_event.dwThreadId,
+ continue_status == DBG_CONTINUE ?
+ "DBG_CONTINUE" : "DBG_EXCEPTION_NOT_HANDLED");
return ContinueDebugEvent (last_wait_event.dwProcessId,
last_wait_event.dwThreadId,