This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA 7/8] Modify gdb.threads/threads.exp to test FLAGS vqcs for thread apply
- From: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- To: gdb-patches at sourceware dot org
- Cc: Philippe Waroquiers <philippe dot waroquiers at skynet dot be>
- Date: Mon, 21 May 2018 13:06:50 +0200
- Subject: [RFA 7/8] Modify gdb.threads/threads.exp to test FLAGS vqcs for thread apply
- Ironport-phdr: 9a23:fXTh2Bz696cJdPfXCy+O+j09IxM/srCxBDY+r6Qd2+4eIJqq85mqBkHD//Il1AaPAd2Araocw8Pt8InYEVQa5piAtH1QOLdtbDQizfssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1JuPoEYLOksi7ze+/94HdbglSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeuBWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbOSxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsDwULs6Wymt771zRRHolikJKjA3/mLQhMNygqJWuw6tqwBlzoLIeoyZKOZyc6XAdt0aX2pBWcNRWjRbDIO8bosPC+sBPf5Ar4bjulABrQGxBROrBOP21z9Ih2H53bch0+88FgzGxAwgH9MKsHTVtNX1LLkdXfq7zabS1zXDaOpW2Sr86IfWaBAhuuqBXalzccvRz0kgCR/Fgk+LpoP7Jj6Y0PkGvWuD7+d4SO6jl2oqpxtsrjWh2ssgkJTFipwUx1ze6yl0zpg5KNulQ0Bhe9GkCoFftySCOotzRcMtXn9ntT4hyr0DpZ67ZC8KyIk7xxLHa/yIbYyI4hX7WeaUPDh0nnJleLW6hxms6USgy+v8Wdeo0FtSsyZJjt3BumoQ2xHd9sSLUOZx8lmg1DqVyQze5P9ILVgxlaXBKp4hxrAwloAUsUTGBiL2gEX2jK6SdkUl4uio8/robq/op5CGLY90jRj+MrkvmsOhG+Q4KRMDX3OY+eW80r3s41H5TK9RgfIoiqXZqozVJdwHpq6lBA9Yyokj5AukADu/yNQXh2UHI05FeB2ZlIjkIErOIPflDfeln1ujjjlqyOrcPrL/GJnNKWLDkLj5d7Zn90Fc0BYzzcxY559MErEBIPPzWkvwtNzAFh82LRa4wuj9B9Vn0YMeQH+PAq6HP6PIql+F/fkvI+qMZY8Tpjn9N+Ip6OXwgixxpVhIcqWjmIMedHu4E+9OOEKEe3Hhnd4bHCENpAVtYvbtjQi6UT9XZm6qUuoD7ys8EZ+nAJ3YDtS1gL2F3T+jE9tJb3pBE02NHG3zX56HSvEBdGSYL5kywXQ/SbG9Rtp5hlmVvwjgxu8/Iw==
- References: <20180521110651.13842-1-philippe.waroquiers@skynet.be>
---
gdb/testsuite/gdb.threads/pthreads.exp | 65 ++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/gdb/testsuite/gdb.threads/pthreads.exp b/gdb/testsuite/gdb.threads/pthreads.exp
index 830432b833..5e05716117 100644
--- a/gdb/testsuite/gdb.threads/pthreads.exp
+++ b/gdb/testsuite/gdb.threads/pthreads.exp
@@ -267,6 +267,70 @@ proc check_backtraces {} {
}
}
+proc check_vqcs {} {
+ set any "\[^\r\n\]*"
+ set ws "\[ \t\]\+"
+ set number "\[0-9]\+"
+
+ # check -c (continue) and -s (silently continue) flags
+ gdb_test "thread apply 2-3 p notfound" \
+ [multi_line \
+ "" \
+ "Thread 2 ${any}" \
+ "No symbol \\\"notfound\\\" in current context." \
+ ] \
+ "Run a failing command that aborts thread apply"
+
+ gdb_test "thread apply 2-3 -c p notfound" \
+ [multi_line \
+ "" \
+ "Thread 2 ${any}" \
+ "No symbol \\\"notfound\\\" in current context." \
+ "" \
+ "Thread 3 ${any}" \
+ "No symbol \\\"notfound\\\" in current context." \
+ ] \
+ "Run a failing command, -c to continue"
+
+ foreach cmd {"thread apply all -s frame apply all -s p i" "tfaas p i" "taas faas p i"} {
+ gdb_test $cmd \
+ [multi_line \
+ "" \
+ "Thread 3 ${any}" \
+ "#${number}${ws}${any} in thread2 ${any}" \
+ "\\\$\[0-9]+ = ${number}${any}" \
+ "" \
+ "Thread 2 ${any}" \
+ "#${number}${ws}${any} in thread1 ${any}" \
+ "\\\$\[0-9]+ = ${number}${any}" \
+ ] \
+ "Run a failing command except in one frame of thread 2,3, -s to silently continue"
+ }
+
+ # Verbosity tests
+ gdb_test "thread apply all -sq frame apply all -s p i" \
+ [multi_line \
+ "#${number}${ws}${any} in thread2 ${any}" \
+ "\\\$\[0-9]+ = ${number}${any}" \
+ "#${number}${ws}${any} in thread1 ${any}" \
+ "\\\$\[0-9]+ = ${number}${any}" \
+ ] \
+ "Run a failing command except in one frame of thread 2,3, -s to silently continue. Verbosity 0 threads"
+
+ gdb_test "thread apply all -sq frame apply all -sqq p i" \
+ [multi_line \
+ "\\\$\[0-9]+ = ${number}${any}" \
+ "\\\$\[0-9]+ = ${number}${any}" \
+ ] \
+ "Run a failing command except in one frame of thread 2,3, -s to silently continue. Verbosity 0 threads and frames"
+
+ # check invalid flag combinations
+ gdb_test "thread apply all -cs p 1" \
+ "thread apply all: flags c and s are mutually exclusive" \
+ "Check c and s cannot be used simultaneously"
+
+}
+
if [runto_main] then {
if [test_startup] then {
if [check_control_c] then {
@@ -274,5 +338,6 @@ if [runto_main] then {
return
}
check_backtraces
+ check_vqcs
}
}
--
2.11.0