[2/2] gdb/testsuite: tighten up some end-of-line patterns

Message ID 90f05fc11d1bf8fc39af46ac057a48e1327174e2.1701280438.git.aburgess@redhat.com
State New
Headers
Series A few minor testsuite cleanups |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Andrew Burgess Nov. 29, 2023, 5:55 p.m. UTC
  Following on from the previous commit, I searched the testsuite for
places where we did:

  set eol "<some pattern>"

in most cases the <some pattern> could be replaced with "\r\n" though
in the stabs test I've switched to using the multi_line proc as that
seemed like a better choice.

In gdb.ada/info_types.exp I did need to add an extra use of $eol as
the previous pattern would match multiple newlines, and in this one
place we were actually expecting to match multiple newlines.  The
tighter pattern only matches a single newline, so we now need to be
explicit when multiple newlines are expected -- I think this is a good
thing.

All the tests are still passing for me after these changes.
---
 gdb/testsuite/gdb.ada/catch_assert_if.exp |  2 +-
 gdb/testsuite/gdb.ada/catch_ex.exp        |  2 +-
 gdb/testsuite/gdb.ada/dyn_loc.exp         |  2 +-
 gdb/testsuite/gdb.ada/excep_handle.exp    |  2 +-
 gdb/testsuite/gdb.ada/frame_args.exp      |  2 +-
 gdb/testsuite/gdb.ada/info_types.exp      |  4 ++--
 gdb/testsuite/gdb.base/info-target.exp    |  2 +-
 gdb/testsuite/gdb.base/nofield.exp        |  2 +-
 gdb/testsuite/gdb.cp/local.exp            |  2 +-
 gdb/testsuite/gdb.stabs/exclfwd.exp       | 20 +++++++++++---------
 10 files changed, 21 insertions(+), 19 deletions(-)
  

Comments

Tom Tromey Nov. 30, 2023, 7:23 p.m. UTC | #1
>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

Andrew> Following on from the previous commit, I searched the testsuite for
Andrew> places where we did:

Andrew>   set eol "<some pattern>"

Andrew> in most cases the <some pattern> could be replaced with "\r\n" though
Andrew> in the stabs test I've switched to using the multi_line proc as that
Andrew> seemed like a better choice.

Andrew> In gdb.ada/info_types.exp I did need to add an extra use of $eol as
Andrew> the previous pattern would match multiple newlines, and in this one
Andrew> place we were actually expecting to match multiple newlines.  The
Andrew> tighter pattern only matches a single newline, so we now need to be
Andrew> explicit when multiple newlines are expected -- I think this is a good
Andrew> thing.

Andrew> All the tests are still passing for me after these changes.

Looks good to me, thank you.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Tom de Vries Dec. 8, 2023, 10:25 p.m. UTC | #2
On 11/30/23 20:23, Tom Tromey wrote:
>>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
> 
> Andrew> Following on from the previous commit, I searched the testsuite for
> Andrew> places where we did:
> 
> Andrew>   set eol "<some pattern>"
> 
> Andrew> in most cases the <some pattern> could be replaced with "\r\n" though
> Andrew> in the stabs test I've switched to using the multi_line proc as that
> Andrew> seemed like a better choice.
> 
> Andrew> In gdb.ada/info_types.exp I did need to add an extra use of $eol as
> Andrew> the previous pattern would match multiple newlines, and in this one
> Andrew> place we were actually expecting to match multiple newlines.  The
> Andrew> tighter pattern only matches a single newline, so we now need to be
> Andrew> explicit when multiple newlines are expected -- I think this is a good
> Andrew> thing.
> 
> Andrew> All the tests are still passing for me after these changes.
> 
> Looks good to me, thank you.
> Approved-By: Tom Tromey <tom@tromey.com>

I  see some regressions:
...
FAIL: gdb.ada/catch_assert_if.exp: continuing to expected failed assertion
FAIL: gdb.ada/catch_ex.exp: continuing to first exception
FAIL: gdb.ada/catch_ex.exp: continuing to second exception
FAIL: gdb.ada/catch_ex.exp: continuing to Program_Error exception
FAIL: gdb.ada/catch_ex.exp: continuing to failed assertion
FAIL: gdb.ada/catch_ex.exp: continuing to unhandled exception
FAIL: gdb.ada/catch_ex.exp: continuing to temporary catchpoint
FAIL: gdb.ada/excep_handle.exp: continuing to first Constraint_Error 
exception handlers
FAIL: gdb.ada/excep_handle.exp: continuing and stopping in Storage_Error 
exception handlers
FAIL: gdb.ada/excep_handle.exp: continuing without stopping to 
Program_Error exception handlers
FAIL: gdb.ada/excep_handle.exp: continuing without stopping to 
Storage_Error exception handlers
FAIL: gdb.ada/excep_handle.exp: continuing to second Constraint_Error 
exception handlers
FAIL: gdb.ada/excep_handle.exp: continuing to Program_Error exception 
handlers
...

