From b4d51a55f99ed33da4f4d061c18d0e4fca63a29b Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Sat, 28 Aug 2010 14:03:27 +0000 Subject: [PATCH] * 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/ChangeLog | 6 ++++++ gdb/gdbserver/linux-low.c | 15 ++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 6ba13dd49d..fc7bb90982 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,9 @@ +2010-08-28 Pedro Alves + + * linux-low.c (linux_stabilize_threads): Wrap debug output in a + debug_threads check. Avoid a linear search when not doing debug + output. + 2010-08-27 Pedro Alves * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 0f6c543fbb..cbcb84024c 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -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)); } -- 2.34.1