Working directory FileSpec should use remote path syntax to display correctly.

Summary: Depends on D9728.

Reviewers: ovyalov, zturner, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9806

llvm-svn: 238605
This commit is contained in:
Chaoren Lin 2015-05-29 19:52:37 +00:00
parent d3173f34e8
commit 44145d79cc
3 changed files with 22 additions and 1 deletions

View File

@ -668,9 +668,15 @@ public:
void
SetFile (const char *path, bool resolve_path, PathSyntax syntax = ePathSyntaxHostNative);
void
SetFile(const char *path, bool resolve_path, ArchSpec arch);
void
SetFile(const std::string &path, bool resolve_path, PathSyntax syntax = ePathSyntaxHostNative);
void
SetFile(const std::string &path, bool resolve_path, ArchSpec arch);
bool
IsResolved () const
{

View File

@ -344,12 +344,27 @@ FileSpec::SetFile (const char *pathname, bool resolve, PathSyntax syntax)
m_directory.SetCString(normalized.c_str());
}
void
FileSpec::SetFile(const char *pathname, bool resolve, ArchSpec arch)
{
return SetFile(pathname, resolve,
arch.GetTriple().isOSWindows()
? ePathSyntaxWindows
: ePathSyntaxPosix);
}
void
FileSpec::SetFile(const std::string &pathname, bool resolve, PathSyntax syntax)
{
return SetFile(pathname.c_str(), resolve, syntax);
}
void
FileSpec::SetFile(const std::string &pathname, bool resolve, ArchSpec arch)
{
return SetFile(pathname.c_str(), resolve, arch);
}
//----------------------------------------------------------------------
// Convert to pointer operator. This allows code to check any FileSpec
// objects to see if they contain anything valid using code such as:

View File

@ -2301,7 +2301,7 @@ GDBRemoteCommunicationClient::GetWorkingDir(FileSpec &working_dir)
return false;
std::string cwd;
response.GetHexByteString(cwd);
working_dir.SetFile(cwd, false);
working_dir.SetFile(cwd, false, GetHostArchitecture());
return !cwd.empty();
}
return false;