For instance:
...
(gdb) PASS: gdb.ada/catch_assert_if.exp: Check catch assertions with 
condition
continue^M
Continuing.^M
^M
Catchpoint 2, failed assertion at 0x000000000040201a in bla () at 
/data/vries/gdb/binutils-gdb.git/gdb/testsuite/gdb.ada/catch_assert_if/bla.adb:32^M
32            pragma Assert (Global_Var = 1, "Error #2"); -- STOP^M
(gdb) FAIL: gdb.ada/catch_assert_if.exp: continuing to expected failed 
assertion
...

Thanks,
- Tom
  
Tom de Vries Dec. 9, 2023, 6:59 a.m. UTC | #3
On 12/8/23 23:25, Tom de Vries wrote:
> On 11/30/23 20:23, Tom Tromey wrote:
>>>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
>>
>> Andrew> Following on from the previous commit, I searched the 
>> testsuite for
>> Andrew> places where we did:
>>
>> Andrew>   set eol "<some pattern>"
>>
>> Andrew> in most cases the <some pattern> could be replaced with "\r\n" 
>> though
>> Andrew> in the stabs test I've switched to using the multi_line proc 
>> as that
>> Andrew> seemed like a better choice.
>>
>> Andrew> In gdb.ada/info_types.exp I did need to add an extra use of 
>> $eol as
>> Andrew> the previous pattern would match multiple newlines, and in 
>> this one
>> Andrew> place we were actually expecting to match multiple newlines.  The
>> Andrew> tighter pattern only matches a single newline, so we now need 
>> to be
>> Andrew> explicit when multiple newlines are expected -- I think this 
>> is a good
>> Andrew> thing.
>>
>> Andrew> All the tests are still passing for me after these changes.
>>
>> Looks good to me, thank you.
>> Approved-By: Tom Tromey <tom@tromey.com>
> 
> I  see some regressions:
> ...
> FAIL: gdb.ada/catch_assert_if.exp: continuing to expected failed assertion
> FAIL: gdb.ada/catch_ex.exp: continuing to first exception
> FAIL: gdb.ada/catch_ex.exp: continuing to second exception
> FAIL: gdb.ada/catch_ex.exp: continuing to Program_Error exception
> FAIL: gdb.ada/catch_ex.exp: continuing to failed assertion
> FAIL: gdb.ada/catch_ex.exp: continuing to unhandled exception
> FAIL: gdb.ada/catch_ex.exp: continuing to temporary catchpoint
> FAIL: gdb.ada/excep_handle.exp: continuing to first Constraint_Error 
> exception handlers
> FAIL: gdb.ada/excep_handle.exp: continuing and stopping in Storage_Error 
> exception handlers
> FAIL: gdb.ada/excep_handle.exp: continuing without stopping to 
> Program_Error exception handlers
> FAIL: gdb.ada/excep_handle.exp: continuing without stopping to 
> Storage_Error exception handlers
> FAIL: gdb.ada/excep_handle.exp: continuing to second Constraint_Error 
> exception handlers
> FAIL: gdb.ada/excep_handle.exp: continuing to Program_Error exception 
> handlers
> ...
> 
> For instance:
> ...
> (gdb) PASS: gdb.ada/catch_assert_if.exp: Check catch assertions with 
> condition
> continue^M
> Continuing.^M
> ^M
> Catchpoint 2, failed assertion at 0x000000000040201a in bla () at 
> /data/vries/gdb/binutils-gdb.git/gdb/testsuite/gdb.ada/catch_assert_if/bla.adb:32^M
> 32            pragma Assert (Global_Var = 1, "Error #2"); -- STOP^M
> (gdb) FAIL: gdb.ada/catch_assert_if.exp: continuing to expected failed 
> assertion
> ...

I see this failure both with openSUSE Leap 15.4 and openSUSE Tumbleweed.

Fixed on both by:
...
diff --git a/gdb/testsuite/gdb.ada/catch_assert_if.exp 
b/gdb/testsuite/gdb.ada/catch_assert_if.exp
index 9b094d88dc8..dd9db10ebe1 100644
--- a/gdb/testsuite/gdb.ada/catch_assert_if.exp
+++ b/gdb/testsuite/gdb.ada/catch_assert_if.exp
@@ -52,7 +52,7 @@ set bp_location [gdb_get_line_number "STOP" 
${testdir}/bla.adb]
  set catchpoint_msg \
    "Catchpoint $decimal, failed assertion at $hex in bla \\\(\\\).*at 
