public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] A few minor testsuite cleanups
@ 2023-11-29 17:55 Andrew Burgess
  2023-11-29 17:55 ` [PATCH 1/2] gdb/testsuite: fix gdb.ada/complete.exp timeout in READ1 mode Andrew Burgess
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Andrew Burgess @ 2023-11-29 17:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

Patch #1 fixes a timeout in gdb.ada/complete.exp when READ1 is used.

Patch #2 performs some wider cleanup, inspired by patch #1.

Andrew Burgess (2):
  gdb/testsuite: fix gdb.ada/complete.exp timeout in READ1 mode
  gdb/testsuite: tighten up some end-of-line patterns

 gdb/testsuite/gdb.ada/catch_assert_if.exp |  2 +-
 gdb/testsuite/gdb.ada/catch_ex.exp        |  2 +-
 gdb/testsuite/gdb.ada/complete.exp        | 19 ++++++++++++++-----
 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 +++++++++++---------
 11 files changed, 35 insertions(+), 24 deletions(-)


base-commit: 87853585d89dac22c97020ad8af0c3abe2ce6d17
-- 
2.25.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/2] gdb/testsuite: fix gdb.ada/complete.exp timeout in READ1 mode
  2023-11-29 17:55 [PATCH 0/2] A few minor testsuite cleanups Andrew Burgess
@ 2023-11-29 17:55 ` Andrew Burgess
  2023-11-30 19:22   ` Tom Tromey
  2023-11-29 17:55 ` [PATCH 2/2] gdb/testsuite: tighten up some end-of-line patterns Andrew Burgess
  2023-12-08 18:07 ` [PATCH 0/2] A few minor testsuite cleanups Andrew Burgess
  2 siblings, 1 reply; 12+ messages in thread
From: Andrew Burgess @ 2023-11-29 17:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

While reviewing another patch I spotted a timeout in
gdb.ada/complete.exp when testing in READ1 mode, e.g.:

  $ make check-read1 TESTS="gdb.ada/complete.exp"
  ...
  FAIL: gdb.ada/complete.exp: complete break ada (timeout)
  ...

The problem is an attempt to match the entire output from GDB within a
single gdb_test_multiple pattern, for a completion command that
returns a large number of completions.

This commit changes the gdb_test_multiple to process the output line
by line.  I don't use the gdb_test_multiple -lbl option, as I've
always found that option backward -- it checks for the \r\n at the
start of each line rather than the end, I think it's much clearer to
use '^' at the start of each pattern, and '\r\n' at the end, so that's
what I've done here.

.... Or I would, if this test didn't already define $eol as the end of
line regexp ... except that $eol was set to '[\r\n]*', which isn't
that helpful, so I've updated $eol to be just '\r\n' the actual end of
line regexp.

And now, the test passes without a timeout when using READ1.

There should be no change in what is tested after this commit.
---
 gdb/testsuite/gdb.ada/complete.exp | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/gdb/testsuite/gdb.ada/complete.exp b/gdb/testsuite/gdb.ada/complete.exp
index 9e9250545e9..a73a012d1cc 100644
--- a/gdb/testsuite/gdb.ada/complete.exp
+++ b/gdb/testsuite/gdb.ada/complete.exp
@@ -28,7 +28,7 @@ clean_restart ${testfile}
 set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb]
 runto "foo.adb:$bp_location"
 
-set eol "\[\r\n\]*"
+set eol "\r\n"
 
 # A convenience function that verifies that the "complete EXPR" command
 # returns the EXPECTED_OUTPUT.
@@ -227,11 +227,20 @@ test_gdb_complete "ambiguous_func" \
 gdb_test_no_output "set max-completions unlimited"
 
 set test "complete break ada"
-gdb_test_multiple "$test" $test {
-    -re "^$test$eol\(break ada\[\]\[a-z0-9._@/-\]*$eol\)+$gdb_prompt $" {
-        pass $test
+gdb_test_multiple $test "" {
+    -re "^($test$eol)" {
+	exp_continue
     }
+
+    -re "^(break ada\[\]\[a-z0-9._@/-\]*$eol)" {
+	exp_continue
+    }
+
+    -re "^$gdb_prompt $" {
+	pass $gdb_test_name
+    }
+
     -re "\[A-Z\].*$gdb_prompt $" {
-	fail "$test (gdb/22670)"
+	fail "$gdb_test_name (gdb/22670)"
     }
 }
-- 
2.25.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 2/2] gdb/testsuite: tighten up some end-of-line patterns
  2023-11-29 17:55 [PATCH 0/2] A few minor testsuite cleanups Andrew Burgess
  2023-11-29 17:55 ` [PATCH 1/2] gdb/testsuite: fix gdb.ada/complete.exp timeout in READ1 mode Andrew Burgess
