[PATCH 5/6] gdb/infrun: in condition evaluation do not stop all threads.
Natalia Saiapova
natalia.saiapova@intel.com
Mon Aug 31 12:35:18 GMT 2020
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 <natalia.saiapova@intel.com>
Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* infrun.c (stop_waiting): In condition evaluation do not stop
all threads.
Co-authored-by: Natalia Saiapova <natalia.saiapova@intel.com>
Co-authored-by: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Signed-off-by: Natalia Saiapova <natalia.saiapova@intel.com>
---
gdb/ChangeLog | 6 ++++++
gdb/infrun.c | 10 ++++++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d526c9fe46f..e80ace7e91f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2020-08-26 Natalia Saiapova <natalia.saiapova@intel.com>
+ Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
+
+ * infrun.c (stop_waiting): In condition evaluation, do not stop
+ all threads.
+
2020-08-26 Natalia Saiapova <natalia.saiapova@intel.com>
Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 19703c64c4e..0317c543b46 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -7766,9 +7766,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
More information about the Gdb-patches
mailing list