aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2021-02-22 00:18:10 +0000
committerPedro Alves <pedro@palves.net>2021-03-26 15:57:25 +0000
commite5b9b39f8872fa01efb9c7f8ce7283fb9cd5122d (patch)
tree608471a450639b33a4c3eac3fe91f137681aab3b /gdb
parentbab287cdcfb47ac472da9e8d3c8db8b15880c12c (diff)
downloadgdb-e5b9b39f8872fa01efb9c7f8ce7283fb9cd5122d.zip
gdb-e5b9b39f8872fa01efb9c7f8ce7283fb9cd5122d.tar.gz
gdb-e5b9b39f8872fa01efb9c7f8ce7283fb9cd5122d.tar.bz2
target_is_non_stop_p and sync targets
gdb.base/maint-target-async-off.exp fails if you test against gdbserver with "maint set target-non-stop on" forced. (gdb) run Starting program: build/gdb/testsuite/outputs/gdb.base/maint-target-async-off/maint-target-async-off Breakpoint 1, main () at src/gdb/testsuite/gdb.base/maint-target-async-off.c:21 21 return 0; (gdb) FAIL: gdb.base/maint-target-async-off.exp: continue until exit (timeout) Above, GDB just stopped listening to stdin. Basically, GDB assumes that a target working in non-stop mode operation also supports async mode; it's a requirement. GDB misbehaves badly otherwise, and even hits failed assertions. Fix this by making target_is_non_stop_p return false if async is off. gdb/ChangeLog: * target.c (target_always_non_stop_p): Also check whether the target can async. Change-Id: I7e52e1061396a5b9b02ada462f68a14b76d68974
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/target.c9
2 files changed, 10 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8e7b920..7f60d3c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2021-03-26 Pedro Alves <pedro@palves.net>
+
+ * target.c (target_always_non_stop_p): Also check whether the
+ target can async.
+
2021-03-26 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (dwarf2_read_debug_names)
diff --git a/gdb/target.c b/gdb/target.c
index 3653a7a..51832c5 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -4370,10 +4370,11 @@ target_always_non_stop_p (void)
bool
target_is_non_stop_p ()
{
- return (non_stop
- || target_non_stop_enabled == AUTO_BOOLEAN_TRUE
- || (target_non_stop_enabled == AUTO_BOOLEAN_AUTO
- && target_always_non_stop_p ()));
+ return ((non_stop
+ || target_non_stop_enabled == AUTO_BOOLEAN_TRUE
+ || (target_non_stop_enabled == AUTO_BOOLEAN_AUTO
+ && target_always_non_stop_p ()))
+ && target_can_async_p ());
}
/* See target.h. */