.*bla.adb:$bp_location"
  gdb_test "continue" \
-         "Continuing\.$eol$catchpoint_msg$eol.*STOP" \
+         "Continuing\.$eol$eol$catchpoint_msg$eol.*STOP" \
           "continuing to expected failed assertion"

  gdb_test "continue" \
...

Does this pass for you without this patch?

Thanks,
- Tom
  
Andrew Burgess Dec. 11, 2023, 2:52 p.m. UTC | #4
Tom de Vries <tdevries@suse.de> writes:

> On 12/8/23 23:25, Tom de Vries wrote:
>> On 11/30/23 20:23, Tom Tromey wrote:
>>>>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
>>>
>>> Andrew> Following on from the previous commit, I searched the 
>>> testsuite for
>>> Andrew> places where we did:
>>>
>>> Andrew>   set eol "<some pattern>"
>>>
>>> Andrew> in most cases the <some pattern> could be replaced with "\r\n" 
>>> though
>>> Andrew> in the stabs test I've switched to using the multi_line proc 
>>> as that
>>> Andrew> seemed like a better choice.
>>>
>>> Andrew> In gdb.ada/info_types.exp I did need to add an extra use of 
>>> $eol as
>>> Andrew> the previous pattern would match multiple newlines, and in 
>>> this one
>>> Andrew> place we were actually expecting to match multiple newlines.  The
>>> Andrew> tighter pattern only matches a single newline, so we now need 
>>> to be
>>> Andrew> explicit when multiple newlines are expected -- I think this 
>>> is a good
>>> Andrew> thing.
>>>
>>> Andrew> All the tests are still passing for me after these changes.
>>>
>>> Looks good to me, thank you.
>>> Approved-By: Tom Tromey <tom@tromey.com>
>> 
>> I  see some regressions:
>> ...
>> FAIL: gdb.ada/catch_assert_if.exp: continuing to expected failed assertion
>> FAIL: gdb.ada/catch_ex.exp: continuing to first exception
>> FAIL: gdb.ada/catch_ex.exp: continuing to second exception
>> FAIL: gdb.ada/catch_ex.exp: continuing to Program_Error exception
>> FAIL: gdb.ada/catch_ex.exp: continuing to failed assertion
>> FAIL: gdb.ada/catch_ex.exp: continuing to unhandled exception
>> FAIL: gdb.ada/catch_ex.exp: continuing to temporary catchpoint
>> FAIL: gdb.ada/excep_handle.exp: continuing to first Constraint_Error 
>> exception handlers
>> FAIL: gdb.ada/excep_handle.exp: continuing and stopping in Storage_Error 
>> exception handlers
>> FAIL: gdb.ada/excep_handle.exp: continuing without stopping to 
>> Program_Error exception handlers
>> FAIL: gdb.ada/excep_handle.exp: continuing without stopping to 
>> Storage_Error exception handlers
>> FAIL: gdb.ada/excep_handle.exp: continuing to second Constraint_Error 
>> exception handlers
>> FAIL: gdb.ada/excep_handle.exp: continuing to Program_Error exception 
>> handlers
>> ...
>> 
>> For instance:
>> ...
>> (gdb) PASS: gdb.ada/catch_assert_if.exp: Check catch assertions with 
>> condition
>> continue^M
>> Continuing.^M
>> ^M
>> Catchpoint 2, failed assertion at 0x000000000040201a in bla () at 
>> /data/vries/gdb/binutils-gdb.git/gdb/testsuite/gdb.ada/catch_assert_if/bla.adb:32^M
>> 32            pragma Assert (Global_Var = 1, "Error #2"); -- STOP^M
>> (gdb) FAIL: gdb.ada/catch_assert_if.exp: continuing to expected failed 
>> assertion
>> ...
>
> I see this failure both with openSUSE Leap 15.4 and openSUSE Tumbleweed.
>
> Fixed on both by:
> ...
> diff --git a/gdb/testsuite/gdb.ada/catch_assert_if.exp 
> b/gdb/testsuite/gdb.ada/catch_assert_if.exp
> index 9b094d88dc8..dd9db10ebe1 100644
> --- a/gdb/testsuite/gdb.ada/catch_assert_if.exp
> +++ b/gdb/testsuite/gdb.ada/catch_assert_if.exp
> @@ -52,7 +52,7 @@ set bp_location [gdb_get_line_number "STOP" 
> ${testdir}/bla.adb]
>   set catchpoint_msg \
>     "Catchpoint $decimal, failed assertion at $hex in bla \\\(\\\).*at 
> .*bla.adb:$bp_location"
>   gdb_test "continue" \
> -         "Continuing\.$eol$catchpoint_msg$eol.*STOP" \
> +         "Continuing\.$eol$eol$catchpoint_msg$eol.*STOP" \
>            "continuing to expected failed assertion"
>
>   gdb_test "continue" \
> ...
>
> Does this pass for you without this patch?