@ 2023-11-29 17:55 ` Andrew Burgess
  2023-11-30 19:23   ` Tom Tromey
  2023-12-08 18:07 ` [PATCH 0/2] A few minor testsuite cleanups Andrew Burgess
  2 siblings, 1 reply; 12+ messages in thread
From: Andrew Burgess @ 2023-11-29 17:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

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(-)

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" *-*-*
-- 
2.25.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/2] gdb/testsuite: fix gdb.ada/complete.exp timeout in READ1 mode
  2023-11-29 17:55 ` [PATCH 1/2] gdb/testsuite: fix gdb.ada/complete.exp timeout in READ1 mode Andrew Burgess
@ 2023-11-30 19:22   ` Tom Tromey
  0 siblings, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2023-11-30 19:22 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb-patches

>>>>> "Andrew" == Andrew Burgess <aburgess@redhat.com> writes:

Andrew> While reviewing another patch I spotted a timeout in
Andrew> gdb.ada/complete.exp when testing in READ1 mode, e.g.:

Andrew>   $ make check-read1 TESTS="gdb.ada/complete.exp"
Andrew>   ...
Andrew>   FAIL: gdb.ada/complete.exp: complete break ada (timeout)
Andrew>   ...

Andrew> The problem is an attempt to match the entire output from GDB within a
Andrew> single gdb_test_multiple pattern, for a completion command that
Andrew> returns a large number of completions.

...

Thank you.  This looks good to me.
Approved-By: Tom Tromey <tom@tromey.com>

Tom

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] gdb/testsuite: tighten up some end-of-line patterns
  2023-11-29 17:55 ` [PATCH 2/2] gdb/testsuite: tighten up some end-of-line patterns Andrew Burgess
@ 2023-11-30 19:23   ` Tom Tromey
  2023-12-08 22:25     ` Tom de Vries
  0 siblings, 1 reply; 12+ messages in thread
From: Tom Tromey @ 2023-11-30 19:23 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb-patches

>>>>> "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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/2] A few minor testsuite cleanups
  2023-11-29 17:55 [PATCH 0/2] A few minor testsuite cleanups Andrew Burgess
  2023-11-29 17:55 ` [PATCH 1/2] gdb/testsuite: fix gdb.ada/complete.exp timeout in READ1 mode Andrew Burgess
  2023-11-29 17:55 ` [PATCH 2/2] gdb/testsuite: tighten up some end-of-line patterns Andrew Burgess
@ 2023-12-08 18:07 ` Andrew Burgess
  2 siblings, 0 replies; 12+ messages in thread
From: Andrew Burgess @ 2023-12-08 18:07 UTC (permalink / raw)
  To: gdb-patches

Andrew Burgess <aburgess@redhat.com> writes:

> Patch #1 fixes a timeout in gdb.ada/complete.exp when READ1 is used.
>
> Patch #2 performs some wider cleanup, inspired by patch #1.

I've now pushed both of these.

Thanks,
Andrew


>
> Andrew Burgess (2):
>   gdb/testsuite: fix gdb.ada/complete.exp timeout in READ1 mode
>   gdb/testsuite: tighten up some end-of-line patterns
>
>  gdb/testsuite/gdb.ada/catch_assert_if.exp |  2 +-
>  gdb/testsuite/gdb.ada/catch_ex.exp        |  2 +-
>  gdb/testsuite/gdb.ada/complete.exp        | 19 ++++++++++++++-----
>  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 +++++++++++---------
>  11 files changed, 35 insertions(+), 24 deletions(-)
>
>
> base-commit: 87853585d89dac22c97020ad8af0c3abe2ce6d17
> -- 
> 2.25.4


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] gdb/testsuite: tighten up some end-of-line patterns
  2023-11-30 19:23   ` Tom Tromey
