[PATCH 10/27] gdb.base/set-cwd.exp: Use is_windows_native_target
Pedro Alves <[email protected]> Thu, 23 Jul 2026 14:01:01 +0100
| Newsgroups | gmane.comp.gdb.patches |
|---|---|
| Message-ID | <[email protected]> |
gdb.base/set-cwd.exp special-cases native Windows, where getcwd
returns a path with backslashes that has to be converted to forward
slashes before comparing against the expected directory. The check
guarding that conversion uses istarget "*-*-mingw*", which only
matches MinGW targets and misses windows-msvc targets, which are also
native Windows.
Fix it by using the is_windows_native_target helper instead.
Change-Id: I4a31cfaded2d402863e59ea742501d5cece6ec77
---
gdb/testsuite/gdb.base/set-cwd.exp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.base/set-cwd.exp b/gdb/testsuite/gdb.base/set-cwd.exp
index aae557ece27..dea87360095 100644
--- a/gdb/testsuite/gdb.base/set-cwd.exp
+++ b/gdb/testsuite/gdb.base/set-cwd.exp
@@ -84,7 +84,7 @@ proc test_dir {expected_dir message} {
}
}
- if {[istarget "*-*-mingw*"]} {
+ if {[is_windows_native_target]} {
# getcwd on native Windows uses backslashes. Convert to
# forward slashes. We look for pairs of backslashes as DIR
# comes from a C string printed by GDB, which escapes
--
2.54.0