From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by sourceware.org (Postfix) with ESMTPS id C678F3861036 for ; Fri, 9 Oct 2020 11:29:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C678F3861036 IronPort-SDR: I0UnvCFZ+dCwN5hz4LRjKCyCbtglGkw/wC7JZfF/mOSkMtVx//8gn4cWLKbVSuWhOsa5ZSRfq7 TpqIX5AG7elA== X-IronPort-AV: E=McAfee;i="6000,8403,9768"; a="145337351" X-IronPort-AV: E=Sophos;i="5.77,354,1596524400"; d="scan'208";a="145337351" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 04:29:07 -0700 IronPort-SDR: 56jc6YZXwbr7SjcNDaGtrMs7sbjppfWoLWwcZdOl+JQMNaBE+C1eWSPE0tpmxG3/4LfIJhLS4s XYjY5q2pC27A== X-IronPort-AV: E=Sophos;i="5.77,354,1596524400"; d="scan'208";a="462156582" Received: from ulll2701.iul.intel.com (HELO localhost) ([172.28.50.171]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Oct 2020 04:29:06 -0700 From: Natalia Saiapova To: gdb-patches@sourceware.org Subject: [PATCH v2 5/6] gdb/infrun: in condition evaluation do not stop all threads. Date: Fri, 9 Oct 2020 13:27:17 +0200 Message-Id: <20201009112719.629-6-natalia.saiapova@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201009112719.629-1-natalia.saiapova@intel.com> References: <20200831123519.16232-1-natalia.saiapova () intel ! com> <20201009112719.629-1-natalia.saiapova@intel.com> X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Oct 2020 11:29:10 -0000 If a thread is evaluating a BP condition, do not stop other threads. Some of them might be already resumed due to the condition being evaluated as false. gdb/ChangeLog: 2020-08-26 Natalia Saiapova Tankut Baris Aktemur * infrun.c (stop_waiting): In condition evaluation do not stop all threads. Co-authored-by: Natalia Saiapova Co-authored-by: Tankut Baris Aktemur Signed-off-by: Natalia Saiapova --- gdb/infrun.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index d260eb6e3a7..286af5abbe1 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -7764,9 +7764,15 @@ stop_waiting (struct execution_control_state *ecs) /* Let callers know we don't want to wait for the inferior anymore. */ ecs->wait_some_more = 0; + bool in_cond_eval = ecs->event_thread != nullptr + && ecs->event_thread->control.in_cond_eval; + /* If all-stop, but there exists a non-stop target, stop all - threads now that we're presenting the stop to the user. */ - if (!non_stop && exists_non_stop_target ()) + threads now that we're presenting the stop to the user. + Do not stop, if the event thread is evaluating a BP condition. + This will be handled elsewhere depending on the result of + the condition. */ + if (!non_stop && exists_non_stop_target () && !in_cond_eval) stop_all_threads (); } -- 2.17.1 Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Gary Kershaw Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928