aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Target/Target.cpp
diff options
context:
space:
mode:
authorChaoren Lin <chaorenl@google.com>2015-05-29 19:52:29 +0000
committerChaoren Lin <chaorenl@google.com>2015-05-29 19:52:29 +0000
commitd3173f34e8546a96b8d0df0d9de133f88f10c127 (patch)
tree5e778446085cbd4a4d43fc3b488b3ac6ff17f2b5 /lldb/source/Target/Target.cpp
parent375432e4d8f50212bca3d9228e349b5a00f770d7 (diff)
downloadllvm-d3173f34e8546a96b8d0df0d9de133f88f10c127.zip
llvm-d3173f34e8546a96b8d0df0d9de133f88f10c127.tar.gz
llvm-d3173f34e8546a96b8d0df0d9de133f88f10c127.tar.bz2
Refactor many file functions to use FileSpec over strings.
Summary: This should solve the issue of sending denormalized paths over gdb-remote if we stick to GetPath(false) in GDBRemoteCommunicationClient, and let the server handle any denormalization. Reviewers: ovyalov, zturner, vharron, clayborg Reviewed By: clayborg Subscribers: tberghammer, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D9728 llvm-svn: 238604
Diffstat (limited to 'lldb/source/Target/Target.cpp')
-rw-r--r--lldb/source/Target/Target.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 81f25ae..13b5c6ef 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -2382,9 +2382,8 @@ Target::Install (ProcessLaunchInfo *launch_info)
if (is_main_executable) // TODO: add setting for always installing main executable???
{
// Always install the main executable
- remote_file = FileSpec(module_sp->GetFileSpec().GetFilename().AsCString(),
- false, module_sp->GetArchitecture());
- remote_file.GetDirectory() = platform_sp->GetWorkingDirectory();
+ remote_file = platform_sp->GetRemoteWorkingDirectory();
+ remote_file.AppendPathComponent(module_sp->GetFileSpec().GetFilename().GetCString());
}
}
if (remote_file)
@@ -2395,7 +2394,7 @@ Target::Install (ProcessLaunchInfo *launch_info)
module_sp->SetPlatformFileSpec(remote_file);
if (is_main_executable)
{
- platform_sp->SetFilePermissions(remote_file.GetPath(false).c_str(), 0700);
+ platform_sp->SetFilePermissions(remote_file, 0700);
if (launch_info)
launch_info->SetExecutableFile(remote_file, false);
}
@@ -3620,21 +3619,21 @@ void
TargetProperties::InputPathValueChangedCallback(void *target_property_ptr, OptionValue *)
{
TargetProperties *this_ = reinterpret_cast<TargetProperties *>(target_property_ptr);
- this_->m_launch_info.AppendOpenFileAction(STDIN_FILENO, this_->GetStandardInputPath().GetPath().c_str(), true, false);
+ this_->m_launch_info.AppendOpenFileAction(STDIN_FILENO, this_->GetStandardInputPath(), true, false);
}
void
TargetProperties::OutputPathValueChangedCallback(void *target_property_ptr, OptionValue *)
{
TargetProperties *this_ = reinterpret_cast<TargetProperties *>(target_property_ptr);
- this_->m_launch_info.AppendOpenFileAction(STDOUT_FILENO, this_->GetStandardOutputPath().GetPath().c_str(), false, true);
+ this_->m_launch_info.AppendOpenFileAction(STDOUT_FILENO, this_->GetStandardOutputPath(), false, true);
}
void
TargetProperties::ErrorPathValueChangedCallback(void *target_property_ptr, OptionValue *)
{
TargetProperties *this_ = reinterpret_cast<TargetProperties *>(target_property_ptr);
- this_->m_launch_info.AppendOpenFileAction(STDERR_FILENO, this_->GetStandardErrorPath().GetPath().c_str(), false, true);
+ this_->m_launch_info.AppendOpenFileAction(STDERR_FILENO, this_->GetStandardErrorPath(), false, true);
}
void