public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: [gdbserver/linux] fix debug output being output with debug output disabled
Date: Sat, 28 Aug 2010 14:05:00 -0000	[thread overview]
Message-ID: <201008281505.36173.pedro@codesourcery.com> (raw)

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));
     }

                 reply	other threads:[~2010-08-28 14:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201008281505.36173.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).