summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Platform
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/Plugins/Platform
parent375432e4d8f50212bca3d9228e349b5a00f770d7 (diff)
downloadbcm5719-llvm-d3173f34e8546a96b8d0df0d9de133f88f10c127.tar.gz
bcm5719-llvm-d3173f34e8546a96b8d0df0d9de133f88f10c127.zip
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/Plugins/Platform')
-rw-r--r--lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp12
-rw-r--r--lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h12
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp2
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp2
-rw-r--r--lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp56
-rw-r--r--lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h35
-rw-r--r--lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp97
-rw-r--r--lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h32
8 files changed, 125 insertions, 123 deletions
diff --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
index d2c3b4c172e..5c7752679b6 100644
--- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
+++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
@@ -134,12 +134,12 @@ PlatformFreeBSD::GetModuleSpec (const FileSpec& module_file_spec,
}
lldb_private::Error
-PlatformFreeBSD::RunShellCommand (const char *command,
- const char *working_dir,
- int *status_ptr,
- int *signo_ptr,
- std::string *command_output,
- uint32_t timeout_sec)
+PlatformFreeBSD::RunShellCommand(const char *command,
+ const FileSpec &working_dir,
+ int *status_ptr,
+ int *signo_ptr,
+ std::string *command_output,
+ uint32_t timeout_sec)
{
if (IsHost())
return Host::RunShellCommand(command, working_dir, status_ptr, signo_ptr, command_output, timeout_sec);
diff --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
index 661aee2f5fa..119d0fd2982 100644
--- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
+++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.h
@@ -77,12 +77,12 @@ public:
lldb_private::ModuleSpec &module_spec) override;
lldb_private::Error
- RunShellCommand (const char *command,
- const char *working_dir,
- int *status_ptr,
- int *signo_ptr,
- std::string *command_output,
- uint32_t timeout_sec) override;
+ RunShellCommand(const char *command,
+ const lldb_private::FileSpec &working_dir,
+ int *status_ptr,
+ int *signo_ptr,
+ std::string *command_output,
+ uint32_t timeout_sec) override;
lldb_private::Error
ResolveExecutable (const lldb_private::ModuleSpec &module_spec,
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index 5d9e706a906..eb83081c0d8 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -324,7 +324,7 @@ static lldb_private::Error
MakeCacheFolderForFile (const FileSpec& module_cache_spec)
{
FileSpec module_cache_folder = module_cache_spec.CopyByRemovingLastPathComponent();
- return FileSystem::MakeDirectory(module_cache_folder.GetPath().c_str(), eFilePermissionsDirectoryDefault);
+ return FileSystem::MakeDirectory(module_cache_folder, eFilePermissionsDirectoryDefault);
}
static lldb_private::Error
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
index 9ea7389fd2f..e35115a9640 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
@@ -293,7 +293,7 @@ PlatformMacOSX::GetFileWithUUID (const lldb_private::FileSpec &platform_file,
FileSpec module_cache_folder = module_cache_spec.CopyByRemovingLastPathComponent();
// try to make the local directory first
Error err =
- FileSystem::MakeDirectory(module_cache_folder.GetPath().c_str(), eFilePermissionsDirectoryDefault);
+ FileSystem::MakeDirectory(module_cache_folder, eFilePermissionsDirectoryDefault);
if (err.Fail())
return err;
err = GetFile(platform_file, module_cache_spec);
diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
index 5df481e206c..fe425e02103 100644
--- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -85,12 +85,12 @@ PlatformPOSIX::IsConnected () const
}
lldb_private::Error
-PlatformPOSIX::RunShellCommand (const char *command, // Shouldn't be NULL
- const char *working_dir, // Pass NULL to use the current working directory
- int *status_ptr, // Pass NULL if you don't want the process exit status
- int *signo_ptr, // Pass NULL if you don't want the signal that caused the process to exit
- std::string *command_output, // Pass NULL if you don't want the command output
- uint32_t timeout_sec) // Timeout in seconds to wait for shell program to finish
+PlatformPOSIX::RunShellCommand(const char *command, // Shouldn't be NULL
+ const FileSpec &working_dir, // Pass empty FileSpec to use the current working directory
+ int *status_ptr, // Pass NULL if you don't want the process exit status
+ int *signo_ptr, // Pass NULL if you don't want the signal that caused the process to exit
+ std::string *command_output, // Pass NULL if you don't want the command output
+ uint32_t timeout_sec) // Timeout in seconds to wait for shell program to finish
{
if (IsHost())
return Host::RunShellCommand(command, working_dir, status_ptr, signo_ptr, command_output, timeout_sec);
@@ -104,30 +104,30 @@ PlatformPOSIX::RunShellCommand (const char *command, // Shouldn't be N
}
Error
-PlatformPOSIX::MakeDirectory (const char *path, uint32_t file_permissions)
+PlatformPOSIX::MakeDirectory(const FileSpec &file_spec, uint32_t file_permissions)
{
if (m_remote_platform_sp)
- return m_remote_platform_sp->MakeDirectory(path, file_permissions);
+ return m_remote_platform_sp->MakeDirectory(file_spec, file_permissions);
else
- return Platform::MakeDirectory(path ,file_permissions);
+ return Platform::MakeDirectory(file_spec ,file_permissions);
}
Error
-PlatformPOSIX::GetFilePermissions (const char *path, uint32_t &file_permissions)
+PlatformPOSIX::GetFilePermissions(const FileSpec &file_spec, uint32_t &file_permissions)
{
if (m_remote_platform_sp)
- return m_remote_platform_sp->GetFilePermissions(path, file_permissions);
+ return m_remote_platform_sp->GetFilePermissions(file_spec, file_permissions);
else
- return Platform::GetFilePermissions(path ,file_permissions);
+ return Platform::GetFilePermissions(file_spec ,file_permissions);
}
Error
-PlatformPOSIX::SetFilePermissions (const char *path, uint32_t file_permissions)
+PlatformPOSIX::SetFilePermissions(const FileSpec &file_spec, uint32_t file_permissions)
{
if (m_remote_platform_sp)
- return m_remote_platform_sp->SetFilePermissions(path, file_permissions);
+ return m_remote_platform_sp->SetFilePermissions(file_spec, file_permissions);
else
- return Platform::SetFilePermissions(path ,file_permissions);
+ return Platform::SetFilePermissions(file_spec, file_permissions);
}
lldb::user_id_t
@@ -316,7 +316,7 @@ PlatformPOSIX::GetFileSize (const FileSpec& file_spec)
}
Error
-PlatformPOSIX::CreateSymlink(const char *src, const char *dst)
+PlatformPOSIX::CreateSymlink(const FileSpec &src, const FileSpec &dst)
{
if (IsHost())
return FileSystem::Symlink(src, dst);
@@ -338,19 +338,19 @@ PlatformPOSIX::GetFileExists (const FileSpec& file_spec)
}
Error
-PlatformPOSIX::Unlink (const char *path)
+PlatformPOSIX::Unlink(const FileSpec &file_spec)
{
if (IsHost())
- return FileSystem::Unlink(path);
+ return FileSystem::Unlink(file_spec);
else if (m_remote_platform_sp)
- return m_remote_platform_sp->Unlink(path);
+ return m_remote_platform_sp->Unlink(file_spec);
else
- return Platform::Unlink(path);
+ return Platform::Unlink(file_spec);
}
lldb_private::Error
-PlatformPOSIX::GetFile (const lldb_private::FileSpec& source /* remote file path */,
- const lldb_private::FileSpec& destination /* local file path */)
+PlatformPOSIX::GetFile(const lldb_private::FileSpec &source, // remote file path
+ const lldb_private::FileSpec &destination) // local file path
{
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM));
@@ -433,8 +433,8 @@ PlatformPOSIX::GetFile (const lldb_private::FileSpec& source /* remote file path
return Error("unable to open source file");
uint32_t permissions = 0;
- error = GetFilePermissions(source.GetPath().c_str(), permissions);
-
+ error = GetFilePermissions(source, permissions);
+
if (permissions == 0)
permissions = lldb::eFilePermissionsFileDefault;
@@ -535,7 +535,7 @@ PlatformPOSIX::CalculateMD5 (const FileSpec& file_spec,
return false;
}
-lldb_private::ConstString
+FileSpec
PlatformPOSIX::GetRemoteWorkingDirectory()
{
if (IsRemote() && m_remote_platform_sp)
@@ -545,12 +545,12 @@ PlatformPOSIX::GetRemoteWorkingDirectory()
}
bool
-PlatformPOSIX::SetRemoteWorkingDirectory(const lldb_private::ConstString &path)
+PlatformPOSIX::SetRemoteWorkingDirectory(const FileSpec &working_dir)
{
if (IsRemote() && m_remote_platform_sp)
- return m_remote_platform_sp->SetRemoteWorkingDirectory(path);
+ return m_remote_platform_sp->SetRemoteWorkingDirectory(working_dir);
else
- return Platform::SetRemoteWorkingDirectory(path);
+ return Platform::SetRemoteWorkingDirectory(working_dir);
}
bool
diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h
index e53d6a89e4b..19a3f0c4eef 100644
--- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h
+++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.h
@@ -84,17 +84,18 @@ public:
GetFileSize (const lldb_private::FileSpec& file_spec) override;
lldb_private::Error
- CreateSymlink(const char *src, const char *dst) override;
+ CreateSymlink(const lldb_private::FileSpec &src,
+ const lldb_private::FileSpec &dst) override;
lldb_private::Error
- GetFile (const lldb_private::FileSpec& source,
- const lldb_private::FileSpec& destination) override;
-
- lldb_private::ConstString
+ GetFile(const lldb_private::FileSpec &source,
+ const lldb_private::FileSpec &destination) override;
+
+ lldb_private::FileSpec
GetRemoteWorkingDirectory() override;
bool
- SetRemoteWorkingDirectory(const lldb_private::ConstString &path) override;
+ SetRemoteWorkingDirectory(const lldb_private::FileSpec &working_dir) override;
bool
GetRemoteOSVersion () override;
@@ -115,27 +116,27 @@ public:
IsConnected () const override;
lldb_private::Error
- RunShellCommand (const char *command, // Shouldn't be NULL
- const char *working_dir, // Pass NULL to use the current working directory
- int *status_ptr, // Pass NULL if you don't want the process exit status
- int *signo_ptr, // Pass NULL if you don't want the signal that caused the process to exit
- std::string *command_output, // Pass NULL if you don't want the command output
- uint32_t timeout_sec) override;// Timeout in seconds to wait for shell program to finish
+ RunShellCommand(const char *command, // Shouldn't be NULL
+ const lldb_private::FileSpec &working_dir, // Pass empty FileSpec to use the current working directory
+ int *status_ptr, // Pass NULL if you don't want the process exit status
+ int *signo_ptr, // Pass NULL if you don't want the signal that caused the process to exit
+ std::string *command_output, // Pass NULL if you don't want the command output
+ uint32_t timeout_sec) override; // Timeout in seconds to wait for shell program to finish
lldb_private::Error
- MakeDirectory (const char *path, uint32_t mode) override;
-
+ MakeDirectory(const lldb_private::FileSpec &file_spec, uint32_t mode) override;
+
lldb_private::Error
- GetFilePermissions (const char *path, uint32_t &file_permissions) override;
+ GetFilePermissions(const lldb_private::FileSpec &file_spec, uint32_t &file_permissions) override;
lldb_private::Error
- SetFilePermissions (const char *path, uint32_t file_permissions) override;
+ SetFilePermissions(const lldb_private::FileSpec &file_spec, uint32_t file_permissions) override;
bool
GetFileExists (const lldb_private::FileSpec& file_spec) override;
lldb_private::Error
- Unlink (const char *path) override;
+ Unlink(const lldb_private::FileSpec &file_spec) override;
lldb_private::Error
LaunchProcess (lldb_private::ProcessLaunchInfo &launch_info) override;
diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
index bb1b7090f87..df0484c4e69 100644
--- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
@@ -318,24 +318,17 @@ PlatformRemoteGDBServer::GetRemoteSystemArchitecture ()
return m_gdb_client.GetSystemArchitecture();
}
-ConstString
+FileSpec
PlatformRemoteGDBServer::GetRemoteWorkingDirectory()
{
if (IsConnected())
{
Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM);
- std::string cwd;
- if (m_gdb_client.GetWorkingDir(cwd))
- {
- ConstString working_dir(cwd.c_str());
- if (log)
- log->Printf("PlatformRemoteGDBServer::GetRemoteWorkingDirectory() -> '%s'", working_dir.GetCString());
- return working_dir;
- }
- else
- {
- return ConstString();
- }
+ FileSpec working_dir;
+ if (m_gdb_client.GetWorkingDir(working_dir) && log)
+ log->Printf("PlatformRemoteGDBServer::GetRemoteWorkingDirectory() -> '%s'",
+ working_dir.GetCString());
+ return working_dir;
}
else
{
@@ -344,7 +337,7 @@ PlatformRemoteGDBServer::GetRemoteWorkingDirectory()
}
bool
-PlatformRemoteGDBServer::SetRemoteWorkingDirectory(const ConstString &path)
+PlatformRemoteGDBServer::SetRemoteWorkingDirectory(const FileSpec &working_dir)
{
if (IsConnected())
{
@@ -352,11 +345,12 @@ PlatformRemoteGDBServer::SetRemoteWorkingDirectory(const ConstString &path)
// for use to re-read it
Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM);
if (log)
- log->Printf("PlatformRemoteGDBServer::SetRemoteWorkingDirectory('%s')", path.GetCString());
- return m_gdb_client.SetWorkingDir(path.GetCString()) == 0;
+ log->Printf("PlatformRemoteGDBServer::SetRemoteWorkingDirectory('%s')",
+ working_dir.GetCString());
+ return m_gdb_client.SetWorkingDir(working_dir) == 0;
}
else
- return Platform::SetRemoteWorkingDirectory(path);
+ return Platform::SetRemoteWorkingDirectory(working_dir);
}
bool
@@ -396,7 +390,7 @@ PlatformRemoteGDBServer::ConnectRemote (Args& args)
m_gdb_client.GetHostInfo();
// If a working directory was set prior to connecting, send it down now
if (m_working_dir)
- m_gdb_client.SetWorkingDir(m_working_dir.GetCString());
+ m_gdb_client.SetWorkingDir(m_working_dir);
}
else
{
@@ -492,13 +486,13 @@ PlatformRemoteGDBServer::LaunchProcess (ProcessLaunchInfo &launch_info)
switch(file_action->GetFD())
{
case STDIN_FILENO:
- m_gdb_client.SetSTDIN (file_action->GetPath());
+ m_gdb_client.SetSTDIN(file_action->GetFileSpec());
break;
case STDOUT_FILENO:
- m_gdb_client.SetSTDOUT (file_action->GetPath());
+ m_gdb_client.SetSTDOUT(file_action->GetFileSpec());
break;
case STDERR_FILENO:
- m_gdb_client.SetSTDERR (file_action->GetPath());
+ m_gdb_client.SetSTDERR(file_action->GetFileSpec());
break;
}
}
@@ -506,10 +500,10 @@ PlatformRemoteGDBServer::LaunchProcess (ProcessLaunchInfo &launch_info)
m_gdb_client.SetDisableASLR (launch_info.GetFlags().Test (eLaunchFlagDisableASLR));
m_gdb_client.SetDetachOnError (launch_info.GetFlags().Test (eLaunchFlagDetachOnError));
- const char *working_dir = launch_info.GetWorkingDirectory();
- if (working_dir && working_dir[0])
+ FileSpec working_dir = launch_info.GetWorkingDirectory();
+ if (working_dir)
{
- m_gdb_client.SetWorkingDir (working_dir);
+ m_gdb_client.SetWorkingDir(working_dir);
}
// Send the environment and the program + arguments after we connect
@@ -749,33 +743,38 @@ PlatformRemoteGDBServer::Attach (ProcessAttachInfo &attach_info,
}
Error
-PlatformRemoteGDBServer::MakeDirectory (const char *path, uint32_t mode)
+PlatformRemoteGDBServer::MakeDirectory(const FileSpec &file_spec, uint32_t mode)
{
- Error error = m_gdb_client.MakeDirectory(path,mode);
+ Error error = m_gdb_client.MakeDirectory(file_spec, mode);
Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM);
if (log)
- log->Printf ("PlatformRemoteGDBServer::MakeDirectory(path='%s', mode=%o) error = %u (%s)", path, mode, error.GetError(), error.AsCString());
+ log->Printf ("PlatformRemoteGDBServer::MakeDirectory(path='%s', mode=%o) error = %u (%s)",
+ file_spec.GetCString(), mode, error.GetError(), error.AsCString());
return error;
}
Error
-PlatformRemoteGDBServer::GetFilePermissions (const char *path, uint32_t &file_permissions)
+PlatformRemoteGDBServer::GetFilePermissions(const FileSpec &file_spec,
+ uint32_t &file_permissions)
{
- Error error = m_gdb_client.GetFilePermissions(path, file_permissions);
+ Error error = m_gdb_client.GetFilePermissions(file_spec, file_permissions);
Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM);
if (log)
- log->Printf ("PlatformRemoteGDBServer::GetFilePermissions(path='%s', file_permissions=%o) error = %u (%s)", path, file_permissions, error.GetError(), error.AsCString());
+ log->Printf ("PlatformRemoteGDBServer::GetFilePermissions(path='%s', file_permissions=%o) error = %u (%s)",
+ file_spec.GetCString(), file_permissions, error.GetError(), error.AsCString());
return error;
}
Error
-PlatformRemoteGDBServer::SetFilePermissions (const char *path, uint32_t file_permissions)
+PlatformRemoteGDBServer::SetFilePermissions(const FileSpec &file_spec,
+ uint32_t file_permissions)
{
- Error error = m_gdb_client.SetFilePermissions(path, file_permissions);
+ Error error = m_gdb_client.SetFilePermissions(file_spec, file_permissions);
Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM);
if (log)
- log->Printf ("PlatformRemoteGDBServer::SetFilePermissions(path='%s', file_permissions=%o) error = %u (%s)", path, file_permissions, error.GetError(), error.AsCString());
+ log->Printf ("PlatformRemoteGDBServer::SetFilePermissions(path='%s', file_permissions=%o) error = %u (%s)",
+ file_spec.GetCString(), file_permissions, error.GetError(), error.AsCString());
return error;
}
@@ -831,23 +830,25 @@ PlatformRemoteGDBServer::PutFile (const FileSpec& source,
}
Error
-PlatformRemoteGDBServer::CreateSymlink (const char *src, // The name of the link is in src
- const char *dst) // The symlink points to dst
+PlatformRemoteGDBServer::CreateSymlink(const FileSpec &src, // The name of the link is in src
+ const FileSpec &dst) // The symlink points to dst
{
- Error error = m_gdb_client.CreateSymlink (src, dst);
+ Error error = m_gdb_client.CreateSymlink(src, dst);
Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM);
if (log)
- log->Printf ("PlatformRemoteGDBServer::CreateSymlink(src='%s', dst='%s') error = %u (%s)", src, dst, error.GetError(), error.AsCString());
+ log->Printf ("PlatformRemoteGDBServer::CreateSymlink(src='%s', dst='%s') error = %u (%s)",
+ src.GetCString(), dst.GetCString(), error.GetError(), error.AsCString());
return error;
}
Error
-PlatformRemoteGDBServer::Unlink (const char *path)
+PlatformRemoteGDBServer::Unlink(const FileSpec &file_spec)
{
- Error error = m_gdb_client.Unlink (path);
+ Error error = m_gdb_client.Unlink(file_spec);
Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM);
if (log)
- log->Printf ("PlatformRemoteGDBServer::Unlink(path='%s') error = %u (%s)", path, error.GetError(), error.AsCString());
+ log->Printf ("PlatformRemoteGDBServer::Unlink(path='%s') error = %u (%s)",
+ file_spec.GetCString(), error.GetError(), error.AsCString());
return error;
}
@@ -858,14 +859,14 @@ PlatformRemoteGDBServer::GetFileExists (const FileSpec& file_spec)
}
Error
-PlatformRemoteGDBServer::RunShellCommand (const char *command, // Shouldn't be NULL
- const char *working_dir, // Pass NULL to use the current working directory
- int *status_ptr, // Pass NULL if you don't want the process exit status
- int *signo_ptr, // Pass NULL if you don't want the signal that caused the process to exit
- std::string *command_output, // Pass NULL if you don't want the command output
- uint32_t timeout_sec) // Timeout in seconds to wait for shell program to finish
-{
- return m_gdb_client.RunShellCommand (command, working_dir, status_ptr, signo_ptr, command_output, timeout_sec);
+PlatformRemoteGDBServer::RunShellCommand(const char *command, // Shouldn't be NULL
+ const FileSpec &working_dir, // Pass empty FileSpec to use the current working directory
+ int *status_ptr, // Pass NULL if you don't want the process exit status
+ int *signo_ptr, // Pass NULL if you don't want the signal that caused the process to exit
+ std::string *command_output, // Pass NULL if you don't want the command output
+ uint32_t timeout_sec) // Timeout in seconds to wait for shell program to finish
+{
+ return m_gdb_client.RunShellCommand(command, working_dir, status_ptr, signo_ptr, command_output, timeout_sec);
}
void
diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
index d689e1ee3de..1d97b4dbc68 100644
--- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
+++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
@@ -128,11 +128,11 @@ public:
ArchSpec
GetRemoteSystemArchitecture () override;
- ConstString
+ FileSpec
GetRemoteWorkingDirectory() override;
bool
- SetRemoteWorkingDirectory(const ConstString &path) override;
+ SetRemoteWorkingDirectory(const FileSpec &working_dir) override;
// Remote subclasses should override this and return a valid instance
// name if connected.
@@ -155,14 +155,14 @@ public:
DisconnectRemote () override;
Error
- MakeDirectory (const char *path, uint32_t file_permissions) override;
-
+ MakeDirectory(const FileSpec &file_spec, uint32_t file_permissions) override;
+
Error
- GetFilePermissions (const char *path, uint32_t &file_permissions) override;
-
+ GetFilePermissions(const FileSpec &file_spec, uint32_t &file_permissions) override;
+
Error
- SetFilePermissions (const char *path, uint32_t file_permissions) override;
-
+ SetFilePermissions(const FileSpec &file_spec, uint32_t file_permissions) override;
+
lldb::user_id_t
OpenFile (const FileSpec& file_spec, uint32_t flags, uint32_t mode, Error &error) override;
@@ -194,21 +194,21 @@ public:
uint32_t gid = UINT32_MAX) override;
Error
- CreateSymlink (const char *src, const char *dst) override;
+ CreateSymlink(const FileSpec &src, const FileSpec &dst) override;
bool
GetFileExists (const FileSpec& file_spec) override;
Error
- Unlink (const char *path) override;
+ Unlink(const FileSpec &path) override;
Error
- RunShellCommand (const char *command, // Shouldn't be NULL
- const char *working_dir, // Pass NULL to use the current working directory
- int *status_ptr, // Pass NULL if you don't want the process exit status
- int *signo_ptr, // Pass NULL if you don't want the signal that caused the process to exit
- std::string *command_output, // Pass NULL if you don't want the command output
- uint32_t timeout_sec) override; // Timeout in seconds to wait for shell program to finish
+ RunShellCommand(const char *command, // Shouldn't be NULL
+ const FileSpec &working_dir, // Pass empty FileSpec to use the current working directory
+ int *status_ptr, // Pass NULL if you don't want the process exit status
+ int *signo_ptr, // Pass NULL if you don't want the signal that caused the process to exit
+ std::string *command_output, // Pass NULL if you don't want the command output
+ uint32_t timeout_sec) override; // Timeout in seconds to wait for shell program to finish
void
CalculateTrapHandlerSymbolNames () override;
OpenPOWER on IntegriCloud