]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.server/non-existing-program.exp on msys2-ucrt64
authorTom de Vries <tdevries@suse.de>
Wed, 27 Aug 2025 08:49:19 +0000 (10:49 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 27 Aug 2025 08:49:19 +0000 (10:49 +0200)
On msys2-ucrt64, with test-case gdb.server/non-existing-program.exp I get:
...
(gdb) quit^M
gdb_caching_proc allow_xml_test caused gdb_exit to be called
  gdb_caching_proc allow_xml_test marked as called
  gdb_caching_proc get_mount_point_map marked as called
builtin_spawn gdbserver stdio non-existing-program^M
Error creating process "non-existing-program " (error 2): \
  The system cannot find the file specified.^M^M
Exiting^M^M
FAIL: gdb.server/non-existing-program.exp: gdbserver exits cleanly
...

This happens because this regexp fails to match:
...
    # This is what we get on Windows.
    -re "Error creating process\r\n\r\nExiting\r\n" {
...

Fix this by updating the regexp.

Tested on x86_64-w64-mingw32 (msys2-ucrt64).

gdb/testsuite/gdb.server/non-existing-program.exp

index 7119723ce52faf8381ea2dd179f2fc4d24f77838..ec9c044c018a020d34eb56d2fc37c48c40d77a57 100644 (file)
@@ -34,6 +34,8 @@ if { $gdbserver == "" } {
 # to spawn the program before opening the connection.
 set spawn_id [remote_spawn target "$gdbserver stdio non-existing-program"]
 
+set eol {[\r\n]}
+
 set msg "gdbserver exits cleanly"
 set saw_exiting 0
 expect {
@@ -51,7 +53,7 @@ expect {
        exp_continue
     }
     # This is what we get on Windows.
-    -re "Error creating process\r\n\r\nExiting\r\n" {
+    -re "Error creating process.*$eol+Exiting$eol+" {
        set saw_exiting 1
        exp_continue
     }