From patchwork Mon Sep 26 02:25:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 16006 Received: (qmail 115094 invoked by alias); 26 Sep 2016 02:25:33 -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 114943 invoked by uid 89); 26 Sep 2016 02:25:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=iow X-HELO: mail-pf0-f196.google.com Received: from mail-pf0-f196.google.com (HELO mail-pf0-f196.google.com) (209.85.192.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Sep 2016 02:25:22 +0000 Received: by mail-pf0-f196.google.com with SMTP id q2so8375181pfj.0 for ; Sun, 25 Sep 2016 19:25:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=fxY6t4D3akDDkNvpdMLeuZ27sgO5WLl8MbbA/TpXFgo=; b=FFttdXg7AR8sZamK9ZZ913Fr3XL8pTHh+xjGwktKDcHrVg5tlkZaOd3kwgoc/LGtug KSOh990grpSwp9GLG9KKUwH2828NHLt3IMWWjhaYItKRGDG15l+Q42R0gglPyC1+27IX 4bMKywjLVDkup/zpGKQ9FF5yrPtaBUb6vE53sthXKhxB934jBV1oN2geXQd1pwyv7rqd m97ioBfTfvVc09rlOVvIgT0XLB5aivY/nRHeyjzGpCjx/NcinpyEwY2W2fYcF8Rq6Xlf qUW0NNt5WnIrbJiJX/dDcrE8wD8cvwUjDwSkrOabzRG+3YnosggFe8P/uCVIYTAi4FJe wSfw== X-Gm-Message-State: AE9vXwMd7C8FOkdifBGYQ9Cr7GO9PHLBhUmrgDH4A8IjG6dLrZFhGODambKSjCXV9fvyUg== X-Received: by 10.98.131.193 with SMTP id h184mr33878493pfe.92.1474856720317; Sun, 25 Sep 2016 19:25:20 -0700 (PDT) Received: from localhost.localdomain (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id m82sm26179741pfk.64.2016.09.25.19.25.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 Sep 2016 19:25:19 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 1/3] Remove single-step breakpoint for GDBserver internal event Date: Mon, 26 Sep 2016 03:25:14 +0100 Message-Id: <1474856716-5913-2-git-send-email-yao.qi@linaro.org> In-Reply-To: <1474856716-5913-1-git-send-email-yao.qi@linaro.org> References: <1474856716-5913-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes This patch removes single-step breakpoints if the event is only GDBserver internal, IOW, isn't reported back to GDB. gdb/gdbserver: 2016-09-25 Yao Qi * linux-low.c (linux_wait_1): If single-step breakpoints are inserted, remove them. --- gdb/gdbserver/linux-low.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 4203b92..fd3cd5a 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -3670,17 +3670,31 @@ linux_wait_1 (ptid_t ptid, (*the_low_target.set_pc) (regcache, event_child->stop_pc); } - /* We may have finished stepping over a breakpoint. If so, - we've stopped and suspended all LWPs momentarily except the - stepping one. This is where we resume them all again. We're - going to keep waiting, so use proceed, which handles stepping - over the next breakpoint. */ - if (debug_threads) - debug_printf ("proceeding all threads.\n"); - if (step_over_finished) - unsuspend_all_lwps (event_child); + { + /* If we have finished stepping over a breakpoint, we've + stopped and suspended all LWPs momentarily except the + stepping one. This is where we resume them all again. + We're going to keep waiting, so use proceed, which + handles stepping over the next breakpoint. */ + unsuspend_all_lwps (event_child); + } + else + { + /* Remove the single-step breakpoints if any. Note that + there isn't single-step breakpoint if we finished stepping + over. */ + if (can_software_single_step () + && has_single_step_breakpoints (current_thread)) + { + stop_all_lwps (0, event_child); + delete_single_step_breakpoints (current_thread); + unstop_all_lwps (0, event_child); + } + } + if (debug_threads) + debug_printf ("proceeding all threads.\n"); proceed_all_lwps (); return ignore_event (ourstatus); }