diff options
Diffstat (limited to 'source/API/SBHostOS.cpp')
| -rw-r--r-- | source/API/SBHostOS.cpp | 53 |
1 files changed, 44 insertions, 9 deletions
diff --git a/source/API/SBHostOS.cpp b/source/API/SBHostOS.cpp index 90b75a6ecd7b..e56951df43be 100644 --- a/source/API/SBHostOS.cpp +++ b/source/API/SBHostOS.cpp @@ -7,6 +7,10 @@ // //===----------------------------------------------------------------------===// +#ifndef LLDB_DISABLE_PYTHON +#include "Plugins/ScriptInterpreter/Python/lldb-python.h" +#endif + #include "lldb/API/SBHostOS.h" #include "lldb/API/SBError.h" #include "lldb/Host/Host.h" @@ -17,6 +21,11 @@ #include "lldb/Utility/FileSpec.h" #include "lldb/Utility/Log.h" +#include "Plugins/ExpressionParser/Clang/ClangHost.h" +#ifndef LLDB_DISABLE_PYTHON +#include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h" +#endif + #include "llvm/ADT/SmallString.h" #include "llvm/Support/Path.h" @@ -30,19 +39,45 @@ SBFileSpec SBHostOS::GetProgramFileSpec() { } SBFileSpec SBHostOS::GetLLDBPythonPath() { - SBFileSpec sb_lldb_python_filespec; - FileSpec lldb_python_spec; - if (HostInfo::GetLLDBPath(ePathTypePythonDir, lldb_python_spec)) { - sb_lldb_python_filespec.SetFileSpec(lldb_python_spec); - } - return sb_lldb_python_filespec; + return GetLLDBPath(ePathTypePythonDir); } SBFileSpec SBHostOS::GetLLDBPath(lldb::PathType path_type) { - SBFileSpec sb_fspec; FileSpec fspec; - if (HostInfo::GetLLDBPath(path_type, fspec)) - sb_fspec.SetFileSpec(fspec); + switch (path_type) { + case ePathTypeLLDBShlibDir: + fspec = HostInfo::GetShlibDir(); + break; + case ePathTypeSupportExecutableDir: + fspec = HostInfo::GetSupportExeDir(); + break; + case ePathTypeHeaderDir: + fspec = HostInfo::GetHeaderDir(); + break; + case ePathTypePythonDir: +#ifndef LLDB_DISABLE_PYTHON + fspec = ScriptInterpreterPython::GetPythonDir(); +#endif + break; + case ePathTypeLLDBSystemPlugins: + fspec = HostInfo::GetSystemPluginDir(); + break; + case ePathTypeLLDBUserPlugins: + fspec = HostInfo::GetUserPluginDir(); + break; + case ePathTypeLLDBTempSystemDir: + fspec = HostInfo::GetProcessTempDir(); + break; + case ePathTypeGlobalLLDBTempSystemDir: + fspec = HostInfo::GetGlobalTempDir(); + break; + case ePathTypeClangDir: + fspec = GetClangResourceDir(); + break; + } + + SBFileSpec sb_fspec; + sb_fspec.SetFileSpec(fspec); return sb_fspec; } |
