Allow multiple occurrences of the frames-invalid annotation in gdb.cp/annota2.exp
authorYao Qi <yao.qi@linaro.org>
Fri, 27 Nov 2015 14:21:47 +0000 (14:21 +0000)
committerYao Qi <yao.qi@linaro.org>
Fri, 27 Nov 2015 14:21:47 +0000 (14:21 +0000)
Hi,
I see one fail on aarch64-linux testing,

  FAIL: gdb.cp/annota2.exp: watch triggered on a.x (timeout)

because GDB prints two frames-invalid annotation but the test expects
only one.

next^M
^M
^Z^Zpost-prompt^M
^M
^Z^Zstarting^M
^M
^Z^Zframes-invalid^M
^M
^Z^Zframes-invalid^M
^M
Note I also see the fail on Debian-s390x-m64 too.
https://sourceware.org/ml/gdb-testers/2015-q4/msg07291.html

The test shouldn't only expect one frames-invalid annotation, because
there can be multiple times of stop/resume before the user visible
stop.  Ulrich did something similar before
https://www.sourceware.org/ml/gdb-patches/2009-06/msg00118.html

This patch only changes ${frames_invalid} to \(${frames_invalid}\)*
in the regexp pattern.

The patch below fixes the fail on aarch64-linux.

gdb/testsuite:

2015-11-27  Yao Qi  <yao.qi@linaro.org>

* gdb.cp/annota2.exp: Allow multiple occurrences of the
frames-invalid annotation.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/annota2.exp

index f03b3c17440311bd79c06e11d716a2eb5e8878d2..bff404d5cf74c1f3e078af080240742c621440ac 100644 (file)
@@ -1,3 +1,8 @@
+2015-11-27  Yao Qi  <yao.qi@linaro.org>
+
+       * gdb.cp/annota2.exp: Allow multiple occurrences of the
+       frames-invalid annotation.
+
 2015-11-27  Yao Qi  <yao.qi@linaro.org>
 
        * gdb.cp/annota2.exp: Use ${frames_invalid}.
index 041f65df2f407586e4b4fb2f921c2c03256224d4..ed3fd1b07bf6f84e58a449dad78d31d571d48561 100644 (file)
@@ -162,7 +162,7 @@ gdb_test_multiple "watch a.x" "set watch on a.x" {
 # annotate-watchpoint
 #
 gdb_test_multiple "next" "watch triggered on a.x" {
-    -re "\r\n\032\032post-prompt\r\n\r\n\032\032starting\r\n${frames_invalid}${breakpoints_invalid}\r\n\032\032watchpoint 3\r\n.*atchpoint 3: a.x\r\n\r\nOld value = 0\r\nNew value = 1\r\n\r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*$srcfile\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$decimal\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source .*$srcfile.*beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n.*$gdb_prompt$" {
+    -re "\r\n\032\032post-prompt\r\n\r\n\032\032starting\r\n\(${frames_invalid}\)*${breakpoints_invalid}\r\n\032\032watchpoint 3\r\n.*atchpoint 3: a.x\r\n\r\nOld value = 0\r\nNew value = 1\r\n\r\n\032\032frame-begin 0 $hex\r\n\r\n\032\032frame-function-name\r\nmain\r\n\032\032frame-args\r\n \\(\\)\r\n\032\032frame-source-begin\r\n at \r\n\032\032frame-source-file\r\n.*$srcfile\r\n\032\032frame-source-file-end\r\n:\r\n\032\032frame-source-line\r\n$decimal\r\n\032\032frame-source-end\r\n\r\n\r\n\032\032source .*$srcfile.*beg:$hex\r\n\r\n\032\032frame-end\r\n\r\n\032\032stopped\r\n.*$gdb_prompt$" {
        pass "watch triggered on a.x"
     }
 }