All the tests you listed are showing as UNSUPPORTED for me due to the
runtime debuginfo package being missing.  So far I've been unable to
find/install the correct package.

The change above looks reasonable to me, I suspect all these tests will
be fixed by similar updates.

FWIW, have a pre-approval for fixes for these regressions.  And thanks
for looking into these.

Approved-By: Andrew Burgess <aburgess@redhat.com>

Thanks,
Andrew
  
Tom de Vries Dec. 11, 2023, 2:55 p.m. UTC | #5
On 12/11/23 15:52, Andrew Burgess wrote:
> Tom de Vries <tdevries@suse.de> writes:
> 
>> On 12/8/23 23:25, Tom de Vries wrote:
>>> On 11/30/23 20:23, Tom Tromey wrote:
>>>>>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:
>>>>
>>>> Andrew> Following on from the previous commit, I searched the
>>>> testsuite for
>>>> Andrew> places where we did:
>>>>
>>>> Andrew>   set eol "<some pattern>"
>>>>
>>>> Andrew> in most cases the <some pattern> could be replaced with "\r\n"
>>>> though
>>>> Andrew> in the stabs test I've switched to using the multi_line proc
>>>> as that
>>>> Andrew> seemed like a better choice.
>>>>
>>>> Andrew> In gdb.ada/info_types.exp I did need to add an extra use of
>>>> $eol as
>>>> Andrew> the previous pattern would match multiple newlines, and in
>>>> this one
>>>> Andrew> place we were actually expecting to match multiple newlines.  The
>>>> Andrew> tighter pattern only matches a single newline, so we now need
>>>> to be
>>>> Andrew> explicit when multiple newlines are expected -- I think this
>>>> is a good
>>>> Andrew> thing.
>>>>
>>>> Andrew> All the tests are still passing for me after these changes.
>>>>
>>>> Looks good to me, thank you.
>>>> Approved-By: Tom Tromey <tom@tromey.com>
>>>
>>> I  see some regressions:
>>> ...
>>> FAIL: gdb.ada/catch_assert_if.exp: continuing to expected failed assertion
>>> FAIL: gdb.ada/catch_ex.exp: continuing to first exception
>>> FAIL: gdb.ada/catch_ex.exp: continuing to second exception
>>> FAIL: gdb.ada/catch_ex.exp: continuing to Program_Error exception
>>> FAIL: gdb.ada/catch_ex.exp: continuing to failed assertion
>>> FAIL: gdb.ada/catch_ex.exp: continuing to unhandled exception
>>> FAIL: gdb.ada/catch_ex.exp: continuing to temporary catchpoint
>>> FAIL: gdb.ada/excep_handle.exp: continuing to first Constraint_Error
>>> exception handlers
>>> FAIL: gdb.ada/excep_handle.exp: continuing and stopping in Storage_Error
>>> exception handlers
>>> FAIL: gdb.ada/excep_handle.exp: continuing without stopping to
>>> Program_Error exception handlers
>>> FAIL: gdb.ada/excep_handle.exp: continuing without stopping to
>>> Storage_Error exception handlers
>>> FAIL: gdb.ada/excep_handle.exp: continuing to second Constraint_Error
>>> exception handlers
>>> FAIL: gdb.ada/excep_handle.exp: continuing to Program_Error exception
>>> handlers
>>> ...
>>>
>>> For instance:
>>> ...
>>> (gdb) PASS: gdb.ada/catch_assert_if.exp: Check catch assertions with
>>> condition
>>> continue^M
>>> Continuing.^M
>>> ^M
>>> Catchpoint 2, failed assertion at 0x000000000040201a in bla () at
>>> /data/vries/gdb/binutils-gdb.git/gdb/testsuite/gdb.ada/catch_assert_if/bla.adb:32^M
>>> 32            pragma Assert (Global_Var = 1, "Error #2"); -- STOP^M
>>> (gdb) FAIL: gdb.ada/catch_assert_if.exp: continuing to expected failed
>>> assertion
>>> ...
>>
>> I see this failure both with openSUSE Leap 15.4 and openSUSE Tumbleweed.
>>
>> Fixed on both by:
>> ...
>> diff --git a/gdb/testsuite/gdb.ada/catch_assert_if.exp
>> b/gdb/testsuite/gdb.ada/catch_assert_if.exp
>> index 9b094d88dc8..dd9db10ebe1 100644
>> --- a/gdb/testsuite/gdb.ada/catch_assert_if.exp
>> +++ b/gdb/testsuite/gdb.ada/catch_assert_if.exp
>> @@ -52,7 +52,7 @@ set bp_location [gdb_get_line_number "STOP"
>> ${testdir}/bla.adb]
>>    set catchpoint_msg \
>>      "Catchpoint $decimal, failed assertion at $hex in bla \\\(\\\).*at
>> .*bla.adb:$bp_location"
>>    gdb_test "continue" \
>> -         "Continuing\.$eol$catchpoint_msg$eol.*STOP" \
>> +         "Continuing\.$eol$eol$catchpoint_msg$eol.*STOP" \
>>             "continuing to expected failed assertion"
>>
>>    gdb_test "continue" \
>> ...
>>
>> Does this pass for you without this patch?
> 
> All the tests you listed are showing as UNSUPPORTED for me due to the
> runtime debuginfo package being missing.  So far I've been unable to
> find/install the correct package.
> 

