From: Sandra Loosemore <sandra@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 3/5] gdb/testsuite: Adjust some testcases to allow Windows pathnames
Date: Wed, 19 Apr 2023 13:30:44 -0600 [thread overview]
Message-ID: <20230419193046.548783-4-sandra@codesourcery.com> (raw)
In-Reply-To: <20230419193046.548783-1-sandra@codesourcery.com>
This patch fixes some testcases that formerly had patterns with
hardwired "/" pathname separators in them, which broke when testing on
(remote) Windows host.
---
.../maint-expand-symbols-header-file.exp | 4 +--
gdb/testsuite/gdb.base/setshow.exp | 14 ++++++--
gdb/testsuite/gdb.dwarf2/dw2-filename.exp | 2 +-
gdb/testsuite/gdb.mi/mi-info-sources.exp | 32 +++++++++----------
4 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/gdb/testsuite/gdb.base/maint-expand-symbols-header-file.exp b/gdb/testsuite/gdb.base/maint-expand-symbols-header-file.exp
index d38d2ab7398..43b5aabea3c 100644
--- a/gdb/testsuite/gdb.base/maint-expand-symbols-header-file.exp
+++ b/gdb/testsuite/gdb.base/maint-expand-symbols-header-file.exp
@@ -40,13 +40,13 @@ gdb_test_no_output "maint info symtabs" $test
gdb_test_no_output "maint expand-symtabs maint-expand-symbols-header-file.h"
# Check that the include symtab was in fact expanded.
-set file_re "\[^\r\n\]*/maint-expand-symbols-header-file.h"
+set file_re "\[^\r\n\]*maint-expand-symbols-header-file.h"
gdb_test "maint info symtabs" \
"\r\n\t{ symtab $file_re \\(\\(struct symtab \\*\\) $hex\\)\r\n.*" \
"check header file psymtab expansion"
# Check that the symtab the include symtab was referring to was expanded.
-set file_re "\[^\r\n\]*/maint-expand-symbols-header-file.c"
+set file_re "\[^\r\n\]*maint-expand-symbols-header-file.c"
gdb_test "maint info symtabs" \
"\r\n\t{ symtab $file_re \\(\\(struct symtab \\*\\) $hex\\)\r\n.*" \
"check source file psymtab expansion"
diff --git a/gdb/testsuite/gdb.base/setshow.exp b/gdb/testsuite/gdb.base/setshow.exp
index 86821ca1db0..6f8644af710 100644
--- a/gdb/testsuite/gdb.base/setshow.exp
+++ b/gdb/testsuite/gdb.base/setshow.exp
@@ -280,10 +280,18 @@ proc_with_prefix test_setshow_history {} {
#get home directory path
set HOME ""
+ set STRINGHOME ""
set test "show environment HOME"
gdb_test_multiple $test $test {
-re "\nHOME = (\[^\r\n\]*)\[\r\n\]+$::gdb_prompt $" {
set HOME $expect_out(1,string)
+ if { [ishost *-*-mingw*] } {
+ # Backslashes in the pathname must be escaped for the patterns
+ # that match quoted string output.
+ regsub -all {\\} $HOME {\\\\} STRINGHOME
+ } else {
+ set STRINGHOME $HOME
+ }
pass $test
}
}
@@ -294,13 +302,13 @@ proc_with_prefix test_setshow_history {} {
#test show history filename ~/foobar.baz
gdb_test "show history filename" \
- "The filename in which to record the command history is \"[string_to_regexp $HOME]/foobar.baz\"..*" \
+ "The filename in which to record the command history is \"[string_to_regexp $HOME].foobar.baz\"..*" \
"show history filename (~/foobar.baz)"
gdb_test "p \$_gdb_setting(\"history filename\")" \
- " = \"[string_to_regexp $HOME]/foobar.baz\"..*" \
+ " = \"[string_to_regexp $STRINGHOME].foobar.baz\".*" \
"_gdb_setting history filename"
gdb_test "p \$_gdb_setting_str(\"history filename\")" \
- " = \"[string_to_regexp $HOME]/foobar.baz\"..*" \
+ " = \"[string_to_regexp $STRINGHOME].foobar.baz\".*" \
"_gdb_setting_str history filename"
#get current working directory
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-filename.exp b/gdb/testsuite/gdb.dwarf2/dw2-filename.exp
index 3bdac4c1cb8..c0ee3ac0d3f 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-filename.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-filename.exp
@@ -38,4 +38,4 @@ gdb_test "interpreter-exec mi -file-list-exec-source-files" \
".*{file=\"file1\\.txt\",fullname=\".+file1\\.txt\",debug-fully-read=\"\[^\"\]+\"}.*"
# And `info sources' should return the fullname incl. the directories.
-gdb_test "info sources" {[/]file1\.txt.*}
+gdb_test "info sources" {.+file1\.txt.*}
diff --git a/gdb/testsuite/gdb.mi/mi-info-sources.exp b/gdb/testsuite/gdb.mi/mi-info-sources.exp
index f639f3cdef9..3778ccb3fbe 100644
--- a/gdb/testsuite/gdb.mi/mi-info-sources.exp
+++ b/gdb/testsuite/gdb.mi/mi-info-sources.exp
@@ -118,16 +118,16 @@ proc check_info_sources { debug_fully_read } {
[mi_list "files" \
".*" \
[mi_tuple "" \
- [mi_field "file" "\[^\"\]+/mi-info-sources-base\\.c"] \
- [mi_field "fullname" "\[^\"\]+/mi-info-sources-base\\.c"] \
+ [mi_field "file" "\[^\"\]*mi-info-sources-base\\.c"] \
+ [mi_field "fullname" "\[^\"\]+mi-info-sources-base\\.c"] \
[mi_field "debug-fully-read" "${debug_fully_read}"]] \
".*"]
set p2 \
[mi_list "files" \
".*" \
[mi_tuple "" \
- [mi_field "file" "\[^\"\]+/mi-info-sources\\.c"] \
- [mi_field "fullname" "\[^\"\]+/mi-info-sources\\.c"] \
+ [mi_field "file" "\[^\"\]*mi-info-sources\\.c"] \
+ [mi_field "fullname" "\[^\"\]+mi-info-sources\\.c"] \
[mi_field "debug-fully-read" "true"]] \
".*"]
} else {
@@ -135,16 +135,16 @@ proc check_info_sources { debug_fully_read } {
[mi_list "files" \
".*" \
[mi_tuple "" \
- [mi_field "file" "\[^\"\]+/mi-info-sources\\.c"] \
- [mi_field "fullname" "\[^\"\]+/mi-info-sources\\.c"] \
+ [mi_field "file" "\[^\"\]*mi-info-sources\\.c"] \
+ [mi_field "fullname" "\[^\"\]+mi-info-sources\\.c"] \
[mi_field "debug-fully-read" "true"]] \
".*"]
set p2 \
[mi_list "files" \
".*" \
[mi_tuple "" \
- [mi_field "file" "\[^\"\]+/mi-info-sources-base\\.c"] \
- [mi_field "fullname" "\[^\"\]+/mi-info-sources-base\\.c"] \
+ [mi_field "file" "\[^\"\]*mi-info-sources-base\\.c"] \
+ [mi_field "fullname" "\[^\"\]+mi-info-sources-base\\.c"] \
[mi_field "debug-fully-read" "${debug_fully_read}"]] \
".*"]
}
@@ -156,8 +156,8 @@ proc check_info_sources { debug_fully_read } {
set p [mi_list "files" \
[mi_tuple "" \
- [mi_field "file" "\[^\"\]+/mi-info-sources-base\\.c"] \
- [mi_field "fullname" "\[^\"\]+/mi-info-sources-base\\.c"] \
+ [mi_field "file" "\[^\"\]*mi-info-sources-base\\.c"] \
+ [mi_field "fullname" "\[^\"\]+mi-info-sources-base\\.c"] \
[mi_field "debug-fully-read" "${debug_fully_read}"]]]
mi_gdb_test "-file-list-exec-source-files --basename -- base" ".*\\^done,${p}" \
"-file-list-exec-source-files --basename -- base"
@@ -171,13 +171,13 @@ proc check_info_sources { debug_fully_read } {
set p [mi_list "files" \
[mi_tuple "" \
- [mi_field "filename" "\[^\"\]+/mi-info-sources(\.debug)?"] \
+ [mi_field "filename" "\[^\"\]+mi-info-sources(\.debug)?"] \
[mi_field "debug-info" "${debug_info}"] \
[mi_list "sources" \
".*" \
[mi_tuple "" \
- [mi_field "file" "\[^\"\]+/mi-info-sources\\.c"] \
- [mi_field "fullname" "\[^\"\]+/mi-info-sources\\.c"] \
+ [mi_field "file" "\[^\"\]*mi-info-sources\\.c"] \
+ [mi_field "fullname" "\[^\"\]+mi-info-sources\\.c"] \
[mi_field "debug-fully-read" "true"]] \
".*"]]]
mi_gdb_test "-file-list-exec-source-files --group-by-objfile" \
@@ -186,13 +186,13 @@ proc check_info_sources { debug_fully_read } {
set p [mi_list "files" \
[mi_tuple "" \
- [mi_field "filename" "\[^\"\]+/mi-info-sources(\.debug)?"] \
+ [mi_field "filename" "\[^\"\]+mi-info-sources(\.debug)?"] \
[mi_field "debug-info" "${debug_info}"] \
[mi_list "sources" \
".*" \
[mi_tuple "" \
- [mi_field "file" "\[^\"\]+/mi-info-sources-base\\.c"] \
- [mi_field "fullname" "\[^\"\]+/mi-info-sources-base\\.c"] \
+ [mi_field "file" "\[^\"\]*mi-info-sources-base\\.c"] \
+ [mi_field "fullname" "\[^\"\]+mi-info-sources-base\\.c"] \
[mi_field "debug-fully-read" "${debug_fully_read}"]] \
".*"]]]
mi_gdb_test "-file-list-exec-source-files --group-by-objfile" \
--
2.31.1
next prev parent reply other threads:[~2023-04-19 19:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-19 19:30 [PATCH 0/5] gdb/testsuite: Miscellaneous fixes Sandra Loosemore
2023-04-19 19:30 ` [PATCH 1/5] gdb/testsuite: Fix style.exp failures on targets without argc/argv support Sandra Loosemore
2023-04-19 19:30 ` [PATCH 2/5] gdb/testsuite: Fix style.exp failures on targets without libopcodes styling Sandra Loosemore
2023-04-21 14:37 ` Tom Tromey
2023-04-21 19:15 ` Sandra Loosemore
2023-04-19 19:30 ` Sandra Loosemore [this message]
2023-04-21 14:44 ` [PATCH 3/5] gdb/testsuite: Adjust some testcases to allow Windows pathnames Tom Tromey
2023-04-21 19:26 ` Sandra Loosemore
2023-04-22 0:11 ` Tom Tromey
2023-04-19 19:30 ` [PATCH 4/5] gdb/testsuite: Disable some tests that are broken on remote Windows host Sandra Loosemore
2023-04-21 14:46 ` Tom Tromey
2023-04-21 14:52 ` Tom Tromey
2023-04-21 19:33 ` Sandra Loosemore
2023-04-22 0:11 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230419193046.548783-4-sandra@codesourcery.com \
--to=sandra@codesourcery.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).