aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2019-10-14 00:37:30 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2019-10-14 12:12:24 -0400
commit9223170f68f85787b9cd85e76d3bac3eaa69cafb (patch)
tree701269c506c632fb511b9e136ef4e81688e1f757
parent6acc1a0b9d3dd16741474891eddbf77415cd70b1 (diff)
downloadgdb-9223170f68f85787b9cd85e76d3bac3eaa69cafb.zip
gdb-9223170f68f85787b9cd85e76d3bac3eaa69cafb.tar.gz
gdb-9223170f68f85787b9cd85e76d3bac3eaa69cafb.tar.bz2
gdb.mi/list-thread-groups-available.exp: read entries one by one instead of increasing timeout
Commit 580f1034 ("Increase timeout in gdb.mi/list-thread-groups-available.exp") changed gdb.mi/list-thread-groups-available.exp to significantly increase the timeout, which was necessary for when running with make check-read1. Pedro suggested a better alternative, which is to use gdb_test_multiple and consume one entry at a time. This patch does that. gdb/testsuite/ChangeLog: * gdb.mi/list-thread-groups-available.exp: Read entries one by one instead of increasing timeout. Change-Id: I51b689458503240f24e401f054e6583d9172ebdf
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.mi/list-thread-groups-available.exp27
2 files changed, 23 insertions, 9 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ba72489..ce6e0f2 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2019-10-14 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * gdb.mi/list-thread-groups-available.exp: Read entries one by
+ one instead of increasing timeout.
+
2019-10-13 Tom de Vries <tdevries@suse.de>
PR record/25038
diff --git a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp b/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
index ab5c716..3a7517f 100644
--- a/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
+++ b/gdb/testsuite/gdb.mi/list-thread-groups-available.exp
@@ -54,15 +54,24 @@ set cores_re "cores=\\\[(\"$decimal\"(,\"$decimal\")*)?\\\]"
# List all available processes.
set process_entry_re "{${id_re},${type_re}(,$description_re)?(,$user_re)?(,$cores_re)?}"
-# Increase the timeout: when running with `make check-read1`, this can take
-# a bit of time, as there is a lot of output generated, hence a lot of read
-# syscalls.
-with_read1_timeout_factor 10 {
- mi_gdb_test \
- "-list-thread-groups --available" \
- "\\^done,groups=\\\[${process_entry_re}(,$process_entry_re)*\\\]" \
- "list available thread groups"
-}
+# The list can be long, so read entries one by one to avoid hitting the
+# timeout (especially when running with check-read1).
+gdb_test_multiple "-list-thread-groups --available" "list available thread groups" {
+ -re "\\^done,groups=\\\[" {
+ # The beginning of the response.
+ exp_continue
+ }
+
+ -re "${process_entry_re}," {
+ # All entries except the last one.
+ exp_continue
+ }
+
+ -re "${process_entry_re}\\\]\r\n${mi_gdb_prompt}" {
+ # The last entry.
+ pass $gdb_test_name
+ }
+} $mi_gdb_prompt
# List specific processes, make sure there are two entries.
set spawn_id_1 [remote_spawn target $binfile]