Ah, I see.

> The change above looks reasonable to me, I suspect all these tests will
> be fixed by similar updates.
> 
> FWIW, have a pre-approval for fixes for these regressions.  And thanks
> for looking into these.
> 

Ok, I'll fix these then using this approach.

Thanks,
- Tom

> Approved-By: Andrew Burgess <aburgess@redhat.com>
> 
> Thanks,
> Andrew
>
  
Tom de Vries Dec. 11, 2023, 4:16 p.m. UTC | #6
On 12/11/23 15:55, Tom de Vries wrote:
> Ok, I'll fix these then using this approach.

Pushed as attached.

Thanks,
- Tom
  
Andrew Burgess Dec. 11, 2023, 4:44 p.m. UTC | #7
Tom de Vries <tdevries@suse.de> writes:

> On 12/11/23 15:55, Tom de Vries wrote:
>> Ok, I'll fix these then using this approach.
>
> Pushed as attached.

Thanks for fixing this.

Andrew


>
> Thanks,
> - Tom
> From 6a48bc988b57f94e2accc3899152a7b0c4946ada Mon Sep 17 00:00:00 2001
> From: Tom de Vries <tdevries@suse.de>
> Date: Mon, 11 Dec 2023 16:18:23 +0100
> Subject: [pushed] [gdb/testsuite] Fix $eol regexp usage in some test-cases
>
> Commit cff71358132 ("gdb/testsuite: tighten up some end-of-line patterns") replaced:
> ...
> set eol "\[\r\n\]+"
> ...
> with the more strict:
> ...
> set eol "\r\n"
> ...
> in a few test-cases, but didn't update all uses of eol accordingly.
>
> Fix this in three gdb.ada test-cases.
>
> Tested on x86_64-linux.
>
> Approved-By: Andrew Burgess <aburgess@redhat.com>
> ---
>  gdb/testsuite/gdb.ada/catch_assert_if.exp |  2 +-
>  gdb/testsuite/gdb.ada/catch_ex.exp        | 12 ++++++------
>  gdb/testsuite/gdb.ada/excep_handle.exp    | 12 ++++++------
>  3 files changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/gdb/testsuite/gdb.ada/catch_assert_if.exp b/gdb/testsuite/gdb.ada/catch_assert_if.exp
> index 9b094d88dc8..3071c4a5e06 100644
> --- a/gdb/testsuite/gdb.ada/catch_assert_if.exp
> +++ b/gdb/testsuite/gdb.ada/catch_assert_if.exp
> @@ -52,7 +52,7 @@ set bp_location [gdb_get_line_number "STOP" ${testdir}/bla.adb]
>  set catchpoint_msg \
>    "Catchpoint $decimal, failed assertion at $hex in bla \\\(\\\).*at .*bla.adb:$bp_location"
>  gdb_test "continue" \
> -         "Continuing\.$eol$catchpoint_msg$eol.*STOP" \
> +	 "Continuing\.$eol$eol$catchpoint_msg$eol.*STOP" \
>           "continuing to expected failed assertion"
>  
>  gdb_test "continue" \
> diff --git a/gdb/testsuite/gdb.ada/catch_ex.exp b/gdb/testsuite/gdb.ada/catch_ex.exp
> index 22175d83c07..19f743db7a6 100644
> --- a/gdb/testsuite/gdb.ada/catch_ex.exp
> +++ b/gdb/testsuite/gdb.ada/catch_ex.exp
> @@ -55,13 +55,13 @@ gdb_test "info break" \
>  set catchpoint_msg \
>    "Catchpoint $any_nb, CONSTRAINT_ERROR (\\\(ignore C_E\\\) )?at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
>  gdb_test "continue" \
> -         "Continuing\.$eol$catchpoint_msg$eol.*SPOT1" \
> +	 "Continuing\.$eol$eol$catchpoint_msg$eol.*SPOT1" \
>           "continuing to first exception"
>  
>  set catchpoint_msg \
>    "Catchpoint $any_nb, PROGRAM_ERROR (\\\(foo\\.adb:$decimal explicit raise\\\) )?at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
>  gdb_test "continue" \
> -         "Continuing\.$eol$catchpoint_msg$eol.*SPOT2" \
> +	 "Continuing\.$eol$eol$catchpoint_msg$eol.*SPOT2" \
>           "continuing to second exception"
>  
>  ################################################
> @@ -108,19 +108,19 @@ gdb_test "info break" \
>  set catchpoint_msg \
>    "Catchpoint $any_nb, PROGRAM_ERROR (\\\(foo.adb:$decimal explicit raise\\\) )?at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
>  gdb_test "continue" \
> -         "Continuing\.$eol$catchpoint_msg$eol.*SPOT2" \
> +	 "Continuing\.$eol$eol$catchpoint_msg$eol.*SPOT2" \
>           "continuing to Program_Error exception"
>  
>  set catchpoint_msg \
>    "Catchpoint $any_nb, failed assertion at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
>  gdb_test "continue" \
> -         "Continuing\.$eol$catchpoint_msg$eol.*SPOT3" \
> +	 "Continuing\.$eol$eol$catchpoint_msg$eol.*SPOT3" \
>           "continuing to failed assertion"
>  
>  set catchpoint_msg \
>    "Catchpoint $any_nb, unhandled CONSTRAINT_ERROR at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
>  gdb_test "continue" \
> -         "Continuing\.$eol$catchpoint_msg$eol.*SPOT4" \
> +	 "Continuing\.$eol$eol$catchpoint_msg$eol.*SPOT4" \
>           "continuing to unhandled exception"
>  
>  gdb_test "continue" \
> @@ -148,7 +148,7 @@ gdb_test "tcatch exception" \
>  set temp_catchpoint_msg \
>    "Temporary catchpoint $any_nb, CONSTRAINT_ERROR (\\\(.*\\\) )?at $any_addr in foo \\\(\\\).*at .*foo.adb:$any_nb"
>  gdb_test "continue" \
> -         "Continuing\.$eol$temp_catchpoint_msg$eol.*SPOT1" \
> +	 "Continuing\.$eol$eol$temp_catchpoint_msg$eol.*SPOT1" \
>           "continuing to temporary catchpoint"
>  
>  with_test_prefix "temporary catchpoint" {
> diff --git a/gdb/testsuite/gdb.ada/excep_handle.exp b/gdb/testsuite/gdb.ada/excep_handle.exp
> index 590c7fccdec..f1ce24a1682 100644
> --- a/gdb/testsuite/gdb.ada/excep_handle.exp
> +++ b/gdb/testsuite/gdb.ada/excep_handle.exp
> @@ -55,7 +55,7 @@ gdb_test "catch handlers" \
>  # Continue.  The program should stop at first exception handling.
>  
>  gdb_test "continue" \
> -    "Continuing\.$eol$catchpoint_constraint_error_msg" \
> +    "Continuing\.$eol$eol$catchpoint_constraint_error_msg" \
>      "continuing to first Constraint_Error exception handlers"
>  
>  # Resume the program's exception.
> @@ -66,7 +66,7 @@ gdb_test "continue" \
>  # the next exception being raised.
>  
>  gdb_test "continue" \
> -    "Continuing\.$eol$catchpoint_storage_error_msg" \
> +    "Continuing\.$eol$eol$catchpoint_storage_error_msg" \
>      "continuing and stopping in Storage_Error exception handlers"
>  
>  gdb_test_no_output "delete 2" \
> @@ -85,7 +85,7 @@ gdb_test "catch handlers Program_Error" \
>  # Continue, we should not stop at ABORT_SIGNAL but at Program_Error one.
>  
>  gdb_test "continue" \
> -    "Continuing\.$eol$catchpoint_program_error_msg" \
> +    "Continuing\.$eol$eol$catchpoint_program_error_msg" \
>      "continuing without stopping to Program_Error exception handlers"
>  
>  gdb_test_no_output \
> @@ -101,7 +101,7 @@ gdb_test "catch handlers Storage_Error" \
>  # Continue, we should stop at Storage_Error handlers.
>  
>  gdb_test "continue" \
> -    "Continuing\.$eol$catchpoint_storage_error_msg" \
> +    "Continuing\.$eol$eol$catchpoint_storage_error_msg" \
>      "continuing without stopping to Storage_Error exception handlers"
>  
>  gdb_test_no_output \
> @@ -126,7 +126,7 @@ gdb_test "info breakpoint" "stop only if Global_Var = 2" \
>  # Continue, we should not stop at ABORT_SIGNAL but at Program_Error one.
>  
>  gdb_test "continue" \
> -    "Continuing\.$eol$catchpoint_constraint_error_msg" \
> +    "Continuing\.$eol$eol$catchpoint_constraint_error_msg" \
>      "continuing to second Constraint_Error exception handlers"
>  
>  gdb_test_no_output \
> @@ -148,7 +148,7 @@ gdb_test "catch handlers Program_Error if Global_Var = 4" \
>  # the second one.
>  
>  gdb_test "continue" \
> -    "Continuing\.$eol$catchpoint_program_error_msg" \
> +    "Continuing\.$eol$eol$catchpoint_program_error_msg" \
>      "continuing to Program_Error exception handlers"
>  
>  # Continue, the program should exit properly.
>
> base-commit: 9394690cb87b5ddc575b333bd0595b07a7a72c60
> -- 
> 2.35.3
  

Patch

diff --git a/gdb/testsuite/gdb.ada/catch_assert_if.exp b/gdb/testsuite/gdb.ada/catch_assert_if.exp
index 4078fa408d1..9b094d88dc8 100644
--- a/gdb/testsuite/gdb.ada/catch_assert_if.exp
+++ b/gdb/testsuite/gdb.ada/catch_assert_if.exp
@@ -25,7 +25,7 @@  if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug additional
 
 clean_restart ${testfile}
 
-set eol "\[\r\n\]+"
+set eol "\r\n"
 set sp "\[ \t\]*"
 
 # Here is the scenario:
diff --git a/gdb/testsuite/gdb.ada/catch_ex.exp b/gdb/testsuite/gdb.ada/catch_ex.exp
index 388eb949e37..22175d83c07 100644
--- a/gdb/testsuite/gdb.ada/catch_ex.exp
+++ b/gdb/testsuite/gdb.ada/catch_ex.exp
@@ -29,7 +29,7 @@  clean_restart ${testfile}
 # the regular expressions below.
 set any_nb "\[0-9\]+"
 set any_addr "0x\[0-9a-zA-Z\]+"
-set eol "\[\r\n\]+"
+set eol "\r\n"
 set sp "\[ \t\]*"
 
 set info_break_header "Num${sp}Type${sp}Disp${sp}Enb${sp}Address${sp}What"
diff --git a/gdb/testsuite/gdb.ada/dyn_loc.exp b/gdb/testsuite/gdb.ada/dyn_loc.exp
index 5e656ca8ccf..ef30a3c41d7 100644
--- a/gdb/testsuite/gdb.ada/dyn_loc.exp
+++ b/gdb/testsuite/gdb.ada/dyn_loc.exp
@@ -30,7 +30,7 @@  if {![runto "pack.adb:$bp_location"]} {
   return -1
 }
 
-set eol "\[\r\n\]+"
+set eol "\r\n"
 
 set test "info locals"
 gdb_test_multiple "$test" "$test" {
diff --git a/gdb/testsuite/gdb.ada/excep_handle.exp b/gdb/testsuite/gdb.ada/excep_handle.exp
index deb3ace2987..590c7fccdec 100644
--- a/gdb/testsuite/gdb.ada/excep_handle.exp
+++ b/gdb/testsuite/gdb.ada/excep_handle.exp
@@ -27,7 +27,7 @@  clean_restart ${testfile}
 
 # Some global variables used to simplify the maintenance of some of
 # the regular expressions below.
-set eol "\[\r\n\]+"
+set eol "\r\n"
 set sp "\[ \t\]*"
 
 set when "when"
diff --git a/gdb/testsuite/gdb.ada/frame_args.exp b/gdb/testsuite/gdb.ada/frame_args.exp
index baaf5181121..891f241ce46 100644
--- a/gdb/testsuite/gdb.ada/frame_args.exp
+++ b/gdb/testsuite/gdb.ada/frame_args.exp
@@ -27,7 +27,7 @@  clean_restart ${testfile}
 
 set any_nb "\[0-9\]+"
 set any_addr "0x\[0-9a-zA-Z\]+"
-set eol "\[\r\n\]+"
+set eol "\r\n"
 set sp "\[ \t\]*"
 
 if {![runto break_me]} {
diff --git a/gdb/testsuite/gdb.ada/info_types.exp b/gdb/testsuite/gdb.ada/info_types.exp
index 2e1f51a6e4d..eac4bb5ae64 100644
--- a/gdb/testsuite/gdb.ada/info_types.exp
+++ b/gdb/testsuite/gdb.ada/info_types.exp
@@ -26,8 +26,8 @@  if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
 # when the Ada language is being used.
 gdb_test "set lang ada" ""
 
-set eol "\[\r\n\]+"
+set eol "\r\n"
 
 gdb_test "info types new_integer_type" \
-         "All types matching regular expression \"new_integer_type\":${eol}File .*info_types.c:${eol}.*\tint"
+         "All types matching regular expression \"new_integer_type\":${eol}${eol}File .*info_types.c:${eol}.*\tint"
 
diff --git a/gdb/testsuite/gdb.base/info-target.exp b/gdb/testsuite/gdb.base/info-target.exp
index ef55575aaf6..67e11c42520 100644
--- a/gdb/testsuite/gdb.base/info-target.exp
+++ b/gdb/testsuite/gdb.base/info-target.exp
@@ -20,7 +20,7 @@  if { [prepare_for_testing "failed to prepare" $testfile $srcfile] } {
     return -1
 }
 
-set eol "\[\r\n\]+"
+set eol "\r\n"
 
 # Check the output of "info target".  Note that we are not interested
 # in this case in checking the actual info, but rather to make sure that
diff --git a/gdb/testsuite/gdb.base/nofield.exp b/gdb/testsuite/gdb.base/nofield.exp
index 6fbda7524c6..98c540f4cfd 100644
--- a/gdb/testsuite/gdb.base/nofield.exp
+++ b/gdb/testsuite/gdb.base/nofield.exp
@@ -20,7 +20,7 @@  if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debu
     return -1
 }
 
-set eol "\[\r\n\]+"
+set eol "\r\n"
 set sp "\[ \t\]*"
 
 clean_restart ${binfile}
diff --git a/gdb/testsuite/gdb.cp/local.exp b/gdb/testsuite/gdb.cp/local.exp
index 67b3eb7308d..7d84f57117d 100644
--- a/gdb/testsuite/gdb.cp/local.exp
+++ b/gdb/testsuite/gdb.cp/local.exp
@@ -157,7 +157,7 @@  gdb_test "up" ".*main.*" "up from marker2"
 # Make sure that `Local' isn't in scope here; it's local to foobar.
 # setup_kfail "gdb/825"
 
-set eol "\[\t \]*\[\r\n\]+\[\t \]*"
+set eol "\[\t \]*\r\n\[\t \]*"
 gdb_test_multiple "ptype Local" "local out of scope" {
     -re "No symbol \"Local\" in current context.*${gdb_prompt} $" {
         pass "local out of scope"
diff --git a/gdb/testsuite/gdb.stabs/exclfwd.exp b/gdb/testsuite/gdb.stabs/exclfwd.exp
index a6e6ff86046..7492dc5ebb4 100644
--- a/gdb/testsuite/gdb.stabs/exclfwd.exp
+++ b/gdb/testsuite/gdb.stabs/exclfwd.exp
@@ -35,19 +35,21 @@  if {![runto_main]} {
 
 get_debug_format
 
-set eol "\[ \t\]*\[\n\r\]+"
-
-gdb_test "ptype v1" "type = struct a {$eol
-    int x;$eol
-    int y;$eol
-}"
+gdb_test "ptype v1" \
+    [multi_line \
+	 "type = struct a {" \
+	 "    int x;" \
+	 "    int y;" \
+	 "}"]
 
 if {[test_debug_format "stabs"]} {
     setup_kfail "gdb/1602" *-*-*
 }
-gdb_test "ptype v2" "type = struct a {$eol
-    const char .c;$eol
-}"
+gdb_test "ptype v2" \
+    [multi_line \
+	 "type = struct a {" \
+	 "    const char .c;" \
+	 "}"]
 
 if {[test_debug_format "stabs"]} {
     setup_kfail "gdb/1603" *-*-*