diff options
author | Tamas Berghammer <tberghammer@google.com> | 2015-03-31 09:52:22 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2015-03-31 09:52:22 +0000 |
commit | db264a6d09b04f6794e786078bf727c1c10c798a (patch) | |
tree | 9da2cc27520248bda09229b65a3c1b5b8fc68964 /lldb/source/Plugins/Platform/gdb-server | |
parent | 96d1779e23fad278e9f48ebb0ae6450e7395d6e7 (diff) | |
download | bcm5719-llvm-db264a6d09b04f6794e786078bf727c1c10c798a.tar.gz bcm5719-llvm-db264a6d09b04f6794e786078bf727c1c10c798a.zip |
Move several plugin to its own namespace
Affected paths:
* Plugins/Platform/Android/*
* Plugins/Platform/Linux/*
* Plugins/Platform/gdb-server/*
* Plugins/Process/Linux/*
* Plugins/Process/gdb-remote/*
Differential revision: http://reviews.llvm.org/D8654
llvm-svn: 233679
Diffstat (limited to 'lldb/source/Plugins/Platform/gdb-server')
-rw-r--r-- | lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp | 39 | ||||
-rw-r--r-- | lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h | 116 |
2 files changed, 78 insertions, 77 deletions
diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index 9cd2270452f..4291f055849 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -36,6 +36,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::platform_gdb_server; static bool g_initialized = false; @@ -44,7 +45,7 @@ static std::string MakeGdbServerUrl (const std::string &platform_hostname, uint1 const char *override_hostname = getenv("LLDB_PLATFORM_REMOTE_GDB_SERVER_HOSTNAME"); const char *port_offset_c_str = getenv("LLDB_PLATFORM_REMOTE_GDB_SERVER_PORT_OFFSET"); int port_offset = port_offset_c_str ? ::atoi(port_offset_c_str) : 0; - lldb_private::StreamString result; + StreamString result; result.Printf("connect://%s:%u", override_hostname ? override_hostname : platform_hostname.c_str(), port + port_offset); @@ -78,7 +79,7 @@ PlatformRemoteGDBServer::Terminate () } PlatformSP -PlatformRemoteGDBServer::CreateInstance (bool force, const lldb_private::ArchSpec *arch) +PlatformRemoteGDBServer::CreateInstance (bool force, const ArchSpec *arch) { bool create = force; if (!create) @@ -91,7 +92,7 @@ PlatformRemoteGDBServer::CreateInstance (bool force, const lldb_private::ArchSpe } -lldb_private::ConstString +ConstString PlatformRemoteGDBServer::GetPluginNameStatic() { static ConstString g_name("remote-gdb-server"); @@ -314,7 +315,7 @@ PlatformRemoteGDBServer::GetRemoteSystemArchitecture () return m_gdb_client.GetSystemArchitecture(); } -lldb_private::ConstString +ConstString PlatformRemoteGDBServer::GetRemoteWorkingDirectory() { if (IsConnected()) @@ -340,7 +341,7 @@ PlatformRemoteGDBServer::GetRemoteWorkingDirectory() } bool -PlatformRemoteGDBServer::SetRemoteWorkingDirectory(const lldb_private::ConstString &path) +PlatformRemoteGDBServer::SetRemoteWorkingDirectory(const ConstString &path) { if (IsConnected()) { @@ -475,7 +476,7 @@ PlatformRemoteGDBServer::GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &p Error PlatformRemoteGDBServer::LaunchProcess (ProcessLaunchInfo &launch_info) { - Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM)); + Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM)); Error error; if (log) @@ -533,7 +534,7 @@ PlatformRemoteGDBServer::LaunchProcess (ProcessLaunchInfo &launch_info) int arg_packet_err; { // Scope for the scoped timeout object - GDBRemoteCommunication::ScopedTimeout timeout(m_gdb_client, 5); + process_gdb_remote::GDBRemoteCommunication::ScopedTimeout timeout(m_gdb_client, 5); arg_packet_err = m_gdb_client.SendArgumentsPacket (launch_info); } @@ -579,10 +580,10 @@ PlatformRemoteGDBServer::KillProcess (const lldb::pid_t pid) } lldb::ProcessSP -PlatformRemoteGDBServer::DebugProcess (lldb_private::ProcessLaunchInfo &launch_info, - lldb_private::Debugger &debugger, - lldb_private::Target *target, // Can be NULL, if NULL create a new target, else use existing one - lldb_private::Error &error) +PlatformRemoteGDBServer::DebugProcess (ProcessLaunchInfo &launch_info, + Debugger &debugger, + Target *target, // Can be NULL, if NULL create a new target, else use existing one + Error &error) { lldb::ProcessSP process_sp; if (IsRemote()) @@ -674,7 +675,7 @@ PlatformRemoteGDBServer::KillSpawnedProcess (lldb::pid_t pid) } lldb::ProcessSP -PlatformRemoteGDBServer::Attach (lldb_private::ProcessAttachInfo &attach_info, +PlatformRemoteGDBServer::Attach (ProcessAttachInfo &attach_info, Debugger &debugger, Target *target, // Can be NULL, if NULL create a new target, else use existing one Error &error) @@ -777,7 +778,7 @@ PlatformRemoteGDBServer::SetFilePermissions (const char *path, uint32_t file_per lldb::user_id_t -PlatformRemoteGDBServer::OpenFile (const lldb_private::FileSpec& file_spec, +PlatformRemoteGDBServer::OpenFile (const FileSpec& file_spec, uint32_t flags, uint32_t mode, Error &error) @@ -792,7 +793,7 @@ PlatformRemoteGDBServer::CloseFile (lldb::user_id_t fd, Error &error) } lldb::user_id_t -PlatformRemoteGDBServer::GetFileSize (const lldb_private::FileSpec& file_spec) +PlatformRemoteGDBServer::GetFileSize (const FileSpec& file_spec) { return m_gdb_client.GetFileSize(file_spec); } @@ -817,9 +818,9 @@ PlatformRemoteGDBServer::WriteFile (lldb::user_id_t fd, return m_gdb_client.WriteFile (fd, offset, src, src_len, error); } -lldb_private::Error -PlatformRemoteGDBServer::PutFile (const lldb_private::FileSpec& source, - const lldb_private::FileSpec& destination, +Error +PlatformRemoteGDBServer::PutFile (const FileSpec& source, + const FileSpec& destination, uint32_t uid, uint32_t gid) { @@ -848,12 +849,12 @@ PlatformRemoteGDBServer::Unlink (const char *path) } bool -PlatformRemoteGDBServer::GetFileExists (const lldb_private::FileSpec& file_spec) +PlatformRemoteGDBServer::GetFileExists (const FileSpec& file_spec) { return m_gdb_client.GetFileExists (file_spec); } -lldb_private::Error +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 diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h index cb3257ad699..9d9a6eccdd6 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h @@ -19,7 +19,10 @@ #include "lldb/Target/Platform.h" #include "../../Process/gdb-remote/GDBRemoteCommunicationClient.h" -class PlatformRemoteGDBServer : public lldb_private::Platform +namespace lldb_private { +namespace platform_gdb_server { + +class PlatformRemoteGDBServer : public Platform { public: @@ -30,9 +33,9 @@ public: Terminate (); static lldb::PlatformSP - CreateInstance (bool force, const lldb_private::ArchSpec *arch); + CreateInstance (bool force, const ArchSpec *arch); - static lldb_private::ConstString + static ConstString GetPluginNameStatic(); static const char * @@ -47,7 +50,7 @@ public: //------------------------------------------------------------ // lldb_private::PluginInterface functions //------------------------------------------------------------ - lldb_private::ConstString + ConstString GetPluginName() override { return GetPluginNameStatic(); @@ -63,56 +66,54 @@ public: //------------------------------------------------------------ // lldb_private::Platform functions //------------------------------------------------------------ - lldb_private::Error - ResolveExecutable (const lldb_private::ModuleSpec &module_spec, + Error + ResolveExecutable (const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, - const lldb_private::FileSpecList *module_search_paths_ptr) override; + const FileSpecList *module_search_paths_ptr) override; bool - GetModuleSpec (const lldb_private::FileSpec& module_file_spec, - const lldb_private::ArchSpec& arch, - lldb_private::ModuleSpec &module_spec) override; + GetModuleSpec (const FileSpec& module_file_spec, + const ArchSpec& arch, + ModuleSpec &module_spec) override; const char * GetDescription () override; - lldb_private::Error - GetFileWithUUID (const lldb_private::FileSpec &platform_file, - const lldb_private::UUID *uuid_ptr, - lldb_private::FileSpec &local_file) override; + Error + GetFileWithUUID (const FileSpec &platform_file, + const UUID *uuid_ptr, + FileSpec &local_file) override; bool - GetProcessInfo (lldb::pid_t pid, - lldb_private::ProcessInstanceInfo &proc_info) override; + GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &proc_info) override; uint32_t - FindProcesses (const lldb_private::ProcessInstanceInfoMatch &match_info, - lldb_private::ProcessInstanceInfoList &process_infos) override; + FindProcesses (const ProcessInstanceInfoMatch &match_info, + ProcessInstanceInfoList &process_infos) override; - lldb_private::Error - LaunchProcess (lldb_private::ProcessLaunchInfo &launch_info) override; + Error + LaunchProcess (ProcessLaunchInfo &launch_info) override; - lldb_private::Error + Error KillProcess (const lldb::pid_t pid) override; lldb::ProcessSP - DebugProcess (lldb_private::ProcessLaunchInfo &launch_info, - lldb_private::Debugger &debugger, - lldb_private::Target *target, // Can be NULL, if NULL create a new target, else use existing one - lldb_private::Error &error) override; + DebugProcess (ProcessLaunchInfo &launch_info, + Debugger &debugger, + Target *target, // Can be NULL, if NULL create a new target, else use existing one + Error &error) override; lldb::ProcessSP - Attach (lldb_private::ProcessAttachInfo &attach_info, - lldb_private::Debugger &debugger, - lldb_private::Target *target, // Can be NULL, if NULL create a new target, else use existing one - lldb_private::Error &error) override; + Attach (ProcessAttachInfo &attach_info, + Debugger &debugger, + Target *target, // Can be NULL, if NULL create a new target, else use existing one + Error &error) override; bool - GetSupportedArchitectureAtIndex (uint32_t idx, lldb_private::ArchSpec &arch) override; + GetSupportedArchitectureAtIndex (uint32_t idx, ArchSpec &arch) override; size_t - GetSoftwareBreakpointTrapOpcode (lldb_private::Target &target, - lldb_private::BreakpointSite *bp_site) override; + GetSoftwareBreakpointTrapOpcode (Target &target, BreakpointSite *bp_site) override; bool GetRemoteOSVersion () override; @@ -124,14 +125,14 @@ public: GetRemoteOSKernelDescription (std::string &s) override; // Remote Platform subclasses need to override this function - lldb_private::ArchSpec + ArchSpec GetRemoteSystemArchitecture () override; - lldb_private::ConstString + ConstString GetRemoteWorkingDirectory() override; bool - SetRemoteWorkingDirectory(const lldb_private::ConstString &path) override; + SetRemoteWorkingDirectory(const ConstString &path) override; // Remote subclasses should override this and return a valid instance // name if connected. @@ -147,65 +148,61 @@ public: bool IsConnected () const override; - lldb_private::Error - ConnectRemote (lldb_private::Args& args) override; + Error + ConnectRemote (Args& args) override; - lldb_private::Error + Error DisconnectRemote () override; - lldb_private::Error + Error MakeDirectory (const char *path, uint32_t file_permissions) override; - lldb_private::Error + Error GetFilePermissions (const char *path, uint32_t &file_permissions) override; - lldb_private::Error + Error SetFilePermissions (const char *path, uint32_t file_permissions) override; lldb::user_id_t - OpenFile (const lldb_private::FileSpec& file_spec, - uint32_t flags, - uint32_t mode, - lldb_private::Error &error) override; + OpenFile (const FileSpec& file_spec, uint32_t flags, uint32_t mode, Error &error) override; bool - CloseFile (lldb::user_id_t fd, - lldb_private::Error &error) override; + CloseFile (lldb::user_id_t fd, Error &error) override; uint64_t ReadFile (lldb::user_id_t fd, uint64_t offset, void *data_ptr, uint64_t len, - lldb_private::Error &error) override; + Error &error) override; uint64_t WriteFile (lldb::user_id_t fd, uint64_t offset, const void* data, uint64_t len, - lldb_private::Error &error) override; + Error &error) override; lldb::user_id_t - GetFileSize (const lldb_private::FileSpec& file_spec) override; + GetFileSize (const FileSpec& file_spec) override; - lldb_private::Error - PutFile (const lldb_private::FileSpec& source, - const lldb_private::FileSpec& destination, + Error + PutFile (const FileSpec& source, + const FileSpec& destination, uint32_t uid = UINT32_MAX, uint32_t gid = UINT32_MAX) override; - lldb_private::Error + Error CreateSymlink (const char *src, const char *dst) override; bool - GetFileExists (const lldb_private::FileSpec& file_spec) override; + GetFileExists (const FileSpec& file_spec) override; - lldb_private::Error + Error Unlink (const char *path) override; - lldb_private::Error + 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 @@ -217,7 +214,7 @@ public: CalculateTrapHandlerSymbolNames () override; protected: - GDBRemoteCommunicationClient m_gdb_client; + process_gdb_remote::GDBRemoteCommunicationClient m_gdb_client; std::string m_platform_description; // After we connect we can get a more complete description of what we are connected to std::string m_platform_hostname; @@ -235,4 +232,7 @@ private: }; +} // namespace platform_gdb_server +} // namespace lldb_private + #endif // liblldb_PlatformRemoteGDBServer_h_ |