This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Allow multiple occurrences of the frames-invalid annotation in gdb.cp/annota2.exp
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Mon, 23 Nov 2015 17:48:43 +0000
- Subject: Re: [PATCH] Allow multiple occurrences of the frames-invalid annotation in gdb.cp/annota2.exp
- Authentication-results: sourceware.org; auth=none
- References: <1448293310-18824-1-git-send-email-yao dot qi at linaro dot org>
On 11/23/2015 03:41 PM, Yao Qi wrote:
> 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.
Looks fine to me.
> diff --git a/gdb/testsuite/gdb.cp/annota2.exp b/gdb/testsuite/gdb.cp/annota2.exp
> index 041f65d..ed3fd1b 100644
> --- a/gdb/testsuite/gdb.cp/annota2.exp
> +++ b/gdb/testsuite/gdb.cp/annota2.exp
> @@ -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"
For a rainy day: I think these tests would be much more readable
if they used multi_line...
Thanks,
Pedro Alves