Fixed ePathTypePythonDir for Linux and FreeBSD (at least). This works for non-installed compilations. I will test further.

llvm-svn: 160963
This commit is contained in:
Filipe Cabecinhas 2012-07-30 16:46:32 +00:00
parent e3895eb050
commit 0b75116ae9
1 changed files with 7 additions and 3 deletions

View File

@ -992,9 +992,11 @@ Host::GetLLDBPath (PathType path_type, FileSpec &file_spec)
case ePathTypePythonDir:
{
// TODO: Anyone know how we can determine this for linux? Other systems?
// For linux we are currently assuming the location of the lldb
// binary that contains this function is the directory that will
// contain lldb.so, lldb.py and embedded_interpreter.py...
// For linux and FreeBSD we are currently assuming the
// location of the lldb binary that contains this function is
// the directory that will contain a python directory which
// has our lldb module. This is how files get placed when
// compiling with Makefiles.
static ConstString g_lldb_python_dir;
if (!g_lldb_python_dir)
@ -1013,6 +1015,8 @@ Host::GetLLDBPath (PathType path_type, FileSpec &file_spec)
framework_pos += strlen("LLDB.framework");
::strncpy (framework_pos, "/Resources/Python", PATH_MAX - (framework_pos - raw_path));
}
#else
::strlcat(raw_path, "/python", sizeof(raw_path));
#endif
FileSpec::Resolve (raw_path, resolved_path, sizeof(resolved_path));
g_lldb_python_dir.SetCString(resolved_path);