summaryrefslogtreecommitdiffstats
path: root/editor/debugger/debug_adapter/debug_adapter_parser.h
diff options
context:
space:
mode:
authorRicardo Subtil <ricasubtil@gmail.com>2023-04-08 19:59:01 +0100
committerRicardo Subtil <ricasubtil@gmail.com>2023-04-08 19:59:01 +0100
commitb8ae1c218c025f069b8017f2a84790f3f9869fd4 (patch)
tree948a47d338cd7bcc623852cebcd483b765514fc2 /editor/debugger/debug_adapter/debug_adapter_parser.h
parentcfab3d2f57976913a03a891b30eaa0a5da4ff64f (diff)
downloadredot-engine-b8ae1c218c025f069b8017f2a84790f3f9869fd4.tar.gz
Fix DAP path mismatch on Windows
Diffstat (limited to 'editor/debugger/debug_adapter/debug_adapter_parser.h')
-rw-r--r--editor/debugger/debug_adapter/debug_adapter_parser.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/debugger/debug_adapter/debug_adapter_parser.h b/editor/debugger/debug_adapter/debug_adapter_parser.h
index eb5255dc78..9995066ab4 100644
--- a/editor/debugger/debug_adapter/debug_adapter_parser.h
+++ b/editor/debugger/debug_adapter/debug_adapter_parser.h
@@ -45,6 +45,12 @@ private:
friend DebugAdapterProtocol;
_FORCE_INLINE_ bool is_valid_path(const String &p_path) const {
+ // If path contains \, it's a Windows path, so we need to convert it to /, and check as case-insensitive.
+ if (p_path.contains("\\")) {
+ String project_path = ProjectSettings::get_singleton()->get_resource_path();
+ String path = p_path.replace("\\", "/");
+ return path.findn(project_path) != -1;
+ }
return p_path.begins_with(ProjectSettings::get_singleton()->get_resource_path());
}