summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Host/common')
-rw-r--r--lldb/source/Host/common/FileSpec.cpp24
-rw-r--r--lldb/source/Host/common/Host.cpp2
2 files changed, 25 insertions, 1 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp
index d104bd21c47..d356ff68495 100644
--- a/lldb/source/Host/common/FileSpec.cpp
+++ b/lldb/source/Host/common/FileSpec.cpp
@@ -996,4 +996,28 @@ FileSpec::IsSourceImplementationFile () const
return false;
}
+bool
+FileSpec::IsRelativeToCurrentWorkingDirectory () const
+{
+ const char *directory = m_directory.GetCString();
+ if (directory && directory[0])
+ {
+ // If the path doesn't start with '/' or '~', return true
+ switch (directory[0])
+ {
+ case '/':
+ case '~':
+ return false;
+ default:
+ return true;
+ }
+ }
+ else if (m_filename)
+ {
+ // No directory, just a basename, return true
+ return true;
+ }
+ return false;
+}
+
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index b25f8bcf1b1..2b5bec09121 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -1247,7 +1247,7 @@ Host::GetDummyTarget (lldb_private::Debugger &debugger)
if (!arch.IsValid())
arch = Host::GetArchitecture ();
Error err = debugger.GetTargetList().CreateTarget(debugger,
- FileSpec(),
+ NULL,
arch.GetTriple().getTriple().c_str(),
false,
NULL,
OpenPOWER on IntegriCloud