This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[gdbserver/linux] fix debug output being output with debug output disabled
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Sat, 28 Aug 2010 15:05:35 +0100
- Subject: [gdbserver/linux] fix debug output being output with debug output disabled
Applied.
--
Pedro Alves
2010-08-28 Pedro Alves <pedro@codesourcery.com>
* linux-low.c (linux_stabilize_threads): Wrap debug output in a
debug_threads check. Avoid a linear search when not doing debug
output.
---
gdb/gdbserver/linux-low.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
Index: src/gdb/gdbserver/linux-low.c
===================================================================
--- src.orig/gdb/gdbserver/linux-low.c 2010-08-28 14:37:36.000000000 +0100
+++ src/gdb/gdbserver/linux-low.c 2010-08-28 14:59:30.000000000 +0100
@@ -1884,8 +1884,9 @@ linux_stabilize_threads (void)
stuck_in_jump_pad_callback, NULL);
if (lwp_stuck != NULL)
{
- fprintf (stderr, "can't stabilize, LWP %ld is stuck in jump pad\n",
- lwpid_of (lwp_stuck));
+ if (debug_threads)
+ fprintf (stderr, "can't stabilize, LWP %ld is stuck in jump pad\n",
+ lwpid_of (lwp_stuck));
return;
}
@@ -1931,12 +1932,12 @@ linux_stabilize_threads (void)
current_inferior = save_inferior;
- lwp_stuck
- = (struct lwp_info *) find_inferior (&all_lwps,
- stuck_in_jump_pad_callback, NULL);
- if (lwp_stuck != NULL)
+ if (debug_threads)
{
- if (debug_threads)
+ lwp_stuck
+ = (struct lwp_info *) find_inferior (&all_lwps,
+ stuck_in_jump_pad_callback, NULL);
+ if (lwp_stuck != NULL)
fprintf (stderr, "couldn't stabilize, LWP %ld got stuck in jump pad\n",
lwpid_of (lwp_stuck));
}