diff options
author | Tom Tromey <tom@tromey.com> | 2021-12-26 21:38:34 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2022-01-09 18:59:52 -0700 |
commit | a42a74331c9d81be166a2f8587d17a967b8eefe0 (patch) | |
tree | 1a4e273e8058eb3277dc2b45c0d8a76096f9c7d6 /gdb/i386-darwin-nat.c | |
parent | 4bb12b295ad02980e0f90571d24c64e8687e3ee9 (diff) | |
download | binutils-a42a74331c9d81be166a2f8587d17a967b8eefe0.zip binutils-a42a74331c9d81be166a2f8587d17a967b8eefe0.tar.gz binutils-a42a74331c9d81be166a2f8587d17a967b8eefe0.tar.bz2 |
Reduce use of unfiltered output in Darwin code
The Darwin code uses unfiltered output liberally. This patch changes
this code to send some output to gdb_stdlog (in some cases via the use
of debug_prefixed_printf_cond_nofunc), or to gdb_stderr, or to simply
switch to filtered output.
Note that I didn't switch inferior_debug to use
debug_prefixed_printf_cond_nofunc, because that would affect the
output by removing the information about the inferior. I wasn't sure
if this was important or not, so I left it in.
v2 of this patch uses warning rather than prints to gdb_stderr, and
removes some trailing whitespace.
I can't compile this patch, so it's "best effort".
Diffstat (limited to 'gdb/i386-darwin-nat.c')
-rw-r--r-- | gdb/i386-darwin-nat.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/gdb/i386-darwin-nat.c b/gdb/i386-darwin-nat.c index b7199da..b64b2b3 100644 --- a/gdb/i386-darwin-nat.c +++ b/gdb/i386-darwin-nat.c @@ -77,9 +77,9 @@ i386_darwin_nat_target::fetch_registers (struct regcache *regcache, int regno) &gp_count); if (ret != KERN_SUCCESS) { - printf_unfiltered (_("Error calling thread_get_state for " - "GP registers for thread 0x%lx\n"), - (unsigned long) current_thread); + warning (_("Error calling thread_get_state for " + "GP registers for thread 0x%lx\n"), + (unsigned long) current_thread); MACH_CHECK_ERROR (ret); } @@ -102,9 +102,9 @@ i386_darwin_nat_target::fetch_registers (struct regcache *regcache, int regno) &fp_count); if (ret != KERN_SUCCESS) { - printf_unfiltered (_("Error calling thread_get_state for " - "float registers for thread 0x%lx\n"), - (unsigned long) current_thread); + warning (_("Error calling thread_get_state for " + "float registers for thread 0x%lx\n"), + (unsigned long) current_thread); MACH_CHECK_ERROR (ret); } amd64_supply_fxsave (regcache, -1, &fp_regs.ufs.fs64.__fpu_fcw); @@ -126,9 +126,9 @@ i386_darwin_nat_target::fetch_registers (struct regcache *regcache, int regno) &gp_count); if (ret != KERN_SUCCESS) { - printf_unfiltered (_("Error calling thread_get_state for " - "GP registers for thread 0x%lx\n"), - (unsigned long) current_thread); + warning (_("Error calling thread_get_state for " + "GP registers for thread 0x%lx\n"), + (unsigned long) current_thread); MACH_CHECK_ERROR (ret); } for (i = 0; i < I386_NUM_GREGS; i++) @@ -150,9 +150,9 @@ i386_darwin_nat_target::fetch_registers (struct regcache *regcache, int regno) &fp_count); if (ret != KERN_SUCCESS) { - printf_unfiltered (_("Error calling thread_get_state for " - "float registers for thread 0x%lx\n"), - (unsigned long) current_thread); + warning (_("Error calling thread_get_state for " + "float registers for thread 0x%lx\n"), + (unsigned long) current_thread); MACH_CHECK_ERROR (ret); } i387_supply_fxsave (regcache, -1, &fp_regs.__fpu_fcw); @@ -588,8 +588,8 @@ darwin_set_sstep (thread_t thread, int enable) (thread_state_t) ®s, &count); if (kret != KERN_SUCCESS) { - printf_unfiltered (_("darwin_set_sstep: error %x, thread=%x\n"), - kret, thread); + warning (_("darwin_set_sstep: error %x, thread=%x\n"), + kret, thread); return; } |