@ 2023-12-08 22:25     ` Tom de Vries
  2023-12-09  6:59       ` Tom de Vries
  0 siblings, 1 reply; 12+ messages in thread
From: Tom de Vries @ 2023-12-08 22:25 UTC (permalink / raw)
  To: Tom Tromey, Andrew Burgess; +Cc: gdb-patches

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] gdb/testsuite: tighten up some end-of-line patterns
  2023-12-08 22:25     ` Tom de Vries
@ 2023-12-09  6:59       ` Tom de Vries
  2023-12-11 14:52         ` Andrew Burgess
  0 siblings, 1 reply; 12+ messages in thread
From: Tom de Vries @ 2023-12-09  6:59 UTC (permalink / raw)
  To: Tom Tromey, Andrew Burgess; +Cc: gdb-patches

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




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] gdb/testsuite: tighten up some end-of-line patterns
  2023-12-09  6:59       ` Tom de Vries
@ 2023-12-11 14:52         ` Andrew Burgess
  2023-12-11 14:55           ` Tom de Vries
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Burgess @ 2023-12-11 14:52 UTC (permalink / raw)
  To: Tom de Vries, Tom Tromey; +Cc: gdb-patches

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] gdb/testsuite: tighten up some end-of-line patterns
  2023-12-11 14:52         ` Andrew Burgess
@ 2023-12-11 14:55           ` Tom de Vries
  2023-12-11 16:16             ` Tom de Vries
  0 siblings, 1 reply; 12+ messages in thread
From: Tom de Vries @ 2023-12-11 14:55 UTC (permalink / raw)
  To: Andrew Burgess, Tom Tromey; +Cc: gdb-patches

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
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] gdb/testsuite: tighten up some end-of-line patterns
  2023-12-11 14:55           ` Tom de Vries
@ 2023-12-11 16:16             ` Tom de Vries
  2023-12-11 16:44               ` Andrew Burgess
  0 siblings, 1 reply; 12+ messages in thread
From: Tom de Vries @ 2023-12-11 16:16 UTC (permalink / raw)
  To: Andrew Burgess, Tom Tromey; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 121 bytes --]

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

Pushed as attached.

Thanks,
- Tom

[-- Attachment #2: 0001-gdb-testsuite-Fix-eol-regexp-usage-in-some-test-case.patch --]
[-- Type: text/x-patch, Size: 6234 bytes --]

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/2] gdb/testsuite: tighten up some end-of-line patterns
  2023-12-11 16:16             ` Tom de Vries
@ 2023-12-11 16:44               ` Andrew Burgess
  0 siblings, 0 replies; 12+ messages in thread
From: Andrew Burgess @ 2023-12-11 16:44 UTC (permalink / raw)
  To: Tom de Vries, Tom Tromey; +Cc: gdb-patches

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-12-11 16:44 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-29 17:55 [PATCH 0/2] A few minor testsuite cleanups Andrew Burgess
2023-11-29 17:55 ` [PATCH 1/2] gdb/testsuite: fix gdb.ada/complete.exp timeout in READ1 mode Andrew Burgess
2023-11-30 19:22   ` Tom Tromey
2023-11-29 17:55 ` [PATCH 2/2] gdb/testsuite: tighten up some end-of-line patterns Andrew Burgess
2023-11-30 19:23   ` Tom Tromey
2023-12-08 22:25     ` Tom de Vries
2023-12-09  6:59       ` Tom de Vries
2023-12-11 14:52         ` Andrew Burgess
2023-12-11 14:55           ` Tom de Vries
2023-12-11 16:16             ` Tom de Vries
2023-12-11 16:44               ` Andrew Burgess
2023-12-08 18:07 ` [PATCH 0/2] A few minor testsuite cleanups Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).