From patchwork Thu Sep 18 09:59:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Benson X-Patchwork-Id: 2905 Received: (qmail 26575 invoked by alias); 18 Sep 2014 09:59:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 26436 invoked by uid 89); 18 Sep 2014 09:59:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 18 Sep 2014 09:59:14 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8I9xBwA008971 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 18 Sep 2014 05:59:12 -0400 Received: from blade.nx (ovpn-116-121.ams2.redhat.com [10.36.116.121]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8I9xAPV031934; Thu, 18 Sep 2014 05:59:11 -0400 Received: from blade.nx (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id 799982640DA; Thu, 18 Sep 2014 10:59:10 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Cc: Pedro Alves , Doug Evans Subject: [PATCH 3/3] Wait for target to stop before running agent commands Date: Thu, 18 Sep 2014 10:59:06 +0100 Message-Id: <1411034346-868-4-git-send-email-gbenson@redhat.com> In-Reply-To: <1411034346-868-1-git-send-email-gbenson@redhat.com> References: <1411034346-868-1-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes This commit fixes a bug on where agent_run_command is called on GNU/Linux targets that may not have stopped yet. gdb/ChangeLog: * linux-nat.c (linux_child_static_tracepoint_markers_by_strid): Use target_stop_and_wait in place of target_stop. --- gdb/ChangeLog | 5 +++++ gdb/linux-nat.c | 2 +- 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 5a82d23..f2895ff 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -4458,7 +4458,7 @@ linux_child_static_tracepoint_markers_by_strid (struct target_ops *self, ptid_t ptid = ptid_build (pid, 0, 0); /* Pause all */ - target_stop (ptid); + target_stop_and_wait (ptid); memcpy (s, "qTfSTM", sizeof ("qTfSTM")); s[sizeof ("qTfSTM")] = 0;