aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-10-07 05:45:32 +0200
committerTom de Vries <tdevries@suse.de>2021-10-07 05:45:32 +0200
commitcf4505a7ec012daa6c22aacc4a785c9346ed6372 (patch)
tree43cfd68b4e6a1d28b99f59e1d74f32b7894dc5cf /gdb/testsuite
parent82f2f39d81580493abed59809423b5787949bc65 (diff)
downloadgdb-cf4505a7ec012daa6c22aacc4a785c9346ed6372.zip
gdb-cf4505a7ec012daa6c22aacc4a785c9346ed6372.tar.gz
gdb-cf4505a7ec012daa6c22aacc4a785c9346ed6372.tar.bz2
[gdb/testsuite] Refactor regexp in gdb.base/annota1.exp
Refactor regexp in gdb.base/annota1.exp to reduce indentation and repetition. Tested on x86_64-linux.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/gdb.base/annota1.exp56
1 files changed, 35 insertions, 21 deletions
diff --git a/gdb/testsuite/gdb.base/annota1.exp b/gdb/testsuite/gdb.base/annota1.exp
index 13c9a48..7a08137 100644
--- a/gdb/testsuite/gdb.base/annota1.exp
+++ b/gdb/testsuite/gdb.base/annota1.exp
@@ -127,29 +127,43 @@ gdb_test_multiple "info break" "breakpoint info" {
#exp_internal 1
set binexp [string_to_regexp $binfile]
-set run_re [join [list "\r\n\032\032post-prompt\r\nStarting program: $binexp " \
- "\(\(\r\nReading \[^\r\n\]+\)|\(\r\nwarning: File transfers from remote targets can be slow\[^\r\n\]+\)\)*" \
- "\(\r\nwarning: Skipping \[^\r\n\]+ .gdb_index section in \[^\r\n\]+\r\nDo \"set use-deprecated-index-sections on\" before the file is read\r\nto use the section anyway\\.\)?" \
- "\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n" \
- "\032\032starting\(\(\r\nReading \[^\r\n\]+\)|\(\r\nwarning: File transfers from remote targets can be slow\[^\r\n\]+\)\)*" \
- "\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n" \
- "\032\032breakpoint 1\r\n\r\n" \
- "Breakpoint 1, \r\n" \
- "\032\032frame-begin 0 $hex\r\n\r\n" \
- "\032\032frame-function-name\r\n" \
- "main\r\n" \
- "\032\032frame-args\r\n \\(\\)\r\n" \
- "\032\032frame-source-begin\r\n at \r\n" \
- "\032\032frame-source-file\r\n.*annota1.c\r\n" \
- "\032\032frame-source-file-end\r\n:\r\n" \
- "\032\032frame-source-line\r\n$main_line\r\n" \
- "\032\032frame-source-end\r\n\r\n\r\n" \
- "\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n" \
- "\032\032frame-end\r\n\r\n" \
- "\032\032stopped.*$gdb_prompt$" ] "" ]
+set warning_slow_re \
+ "warning: File transfers from remote targets can be slow\[^\r\n\]+"
+set warning_gdb_index_re \
+ [multi_line \
+ "warning: Skipping \[^\r\n\]+ .gdb_index section in \[^\r\n\]+" \
+ "Do \"set use-deprecated-index-sections on\" before the file is read" \
+ "to use the section anyway\\."]
+set reading_re \
+ "Reading \[^\r\n\]+"
+
+set run_re \
+ [list \
+ "\r\n\032\032post-prompt\r\nStarting program: $binexp " \
+ "\(\(\r\n$reading_re\)|\(\r\n$warning_slow_re\)\)*" \
+ "\(\r\n$warning_gdb_index_re\)?" \
+ "\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n" \
+ "\032\032starting\(\(\r\n$reading_re\)|\(\r\n$warning_slow_re\)\)*" \
+ "\(\(\r\n\r\n\032\032frames-invalid\)|\(\r\n\r\n\032\032breakpoints-invalid\)\)*\r\n\r\n" \
+ "\032\032breakpoint 1\r\n\r\n" \
+ "Breakpoint 1, \r\n" \
+ "\032\032frame-begin 0 $hex\r\n\r\n" \
+ "\032\032frame-function-name\r\n" \
+ "main\r\n" \
+ "\032\032frame-args\r\n \\(\\)\r\n" \
+ "\032\032frame-source-begin\r\n at \r\n" \
+ "\032\032frame-source-file\r\n.*annota1.c\r\n" \
+ "\032\032frame-source-file-end\r\n:\r\n" \
+ "\032\032frame-source-line\r\n$main_line\r\n" \
+ "\032\032frame-source-end\r\n\r\n\r\n" \
+ "\032\032source.*$srcfile:$main_line:.*:beg:$hex\r\n\r\n" \
+ "\032\032frame-end\r\n\r\n" \
+ "\032\032stopped"]
+
+set run_re [join $run_re ""]
gdb_test_multiple "run" "run until main breakpoint" {
- -re $run_re {
+ -re $run_re.*$gdb_prompt$ {
pass $gdb_test_name
}
}