From: Pedro Alves Date: Sat, 28 Aug 2010 14:03:27 +0000 (+0000) Subject: * linux-low.c (linux_stabilize_threads): Wrap debug output in a X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b4d51a55f99ed33da4f4d061c18d0e4fca63a29b;p=binutils-gdb.git * linux-low.c (linux_stabilize_threads): Wrap debug output in a debug_threads check. Avoid a linear search when not doing debug output. --- diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 6ba13dd49db..fc7bb909828 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 0f6c543fbba..cbcb84024c9 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)); }