diff options
58 files changed, 772 insertions, 631 deletions
diff --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp index 8ad2c2953b3..98b08d0927f 100644 --- a/lldb/source/Host/linux/Host.cpp +++ b/lldb/source/Host/linux/Host.cpp @@ -64,7 +64,7 @@ static bool ReadProcPseudoFileStat (lldb::pid_t pid, ProcessStatInfo& stat_info) { // Read the /proc/$PID/stat file. - lldb::DataBufferSP buf_sp = ProcFileReader::ReadIntoDataBuffer (pid, "stat"); + lldb::DataBufferSP buf_sp = process_linux::ProcFileReader::ReadIntoDataBuffer (pid, "stat"); // The filename of the executable is stored in parenthesis right after the pid. We look for the closing // parenthesis for the filename and work from there in case the name has something funky like ')' in it. @@ -117,7 +117,7 @@ GetLinuxProcessUserAndGroup (lldb::pid_t pid, ProcessInstanceInfo &process_info, uint32_t eGid = UINT32_MAX; // Effective Group ID // Read the /proc/$PID/status file and parse the Uid:, Gid:, and TracerPid: fields. - lldb::DataBufferSP buf_sp = ProcFileReader::ReadIntoDataBuffer (pid, "status"); + lldb::DataBufferSP buf_sp = process_linux::ProcFileReader::ReadIntoDataBuffer (pid, "status"); static const char uid_token[] = "Uid:"; char *buf_uid = strstr ((char *)buf_sp->GetBytes(), uid_token); @@ -157,13 +157,13 @@ GetLinuxProcessUserAndGroup (lldb::pid_t pid, ProcessInstanceInfo &process_info, lldb::DataBufferSP Host::GetAuxvData(lldb_private::Process *process) { - return ProcFileReader::ReadIntoDataBuffer (process->GetID(), "auxv"); + return process_linux::ProcFileReader::ReadIntoDataBuffer (process->GetID(), "auxv"); } lldb::DataBufferSP Host::GetAuxvData (lldb::pid_t pid) { - return ProcFileReader::ReadIntoDataBuffer (pid, "auxv"); + return process_linux::ProcFileReader::ReadIntoDataBuffer (pid, "auxv"); } static bool @@ -328,7 +328,7 @@ GetProcessAndStatInfo (lldb::pid_t pid, ProcessInstanceInfo &process_info, Proce lldb::DataBufferSP buf_sp; // Get the process environment. - buf_sp = ProcFileReader::ReadIntoDataBuffer(pid, "environ"); + buf_sp = process_linux::ProcFileReader::ReadIntoDataBuffer(pid, "environ"); Args &info_env = process_info.GetEnvironmentEntries(); char *next_var = (char *)buf_sp->GetBytes(); char *end_buf = next_var + buf_sp->GetByteSize(); @@ -339,7 +339,7 @@ GetProcessAndStatInfo (lldb::pid_t pid, ProcessInstanceInfo &process_info, Proce } // Get the command line used to start the process. - buf_sp = ProcFileReader::ReadIntoDataBuffer(pid, "cmdline"); + buf_sp = process_linux::ProcFileReader::ReadIntoDataBuffer(pid, "cmdline"); // Grab Arg0 first, if there is one. char *cmd = (char *)buf_sp->GetBytes(); diff --git a/lldb/source/Host/linux/HostThreadLinux.cpp b/lldb/source/Host/linux/HostThreadLinux.cpp index 619bd245ab2..81512154cd5 100644 --- a/lldb/source/Host/linux/HostThreadLinux.cpp +++ b/lldb/source/Host/linux/HostThreadLinux.cpp @@ -37,7 +37,7 @@ void HostThreadLinux::GetName(lldb::thread_t thread, llvm::SmallVectorImpl<char> &name) { // Read /proc/$TID/comm file. - lldb::DataBufferSP buf_sp = ProcFileReader::ReadIntoDataBuffer(thread, "comm"); + lldb::DataBufferSP buf_sp = process_linux::ProcFileReader::ReadIntoDataBuffer(thread, "comm"); const char *comm_str = (const char *)buf_sp->GetBytes(); const char *cr_str = ::strchr(comm_str, '\n'); size_t length = cr_str ? (cr_str - comm_str) : strlen(comm_str); diff --git a/lldb/source/Initialization/InitializeLLDB.cpp b/lldb/source/Initialization/InitializeLLDB.cpp index dcaafb09baf..1e10842afd2 100644 --- a/lldb/source/Initialization/InitializeLLDB.cpp +++ b/lldb/source/Initialization/InitializeLLDB.cpp @@ -130,7 +130,7 @@ InitializeForLLGSPrivate() llvm::install_fatal_error_handler(fatal_error_handler, 0); - ProcessGDBRemoteLog::Initialize(); + process_gdb_remote::ProcessGDBRemoteLog::Initialize(); // Initialize plug-ins ObjectContainerBSDArchive::Initialize(); @@ -138,10 +138,10 @@ InitializeForLLGSPrivate() ObjectFilePECOFF::Initialize(); DynamicLoaderPOSIXDYLD::Initialize(); PlatformFreeBSD::Initialize(); - PlatformLinux::Initialize(); + platform_linux::PlatformLinux::Initialize(); PlatformWindows::Initialize(); PlatformKalimba::Initialize(); - PlatformAndroid::Initialize(); + platform_android::PlatformAndroid::Initialize(); //---------------------------------------------------------------------- // Apple/Darwin hosted plugins @@ -215,7 +215,7 @@ InitializePrivate() //---------------------------------------------------------------------- // Linux hosted plugins //---------------------------------------------------------------------- - ProcessLinux::Initialize(); + process_linux::ProcessLinux::Initialize(); #endif #if defined(_MSC_VER) DynamicLoaderWindows::Initialize(); @@ -232,9 +232,9 @@ InitializePrivate() //---------------------------------------------------------------------- // Platform agnostic plugins //---------------------------------------------------------------------- - PlatformRemoteGDBServer::Initialize(); + platform_gdb_server::PlatformRemoteGDBServer::Initialize(); - ProcessGDBRemote::Initialize(); + process_gdb_remote::ProcessGDBRemote::Initialize(); DynamicLoaderStatic::Initialize(); // Scan for any system or user LLDB plug-ins @@ -259,10 +259,10 @@ TerminateForLLGSPrivate() ObjectFilePECOFF::Terminate(); DynamicLoaderPOSIXDYLD::Terminate(); PlatformFreeBSD::Terminate(); - PlatformLinux::Terminate(); + platform_linux::PlatformLinux::Terminate(); PlatformWindows::Terminate(); PlatformKalimba::Terminate(); - PlatformAndroid::Terminate(); + platform_android::PlatformAndroid::Terminate(); DynamicLoaderMacOSXDYLD::Terminate(); ObjectContainerUniversalMachO::Terminate(); PlatformMacOSX::Terminate(); @@ -329,7 +329,7 @@ TerminatePrivate() #endif #if defined(__linux__) - ProcessLinux::Terminate(); + process_linux::ProcessLinux::Terminate(); #endif #if defined(__FreeBSD__) @@ -337,8 +337,8 @@ TerminatePrivate() #endif Debugger::SettingsTerminate(); - PlatformRemoteGDBServer::Terminate(); - ProcessGDBRemote::Terminate(); + platform_gdb_server::PlatformRemoteGDBServer::Terminate(); + process_gdb_remote::ProcessGDBRemote::Terminate(); DynamicLoaderStatic::Terminate(); TerminateForLLGSPrivate(); diff --git a/lldb/source/Plugins/Platform/Android/AdbClient.cpp b/lldb/source/Plugins/Platform/Android/AdbClient.cpp index d3d5878380b..f9540650a6e 100644 --- a/lldb/source/Plugins/Platform/Android/AdbClient.cpp +++ b/lldb/source/Plugins/Platform/Android/AdbClient.cpp @@ -20,6 +20,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::platform_android; namespace { diff --git a/lldb/source/Plugins/Platform/Android/AdbClient.h b/lldb/source/Plugins/Platform/Android/AdbClient.h index f372b244021..3dcc0068596 100644 --- a/lldb/source/Plugins/Platform/Android/AdbClient.h +++ b/lldb/source/Plugins/Platform/Android/AdbClient.h @@ -24,6 +24,7 @@ #include "lldb/Host/ConnectionFileDescriptor.h" namespace lldb_private { +namespace platform_android { class AdbClient { @@ -71,6 +72,7 @@ private: ConnectionFileDescriptor m_conn; }; +} // namespace platform_android } // namespace lldb_private #endif // liblldb_AdbClient_h_ diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp index e339e03db6d..7bc3287d035 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp @@ -21,6 +21,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::platform_android; static uint32_t g_initialize_count = 0; @@ -59,7 +60,7 @@ PlatformAndroid::Terminate () PlatformSP PlatformAndroid::CreateInstance (bool force, const ArchSpec *arch) { - Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM)); + Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM)); if (log) { const char *arch_name; @@ -139,7 +140,7 @@ PlatformAndroid::~PlatformAndroid() { } -lldb_private::ConstString +ConstString PlatformAndroid::GetPluginNameStatic (bool is_host) { if (is_host) @@ -163,7 +164,7 @@ PlatformAndroid::GetPluginDescriptionStatic (bool is_host) return "Remote Android user platform plug-in."; } -lldb_private::ConstString +ConstString PlatformAndroid::GetPluginName() { return GetPluginNameStatic(IsHost()); diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.h b/lldb/source/Plugins/Platform/Android/PlatformAndroid.h index 08b3a027072..9b0a37ba232 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.h +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.h @@ -20,8 +20,9 @@ #include "Plugins/Platform/Linux/PlatformLinux.h" namespace lldb_private { +namespace platform_android { - class PlatformAndroid : public PlatformLinux + class PlatformAndroid : public platform_linux::PlatformLinux { public: static void @@ -39,15 +40,15 @@ namespace lldb_private { // lldb_private::PluginInterface functions //------------------------------------------------------------ static lldb::PlatformSP - CreateInstance (bool force, const lldb_private::ArchSpec *arch); + CreateInstance (bool force, const ArchSpec *arch); - static lldb_private::ConstString + static ConstString GetPluginNameStatic (bool is_host); static const char * GetPluginDescriptionStatic (bool is_host); - lldb_private::ConstString + ConstString GetPluginName() override; uint32_t @@ -60,8 +61,8 @@ namespace lldb_private { // lldb_private::Platform functions //------------------------------------------------------------ - lldb_private::Error - ConnectRemote (lldb_private::Args& args) override; + Error + ConnectRemote (Args& args) override; protected: const char * @@ -71,6 +72,8 @@ namespace lldb_private { std::string m_device_id; DISALLOW_COPY_AND_ASSIGN (PlatformAndroid); }; + +} // namespace platofor_android } // namespace lldb_private #endif // liblldb_PlatformAndroid_h_ diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp index b3c0ff4b12c..bb030f241fe 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp @@ -18,13 +18,14 @@ using namespace lldb; using namespace lldb_private; +using namespace platform_android; static const lldb::pid_t g_remote_platform_pid = 0; // Alias for the process id of lldb-platform static Error ForwardPortWithAdb (uint16_t port, std::string& device_id) { - Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM)); + Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM)); // Fetch the device list from ADB and if only 1 device found then use that device // TODO: Handle the case when more device is available diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h index 19295810b1f..0cac44cbf79 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.h @@ -19,7 +19,10 @@ // Project includes #include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h" -class PlatformAndroidRemoteGDBServer : public PlatformRemoteGDBServer +namespace lldb_private { +namespace platform_android { + +class PlatformAndroidRemoteGDBServer : public platform_gdb_server::PlatformRemoteGDBServer { public: PlatformAndroidRemoteGDBServer (); @@ -27,10 +30,10 @@ public: virtual ~PlatformAndroidRemoteGDBServer (); - lldb_private::Error - ConnectRemote (lldb_private::Args& args) override; + Error + ConnectRemote (Args& args) override; - lldb_private::Error + Error DisconnectRemote () override; protected: @@ -47,4 +50,7 @@ private: }; +} // namespace platform_android +} // namespace lldb_private + #endif // liblldb_PlatformAndroidRemoteGDBServer_h_ diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp index cfa604aa739..7497c52511f 100644 --- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp +++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp @@ -44,6 +44,8 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::platform_linux; +using namespace lldb_private::process_linux; static uint32_t g_initialize_count = 0; @@ -58,56 +60,66 @@ namespace ePropertyUseLlgsForLocal = 0, }; - const PropertyDefinition* - GetStaticPropertyDefinitions () + class PlatformLinuxProperties : public Properties { - static PropertyDefinition - g_properties[] = - { - { "use-llgs-for-local" , OptionValue::eTypeBoolean, true, true, NULL, NULL, "Control whether the platform uses llgs for local debug sessions." }, - { NULL , OptionValue::eTypeInvalid, false, 0 , NULL, NULL, NULL } - }; + public: + static ConstString& + GetSettingName (); - // Allow environment variable to disable llgs-local. - if (getenv("PLATFORM_LINUX_DISABLE_LLGS_LOCAL")) - g_properties[ePropertyUseLlgsForLocal].default_uint_value = false; + PlatformLinuxProperties(); - return g_properties; - } -} + virtual + ~PlatformLinuxProperties() = default; -class PlatformLinuxProperties : public Properties -{ -public: + bool + GetUseLlgsForLocal() const; - static ConstString & - GetSettingName () - { - static ConstString g_setting_name("linux"); - return g_setting_name; - } + private: + static const PropertyDefinition* + GetStaticPropertyDefinitions(); + }; - PlatformLinuxProperties() : + typedef std::shared_ptr<PlatformLinuxProperties> PlatformLinuxPropertiesSP; + +} // anonymous namespace + +PlatformLinuxProperties::PlatformLinuxProperties() : Properties () - { - m_collection_sp.reset (new OptionValueProperties(GetSettingName ())); - m_collection_sp->Initialize (GetStaticPropertyDefinitions ()); - } +{ + m_collection_sp.reset (new OptionValueProperties(GetSettingName ())); + m_collection_sp->Initialize (GetStaticPropertyDefinitions ()); +} - virtual - ~PlatformLinuxProperties() - { - } +ConstString& +PlatformLinuxProperties::GetSettingName () +{ + static ConstString g_setting_name("linux"); + return g_setting_name; +} + +bool +PlatformLinuxProperties::GetUseLlgsForLocal() const +{ + const uint32_t idx = ePropertyUseLlgsForLocal; + return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, GetStaticPropertyDefinitions()[idx].default_uint_value != 0); +} - bool - GetUseLlgsForLocal() const +const PropertyDefinition* +PlatformLinuxProperties::GetStaticPropertyDefinitions() +{ + static PropertyDefinition + g_properties[] = { - const uint32_t idx = ePropertyUseLlgsForLocal; - return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, GetStaticPropertyDefinitions()[idx].default_uint_value != 0); - } -}; + { "use-llgs-for-local" , OptionValue::eTypeBoolean, true, true, NULL, NULL, "Control whether the platform uses llgs for local debug sessions." }, + { NULL , OptionValue::eTypeInvalid, false, 0 , NULL, NULL, NULL } + }; -typedef std::shared_ptr<PlatformLinuxProperties> PlatformLinuxPropertiesSP; + // Allow environment variable to disable llgs-local. + if (getenv("PLATFORM_LINUX_DISABLE_LLGS_LOCAL")) + g_properties[ePropertyUseLlgsForLocal].default_uint_value = false; + + return g_properties; +} static const PlatformLinuxPropertiesSP & GetGlobalProperties() @@ -119,7 +131,7 @@ GetGlobalProperties() } void -PlatformLinux::DebuggerInitialize (lldb_private::Debugger &debugger) +PlatformLinux::DebuggerInitialize (Debugger &debugger) { if (!PluginManager::GetSettingForPlatformPlugin (debugger, PlatformLinuxProperties::GetSettingName())) { @@ -137,7 +149,7 @@ PlatformLinux::DebuggerInitialize (lldb_private::Debugger &debugger) PlatformSP PlatformLinux::CreateInstance (bool force, const ArchSpec *arch) { - Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM)); + Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM)); if (log) { const char *arch_name; @@ -209,7 +221,7 @@ PlatformLinux::CreateInstance (bool force, const ArchSpec *arch) } -lldb_private::ConstString +ConstString PlatformLinux::GetPluginNameStatic (bool is_host) { if (is_host) @@ -233,7 +245,7 @@ PlatformLinux::GetPluginDescriptionStatic (bool is_host) return "Remote Linux user platform plug-in."; } -lldb_private::ConstString +ConstString PlatformLinux::GetPluginName() { return GetPluginNameStatic(IsHost()); @@ -673,7 +685,7 @@ PlatformLinux::DebugProcess (ProcessLaunchInfo &launch_info, Target *target, // Can be NULL, if NULL create a new target, else use existing one Error &error) { - Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM)); + Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_PLATFORM)); if (log) log->Printf ("PlatformLinux::%s entered (target %p)", __FUNCTION__, static_cast<void*>(target)); @@ -844,10 +856,9 @@ PlatformLinux::CalculateTrapHandlerSymbolNames () } Error -PlatformLinux::LaunchNativeProcess ( - ProcessLaunchInfo &launch_info, - lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate, - NativeProcessProtocolSP &process_sp) +PlatformLinux::LaunchNativeProcess (ProcessLaunchInfo &launch_info, + NativeProcessProtocol::NativeDelegate &native_delegate, + NativeProcessProtocolSP &process_sp) { #if !defined(__linux__) return Error("Only implemented on Linux hosts"); @@ -883,7 +894,7 @@ PlatformLinux::LaunchNativeProcess ( Error PlatformLinux::AttachNativeProcess (lldb::pid_t pid, - lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate, + NativeProcessProtocol::NativeDelegate &native_delegate, NativeProcessProtocolSP &process_sp) { #if !defined(__linux__) diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.h b/lldb/source/Plugins/Platform/Linux/PlatformLinux.h index c9140b4aba6..626b58fe509 100644 --- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.h +++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.h @@ -17,13 +17,14 @@ #include "Plugins/Platform/POSIX/PlatformPOSIX.h" namespace lldb_private { +namespace platform_linux { class PlatformLinux : public PlatformPOSIX { public: static void - DebuggerInitialize (lldb_private::Debugger &debugger); + DebuggerInitialize (Debugger &debugger); static void Initialize (); @@ -40,15 +41,15 @@ namespace lldb_private { // lldb_private::PluginInterface functions //------------------------------------------------------------ static lldb::PlatformSP - CreateInstance (bool force, const lldb_private::ArchSpec *arch); + CreateInstance (bool force, const ArchSpec *arch); - static lldb_private::ConstString + static ConstString GetPluginNameStatic (bool is_host); static const char * GetPluginDescriptionStatic (bool is_host); - lldb_private::ConstString + ConstString GetPluginName() override; uint32_t @@ -61,7 +62,7 @@ namespace lldb_private { // lldb_private::Platform functions //------------------------------------------------------------ Error - ResolveExecutable (const lldb_private::ModuleSpec &module_spec, + ResolveExecutable (const ModuleSpec &module_spec, lldb::ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr) override; @@ -110,12 +111,12 @@ namespace lldb_private { Error LaunchNativeProcess ( ProcessLaunchInfo &launch_info, - lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate, + NativeProcessProtocol::NativeDelegate &native_delegate, NativeProcessProtocolSP &process_sp) override; Error AttachNativeProcess (lldb::pid_t pid, - lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate, + NativeProcessProtocol::NativeDelegate &native_delegate, NativeProcessProtocolSP &process_sp) override; static bool @@ -124,6 +125,8 @@ namespace lldb_private { private: DISALLOW_COPY_AND_ASSIGN (PlatformLinux); }; + +} // namespace platform_linux } // namespace lldb_private #endif // liblldb_PlatformLinux_h_ 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_ diff --git a/lldb/source/Plugins/Process/Linux/LinuxThread.cpp b/lldb/source/Plugins/Process/Linux/LinuxThread.cpp index 78668e682da..e3b72ef305f 100644 --- a/lldb/source/Plugins/Process/Linux/LinuxThread.cpp +++ b/lldb/source/Plugins/Process/Linux/LinuxThread.cpp @@ -15,6 +15,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_linux; //------------------------------------------------------------------------------ // Constructors and destructors. diff --git a/lldb/source/Plugins/Process/Linux/LinuxThread.h b/lldb/source/Plugins/Process/Linux/LinuxThread.h index 991950a9dcf..4a196f0d7a7 100644 --- a/lldb/source/Plugins/Process/Linux/LinuxThread.h +++ b/lldb/source/Plugins/Process/Linux/LinuxThread.h @@ -13,18 +13,20 @@ // Other libraries and framework includes #include "Plugins/Process/POSIX/POSIXThread.h" +namespace lldb_private { +namespace process_linux { + //------------------------------------------------------------------------------ // @class LinuxThread // @brief Abstraction of a Linux thread. -class LinuxThread - : public POSIXThread +class LinuxThread : public POSIXThread { public: //------------------------------------------------------------------ // Constructors and destructors //------------------------------------------------------------------ - LinuxThread(lldb_private::Process &process, lldb::tid_t tid); + LinuxThread(Process &process, lldb::tid_t tid); virtual ~LinuxThread(); @@ -36,4 +38,7 @@ public: RefreshStateAfterStop() override; }; +} // namespace process_linux +} // namespace lldb_private + #endif // #ifndef liblldb_LinuxThread_H_ diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index 410ad53eac0..0dfee5ef473 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -138,6 +138,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_linux; using namespace llvm; // Private bits we only need internally. @@ -178,7 +179,7 @@ namespace // Grab process info for the running process. ProcessInstanceInfo process_info; if (!platform.GetProcessInfo (pid, process_info)) - return lldb_private::Error("failed to get process info"); + return Error("failed to get process info"); // Resolve the executable module. ModuleSP exe_module_sp; @@ -201,7 +202,7 @@ namespace } void - DisplayBytes (lldb_private::StreamString &s, void *bytes, uint32_t count) + DisplayBytes (StreamString &s, void *bytes, uint32_t count) { uint8_t *ptr = (uint8_t *)bytes; const uint32_t loop_count = std::min<uint32_t>(DEBUG_PTRACE_MAXBYTES, count); @@ -631,7 +632,7 @@ namespace PTRACE(PTRACE_GETREGSET, m_tid, ®set, &ioVec, sizeof regs, m_error); if (m_error.Success()) { - lldb_private::ArchSpec arch; + ArchSpec arch; if (monitor->GetArchitecture(arch)) m_value.SetBytes((void *)(((unsigned char *)(®s)) + offset), 16, arch.GetByteOrder()); else @@ -649,7 +650,7 @@ namespace PTRACE(PTRACE_GETREGSET, m_tid, ®set, &ioVec, sizeof regs, m_error); if (m_error.Success()) { - lldb_private::ArchSpec arch; + ArchSpec arch; if (monitor->GetArchitecture(arch)) m_value.SetBytes((void *)(((unsigned char *)(regs)) + m_offset), 8, arch.GetByteOrder()); else @@ -1086,14 +1087,14 @@ NativeProcessLinux::OperationArgs::~OperationArgs() } NativeProcessLinux::LaunchArgs::LaunchArgs(NativeProcessLinux *monitor, - lldb_private::Module *module, + Module *module, char const **argv, char const **envp, const std::string &stdin_path, const std::string &stdout_path, const std::string &stderr_path, const char *working_dir, - const lldb_private::ProcessLaunchInfo &launch_info) + const ProcessLaunchInfo &launch_info) : OperationArgs(monitor), m_module(module), m_argv(argv), @@ -1120,11 +1121,11 @@ NativeProcessLinux::AttachArgs::~AttachArgs() // Public Static Methods // ----------------------------------------------------------------------------- -lldb_private::Error +Error NativeProcessLinux::LaunchProcess ( - lldb_private::Module *exe_module, - lldb_private::ProcessLaunchInfo &launch_info, - lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate, + Module *exe_module, + ProcessLaunchInfo &launch_info, + NativeProcessProtocol::NativeDelegate &native_delegate, NativeProcessProtocolSP &native_process_sp) { Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); @@ -1143,7 +1144,7 @@ NativeProcessLinux::LaunchProcess ( } } - const lldb_private::FileAction *file_action; + const FileAction *file_action; // Default of NULL will mean to use existing open file descriptors. std::string stdin_path; @@ -1224,10 +1225,10 @@ NativeProcessLinux::LaunchProcess ( return error; } -lldb_private::Error +Error NativeProcessLinux::AttachToProcess ( lldb::pid_t pid, - lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate, + NativeProcessProtocol::NativeDelegate &native_delegate, NativeProcessProtocolSP &native_process_sp) { Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); @@ -1304,8 +1305,8 @@ NativeProcessLinux::LaunchInferior ( const std::string &stdout_path, const std::string &stderr_path, const char *working_dir, - const lldb_private::ProcessLaunchInfo &launch_info, - lldb_private::Error &error) + const ProcessLaunchInfo &launch_info, + Error &error) { if (module) m_arch = module->GetArchitecture (); @@ -1363,7 +1364,7 @@ WAIT_AGAIN: } void -NativeProcessLinux::AttachToInferior (lldb::pid_t pid, lldb_private::Error &error) +NativeProcessLinux::AttachToInferior (lldb::pid_t pid, Error &error) { Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS)); if (log) @@ -1744,7 +1745,7 @@ NativeProcessLinux::Launch(LaunchArgs *args) } void -NativeProcessLinux::StartAttachOpThread(AttachArgs *args, lldb_private::Error &error) +NativeProcessLinux::StartAttachOpThread(AttachArgs *args, Error &error) { static const char *g_thread_name = "lldb.process.linux.operation"; @@ -3563,7 +3564,7 @@ NativeProcessLinux::GetEventMessage(lldb::tid_t tid, unsigned long *message) return op.GetError(); } -lldb_private::Error +Error NativeProcessLinux::Detach(lldb::tid_t tid) { if (tid == LLDB_INVALID_THREAD_ID) @@ -3960,7 +3961,7 @@ NativeProcessLinux::CallAfterRunningThreadsStopWithSkipTID (lldb::tid_t deferred CoordinatorErrorHandler); } -lldb_private::Error +Error NativeProcessLinux::RequestThreadStop (const lldb::pid_t pid, const lldb::tid_t tid) { Log* log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD)); diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h index b9aff86c984..3c597b64e73 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h @@ -27,13 +27,14 @@ #include "lldb/Host/common/NativeProcessProtocol.h" -namespace lldb_private -{ +namespace lldb_private { class Error; class Module; - class ThreadStateCoordinator; class Scalar; +namespace process_linux { + class ThreadStateCoordinator; + /// @class NativeProcessLinux /// @brief Manages communication with the inferior (debugee) process. /// @@ -45,17 +46,17 @@ namespace lldb_private { public: - static lldb_private::Error + static Error LaunchProcess ( Module *exe_module, ProcessLaunchInfo &launch_info, - lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate, + NativeProcessProtocol::NativeDelegate &native_delegate, NativeProcessProtocolSP &native_process_sp); - static lldb_private::Error + static Error AttachToProcess ( lldb::pid_t pid, - lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate, + NativeProcessProtocol::NativeDelegate &native_delegate, NativeProcessProtocolSP &native_process_sp); // --------------------------------------------------------------------- @@ -122,7 +123,7 @@ namespace lldb_private /// This method is provided for use by RegisterContextLinux derivatives. Error ReadRegisterValue(lldb::tid_t tid, unsigned offset, const char *reg_name, - unsigned size, lldb_private::RegisterValue &value); + unsigned size, RegisterValue &value); /// Writes the given value to the register identified by the given /// (architecture dependent) offset. @@ -130,7 +131,7 @@ namespace lldb_private /// This method is provided for use by RegisterContextLinux derivatives. Error WriteRegisterValue(lldb::tid_t tid, unsigned offset, const char *reg_name, - const lldb_private::RegisterValue &value); + const RegisterValue &value); /// Reads all general purpose registers into the specified buffer. Error @@ -170,23 +171,23 @@ namespace lldb_private private: - lldb_private::ArchSpec m_arch; + ArchSpec m_arch; HostThread m_operation_thread; HostThread m_monitor_thread; // current operation which must be executed on the priviliged thread void *m_operation; - lldb_private::Mutex m_operation_mutex; + Mutex m_operation_mutex; // semaphores notified when Operation is ready to be processed and when // the operation is complete. sem_t m_operation_pending; sem_t m_operation_done; - lldb_private::LazyBool m_supports_mem_region; + LazyBool m_supports_mem_region; std::vector<MemoryRegionInfo> m_mem_region_cache; - lldb_private::Mutex m_mem_region_cache_mutex; + Mutex m_mem_region_cache_mutex; std::unique_ptr<ThreadStateCoordinator> m_coordinator_up; HostThread m_coordinator_thread; @@ -199,7 +200,7 @@ namespace lldb_private NativeProcessLinux *m_monitor; // The monitor performing the attach. sem_t m_semaphore; // Posted to once operation complete. - lldb_private::Error m_error; // Set if process operation failed. + Error m_error; // Set if process operation failed. }; /// @class LauchArgs @@ -209,25 +210,25 @@ namespace lldb_private struct LaunchArgs : OperationArgs { LaunchArgs(NativeProcessLinux *monitor, - lldb_private::Module *module, + Module *module, char const **argv, char const **envp, const std::string &stdin_path, const std::string &stdout_path, const std::string &stderr_path, const char *working_dir, - const lldb_private::ProcessLaunchInfo &launch_info); + const ProcessLaunchInfo &launch_info); ~LaunchArgs(); - lldb_private::Module *m_module; // The executable image to launch. - char const **m_argv; // Process arguments. - char const **m_envp; // Process environment. + Module *m_module; // The executable image to launch. + char const **m_argv; // Process arguments. + char const **m_envp; // Process environment. const std::string &m_stdin_path; // Redirect stdin if not empty. const std::string &m_stdout_path; // Redirect stdout if not empty. const std::string &m_stderr_path; // Redirect stderr if not empty. - const char *m_working_dir; // Working directory or NULL. - const lldb_private::ProcessLaunchInfo &m_launch_info; + const char *m_working_dir; // Working directory or NULL. + const ProcessLaunchInfo &m_launch_info; }; struct AttachArgs : OperationArgs @@ -256,7 +257,7 @@ namespace lldb_private const std::string &stdout_path, const std::string &stderr_path, const char *working_dir, - const lldb_private::ProcessLaunchInfo &launch_info, + const ProcessLaunchInfo &launch_info, Error &error); /// Attaches to an existing process. Forms the @@ -265,7 +266,7 @@ namespace lldb_private AttachToInferior (lldb::pid_t pid, Error &error); void - StartLaunchOpThread(LaunchArgs *args, lldb_private::Error &error); + StartLaunchOpThread(LaunchArgs *args, Error &error); static void * LaunchOpThread(void *arg); @@ -274,7 +275,7 @@ namespace lldb_private Launch(LaunchArgs *args); void - StartAttachOpThread(AttachArgs *args, lldb_private::Error &error); + StartAttachOpThread(AttachArgs *args, Error &error); static void * AttachOpThread(void *args); @@ -412,12 +413,14 @@ namespace lldb_private lldb::tid_t skip_stop_request_tid, const std::function<void (lldb::tid_t tid)> &call_after_function); - lldb_private::Error + Error Detach(lldb::tid_t tid); - lldb_private::Error + Error RequestThreadStop (const lldb::pid_t pid, const lldb::tid_t tid); }; -} // End lldb_private namespace. + +} // namespace process_linux +} // namespace lldb_private #endif // #ifndef liblldb_NativeProcessLinux_H_ diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp index 257ab052cd1..faf5042b122 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp @@ -21,6 +21,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_linux; // ARM64 general purpose registers. static const uint32_t g_gpr_regnums_arm64[] = @@ -115,7 +116,7 @@ namespace { } // Register sets for ARM64. -static const lldb_private::RegisterSet +static const RegisterSet g_reg_sets_arm64[k_num_register_sets] = { { "General Purpose Registers", "gpr", k_num_gpr_registers_arm64, g_gpr_regnums_arm64 }, @@ -156,7 +157,7 @@ NativeRegisterContextLinux_arm64::GetRegisterSetCount () const return k_num_register_sets; } -const lldb_private::RegisterSet * +const RegisterSet * NativeRegisterContextLinux_arm64::GetRegisterSet (uint32_t set_index) const { if (set_index < k_num_register_sets) @@ -165,7 +166,7 @@ NativeRegisterContextLinux_arm64::GetRegisterSet (uint32_t set_index) const return nullptr; } -lldb_private::Error +Error NativeRegisterContextLinux_arm64::ReadRegister (const RegisterInfo *reg_info, RegisterValue ®_value) { Error error; @@ -236,7 +237,7 @@ NativeRegisterContextLinux_arm64::ReadRegister (const RegisterInfo *reg_info, Re return error; } -lldb_private::Error +Error NativeRegisterContextLinux_arm64::WriteRegister (const RegisterInfo *reg_info, const RegisterValue ®_value) { if (!reg_info) @@ -281,12 +282,12 @@ NativeRegisterContextLinux_arm64::WriteRegister (const RegisterInfo *reg_info, c return Error ("failed - register wasn't recognized to be a GPR or an FPR, write strategy unknown"); } -lldb_private::Error +Error NativeRegisterContextLinux_arm64::ReadAllRegisterValues (lldb::DataBufferSP &data_sp) { Error error; - data_sp.reset (new lldb_private::DataBufferHeap (REG_CONTEXT_SIZE, 0)); + data_sp.reset (new DataBufferHeap (REG_CONTEXT_SIZE, 0)); if (!data_sp) return Error ("failed to allocate DataBufferHeap instance of size %" PRIu64, REG_CONTEXT_SIZE); @@ -316,7 +317,7 @@ NativeRegisterContextLinux_arm64::ReadAllRegisterValues (lldb::DataBufferSP &dat return error; } -lldb_private::Error +Error NativeRegisterContextLinux_arm64::WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) { Error error; @@ -360,7 +361,7 @@ NativeRegisterContextLinux_arm64::WriteAllRegisterValues (const lldb::DataBuffer return error; } -lldb_private::Error +Error NativeRegisterContextLinux_arm64::WriteRegisterRaw (uint32_t reg_index, const RegisterValue ®_value) { Error error; @@ -430,7 +431,7 @@ NativeRegisterContextLinux_arm64::WriteRegisterRaw (uint32_t reg_index, const Re value_to_write); } -lldb_private::Error +Error NativeRegisterContextLinux_arm64::ReadRegisterRaw (uint32_t reg_index, RegisterValue ®_value) { Error error; diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h index 92e0238fe6c..d64f5d19cdf 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h @@ -14,8 +14,9 @@ #include "lldb/Host/common/NativeRegisterContextRegisterInfo.h" #include "Plugins/Process/Utility/lldb-arm64-register-enums.h" -namespace lldb_private -{ +namespace lldb_private { +namespace process_linux { + class NativeProcessLinux; class NativeRegisterContextLinux_arm64 : public NativeRegisterContextRegisterInfo @@ -74,7 +75,7 @@ namespace lldb_private uint32_t fpcr; }; - uint64_t m_gpr_arm64[lldb_private::k_num_gpr_registers_arm64]; // 64-bit general purpose registers. + uint64_t m_gpr_arm64[k_num_gpr_registers_arm64]; // 64-bit general purpose registers. RegInfo m_reg_info; FPU m_fpr; // floating-point registers including extended register sets. @@ -96,10 +97,10 @@ namespace lldb_private bool WriteFPR (); - lldb_private::Error + Error ReadRegisterRaw (uint32_t reg_index, RegisterValue ®_value); - lldb_private::Error + Error WriteRegisterRaw (uint32_t reg_index, const RegisterValue ®_value); lldb::ByteOrder @@ -108,7 +109,9 @@ namespace lldb_private size_t GetGPRSize() const; }; -} + +} // namespace process_linux +} // namespace lldb_private #endif // #ifndef lldb_NativeRegisterContextLinux_arm64_h diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp index 3d798e6e0f9..0e4da3705ac 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp @@ -18,6 +18,7 @@ #include "Plugins/Process/Linux/NativeProcessLinux.h" using namespace lldb_private; +using namespace lldb_private::process_linux; // ---------------------------------------------------------------------------- // Private namespace. @@ -103,7 +104,7 @@ NativeRegisterContextLinux_mips64::GetRegisterSetCount () const return k_num_register_sets; } -const lldb_private::RegisterSet * +const RegisterSet * NativeRegisterContextLinux_mips64::GetRegisterSet (uint32_t set_index) const { if (set_index >= k_num_register_sets) @@ -122,7 +123,7 @@ NativeRegisterContextLinux_mips64::GetRegisterSet (uint32_t set_index) const return nullptr; } -lldb_private::Error +Error NativeRegisterContextLinux_mips64::ReadRegister (const RegisterInfo *reg_info, RegisterValue ®_value) { Error error; @@ -130,7 +131,7 @@ NativeRegisterContextLinux_mips64::ReadRegister (const RegisterInfo *reg_info, R return error; } -lldb_private::Error +Error NativeRegisterContextLinux_mips64::WriteRegister (const RegisterInfo *reg_info, const RegisterValue ®_value) { Error error; @@ -138,7 +139,7 @@ NativeRegisterContextLinux_mips64::WriteRegister (const RegisterInfo *reg_info, return error; } -lldb_private::Error +Error NativeRegisterContextLinux_mips64::ReadAllRegisterValues (lldb::DataBufferSP &data_sp) { Error error; @@ -146,7 +147,7 @@ NativeRegisterContextLinux_mips64::ReadAllRegisterValues (lldb::DataBufferSP &da return error; } -lldb_private::Error +Error NativeRegisterContextLinux_mips64::WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) { Error error; diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h index 35218b7eb58..a8014061b40 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h @@ -15,57 +15,59 @@ #include "Plugins/Process/Utility/RegisterContext_mips64.h" #include "Plugins/Process/Utility/RegisterContextLinux_mips64.h" -// --------------------------------------------------------------------------- -// Internal codes for mips64 GP registers. -// --------------------------------------------------------------------------- -enum -{ - k_first_gp_reg_mips64, - gp_reg_r0_mips64 = k_first_gp_reg_mips64, - gp_reg_r1_mips64, - gp_reg_r2_mips64, - gp_reg_r3_mips64, - gp_reg_r4_mips64, - gp_reg_r5_mips64, - gp_reg_r6_mips64, - gp_reg_r7_mips64, - gp_reg_r8_mips64, - gp_reg_r9_mips64, - gp_reg_r10_mips64, - gp_reg_r11_mips64, - gp_reg_r12_mips64, - gp_reg_r13_mips64, - gp_reg_r14_mips64, - gp_reg_r15_mips64, - gp_reg_r16_mips64, - gp_reg_r17_mips64, - gp_reg_r18_mips64, - gp_reg_r19_mips64, - gp_reg_r20_mips64, - gp_reg_r21_mips64, - gp_reg_r22_mips64, - gp_reg_r23_mips64, - gp_reg_r24_mips64, - gp_reg_r25_mips64, - gp_reg_r26_mips64, - gp_reg_r27_mips64, - gp_reg_r28_mips64, - gp_reg_r29_mips64, - gp_reg_r30_mips64, - gp_reg_r31_mips64, - gp_reg_mullo_mips64, - gp_reg_mulhi_mips64, - gp_reg_pc_mips64, - gp_reg_badvaddr_mips64, - gp_reg_sr_mips64, - gp_reg_cause_mips64, - k_num_gp_reg_mips64, -}; - -namespace lldb_private -{ + +namespace lldb_private { +namespace process_linux { + class NativeProcessLinux; + // --------------------------------------------------------------------------- + // Internal codes for mips64 GP registers. + // --------------------------------------------------------------------------- + enum + { + k_first_gp_reg_mips64, + gp_reg_r0_mips64 = k_first_gp_reg_mips64, + gp_reg_r1_mips64, + gp_reg_r2_mips64, + gp_reg_r3_mips64, + gp_reg_r4_mips64, + gp_reg_r5_mips64, + gp_reg_r6_mips64, + gp_reg_r7_mips64, + gp_reg_r8_mips64, + gp_reg_r9_mips64, + gp_reg_r10_mips64, + gp_reg_r11_mips64, + gp_reg_r12_mips64, + gp_reg_r13_mips64, + gp_reg_r14_mips64, + gp_reg_r15_mips64, + gp_reg_r16_mips64, + gp_reg_r17_mips64, + gp_reg_r18_mips64, + gp_reg_r19_mips64, + gp_reg_r20_mips64, + gp_reg_r21_mips64, + gp_reg_r22_mips64, + gp_reg_r23_mips64, + gp_reg_r24_mips64, + gp_reg_r25_mips64, + gp_reg_r26_mips64, + gp_reg_r27_mips64, + gp_reg_r28_mips64, + gp_reg_r29_mips64, + gp_reg_r30_mips64, + gp_reg_r31_mips64, + gp_reg_mullo_mips64, + gp_reg_mulhi_mips64, + gp_reg_pc_mips64, + gp_reg_badvaddr_mips64, + gp_reg_sr_mips64, + gp_reg_cause_mips64, + k_num_gp_reg_mips64, + }; + class NativeRegisterContextLinux_mips64 : public NativeRegisterContextRegisterInfo { public: @@ -116,7 +118,9 @@ namespace lldb_private uint32_t NumSupportedHardwareWatchpoints () override; }; -} + +} // namespace process_linux +} // namespace lldb_private #endif // #ifndef lldb_NativeRegisterContextLinux_mips64_h diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp index 06ad5f296ec..588d60c805b 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp @@ -19,6 +19,7 @@ #include "Plugins/Process/Linux/NativeProcessLinux.h" using namespace lldb_private; +using namespace lldb_private::process_linux; // ---------------------------------------------------------------------------- // Private namespace. @@ -415,14 +416,14 @@ NativeRegisterContextLinux_x86_64::GetUserRegisterCount() const uint32_t count = 0; for (uint32_t set_index = 0; set_index < k_num_register_sets; ++set_index) { - const lldb_private::RegisterSet* set = GetRegisterSet(set_index); + const RegisterSet* set = GetRegisterSet(set_index); if (set) count += set->num_registers; } return count; } -const lldb_private::RegisterSet * +const RegisterSet * NativeRegisterContextLinux_x86_64::GetRegisterSet (uint32_t set_index) const { if (!IsRegisterSetAvailable (set_index)) @@ -442,7 +443,7 @@ NativeRegisterContextLinux_x86_64::GetRegisterSet (uint32_t set_index) const return nullptr; } -lldb_private::Error +Error NativeRegisterContextLinux_x86_64::ReadRegisterRaw (uint32_t reg_index, RegisterValue ®_value) { Error error; @@ -468,7 +469,7 @@ NativeRegisterContextLinux_x86_64::ReadRegisterRaw (uint32_t reg_index, Register reg_value); } -lldb_private::Error +Error NativeRegisterContextLinux_x86_64::ReadRegister (const RegisterInfo *reg_info, RegisterValue ®_value) { Error error; @@ -579,7 +580,7 @@ NativeRegisterContextLinux_x86_64::ReadRegister (const RegisterInfo *reg_info, R return error; } -lldb_private::Error +Error NativeRegisterContextLinux_x86_64::WriteRegister(const uint32_t reg, const RegisterValue &value) { @@ -651,7 +652,7 @@ NativeRegisterContextLinux_x86_64::WriteRegister(const uint32_t reg, value_to_write); } -lldb_private::Error +Error NativeRegisterContextLinux_x86_64::WriteRegister (const RegisterInfo *reg_info, const RegisterValue ®_value) { assert (reg_info && "reg_info is null"); @@ -722,7 +723,7 @@ NativeRegisterContextLinux_x86_64::WriteRegister (const RegisterInfo *reg_info, return Error ("failed - register wasn't recognized to be a GPR or an FPR, write strategy unknown"); } -lldb_private::Error +Error NativeRegisterContextLinux_x86_64::ReadAllRegisterValues (lldb::DataBufferSP &data_sp) { Error error; @@ -783,7 +784,7 @@ NativeRegisterContextLinux_x86_64::ReadAllRegisterValues (lldb::DataBufferSP &da return error; } -lldb_private::Error +Error NativeRegisterContextLinux_x86_64::WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) { Error error; diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h index e183118e8d4..e8c7c65d432 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.h @@ -15,8 +15,9 @@ #include "Plugins/Process/Utility/RegisterContext_x86.h" #include "Plugins/Process/Utility/lldb-x86-register-enums.h" -namespace lldb_private -{ +namespace lldb_private { +namespace process_linux { + class NativeProcessLinux; class NativeRegisterContextLinux_x86_64 : public NativeRegisterContextRegisterInfo @@ -118,7 +119,7 @@ namespace lldb_private uint64_t m_gpr_x86_64[k_num_gpr_registers_x86_64]; // Private member methods. - lldb_private::Error + Error WriteRegister(const uint32_t reg, const RegisterValue &value); bool IsRegisterSetAvailable (uint32_t set_index) const; @@ -152,7 +153,7 @@ namespace lldb_private bool ReadFPR (); - lldb_private::Error + Error ReadRegisterRaw (uint32_t reg_index, RegisterValue ®_value); bool @@ -161,7 +162,9 @@ namespace lldb_private bool WriteGPR(); }; -} + +} // namespace process_linux +} // namespace lldb_private #endif // #ifndef lldb_NativeRegisterContextLinux_x86_64_h diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp index 38dd025957a..240803ab955 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp @@ -37,6 +37,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_linux; namespace { @@ -157,7 +158,7 @@ NativeThreadLinux::GetStopReason (ThreadStopInfo &stop_info, std::string& descri llvm_unreachable("unhandled StateType!"); } -lldb_private::NativeRegisterContextSP +NativeRegisterContextSP NativeThreadLinux::GetRegisterContext () { // Return the register context if we already created it. diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h index 7f563d87fe7..4170fd9556b 100644 --- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h +++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.h @@ -16,8 +16,9 @@ #include <map> #include <string> -namespace lldb_private -{ +namespace lldb_private { +namespace process_linux { + class NativeProcessLinux; class NativeThreadLinux : public NativeThreadProtocol @@ -113,6 +114,8 @@ namespace lldb_private using WatchpointIndexMap = std::map<lldb::addr_t, uint32_t>; WatchpointIndexMap m_watchpoint_index_map; }; -} + +} // namespace process_linux +} // namespace lldb_private #endif // #ifndef liblldb_NativeThreadLinux_H_ diff --git a/lldb/source/Plugins/Process/Linux/ProcFileReader.cpp b/lldb/source/Plugins/Process/Linux/ProcFileReader.cpp index 6b259fd8b92..4d1f231f4f9 100644 --- a/lldb/source/Plugins/Process/Linux/ProcFileReader.cpp +++ b/lldb/source/Plugins/Process/Linux/ProcFileReader.cpp @@ -23,8 +23,11 @@ #include "lldb/Core/DataBufferHeap.h" #include "lldb/Core/Error.h" +using namespace lldb_private; +using namespace lldb_private::process_linux; + lldb::DataBufferSP -lldb_private::ProcFileReader::ReadIntoDataBuffer (lldb::pid_t pid, const char *name) +ProcFileReader::ReadIntoDataBuffer (lldb::pid_t pid, const char *name) { int fd; char path[PATH_MAX]; @@ -73,10 +76,10 @@ lldb_private::ProcFileReader::ReadIntoDataBuffer (lldb::pid_t pid, const char *n return buf_sp; } -lldb_private::Error -lldb_private::ProcFileReader::ProcessLineByLine (lldb::pid_t pid, const char *name, std::function<bool (const std::string &line)> line_parser) +Error +ProcFileReader::ProcessLineByLine (lldb::pid_t pid, const char *name, std::function<bool (const std::string &line)> line_parser) { - lldb_private::Error error; + Error error; // Try to open the /proc/{pid}/maps entry. char filename [PATH_MAX]; diff --git a/lldb/source/Plugins/Process/Linux/ProcFileReader.h b/lldb/source/Plugins/Process/Linux/ProcFileReader.h index dfd77d349e8..7b381243306 100644 --- a/lldb/source/Plugins/Process/Linux/ProcFileReader.h +++ b/lldb/source/Plugins/Process/Linux/ProcFileReader.h @@ -15,8 +15,9 @@ #include "lldb/lldb-forward.h" #include "lldb/lldb-types.h" -namespace lldb_private -{ +namespace lldb_private { +namespace process_linux { + class ProcFileReader { public: @@ -26,9 +27,11 @@ namespace lldb_private /// Parse the /proc/{@a pid}/{@a name} file line by line, passing each line to line_parser, until /// either end of file or until line_parser returns false. - static lldb_private::Error + static Error ProcessLineByLine (lldb::pid_t pid, const char *name, std::function<bool (const std::string &line)> line_parser); }; -} + +} // namespace process_linux +} // namespace lldb_private #endif // #ifndef liblldb_ProcFileReader_h_ diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp index d63528427ca..bc9e68ac7a7 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp @@ -29,6 +29,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_linux; namespace { @@ -224,7 +225,7 @@ ProcessLinux::CanDebug(Target &target, bool plugin_specified_by_name) // If we're using llgs for local debugging, we must not say that this process // is used for debugging. - if (PlatformLinux::UseLlgsForLocalDebugging ()) + if (platform_linux::PlatformLinux::UseLlgsForLocalDebugging ()) return false; return ProcessPOSIX::CanDebug(target, plugin_specified_by_name); diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.h b/lldb/source/Plugins/Process/Linux/ProcessLinux.h index 1d332af24fe..1d8232d3bee 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessLinux.h +++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.h @@ -22,17 +22,19 @@ class ProcessMonitor; -class ProcessLinux : - public ProcessPOSIX +namespace lldb_private { +namespace process_linux { + +class ProcessLinux : public ProcessPOSIX { public: //------------------------------------------------------------------ // Static functions. //------------------------------------------------------------------ static lldb::ProcessSP - CreateInstance(lldb_private::Target& target, - lldb_private::Listener &listener, - const lldb_private::FileSpec *); + CreateInstance(Target& target, + Listener &listener, + const FileSpec *); static void Initialize(); @@ -40,7 +42,7 @@ public: static void Terminate(); - static lldb_private::ConstString + static ConstString GetPluginNameStatic(); static const char * @@ -49,41 +51,41 @@ public: //------------------------------------------------------------------ // Constructors and destructors //------------------------------------------------------------------ - ProcessLinux(lldb_private::Target& target, - lldb_private::Listener &listener, - lldb_private::FileSpec *core_file); + ProcessLinux(Target& target, + Listener &listener, + FileSpec *core_file); - lldb_private::Error + Error DoDetach(bool keep_stopped) override; bool DetachRequiresHalt() override { return true; } bool - UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list) override; + UpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list) override; //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ - lldb_private::ConstString + ConstString GetPluginName() override; uint32_t GetPluginVersion() override; virtual void - GetPluginCommandHelp(const char *command, lldb_private::Stream *strm); + GetPluginCommandHelp(const char *command, Stream *strm); - virtual lldb_private::Error - ExecutePluginCommand(lldb_private::Args &command, - lldb_private::Stream *strm); + virtual Error + ExecutePluginCommand(Args &command, + Stream *strm); - virtual lldb_private::Log * - EnablePluginLogging(lldb_private::Stream *strm, - lldb_private::Args &command); + virtual Log * + EnablePluginLogging(Stream *strm, + Args &command); bool - CanDebug(lldb_private::Target &target, bool plugin_specified_by_name) override; + CanDebug(Target &target, bool plugin_specified_by_name) override; //------------------------------------------------------------------ // ProcessPOSIX overrides @@ -92,14 +94,17 @@ public: StopAllThreads(lldb::tid_t stop_tid) override; POSIXThread * - CreateNewPOSIXThread(lldb_private::Process &process, lldb::tid_t tid) override; + CreateNewPOSIXThread(Process &process, lldb::tid_t tid) override; private: - lldb_private::FileSpec *m_core_file; + FileSpec *m_core_file; // Flag to avoid recursion when stopping all threads. bool m_stopping_threads; }; +} // namespace process_linux +} // namespace lldb_private + #endif // liblldb_ProcessLinux_H_ diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp index dff4e8d9ce9..4b29a09ccfc 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp +++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp @@ -92,6 +92,7 @@ syscall(SYS_tgkill, static_cast<::pid_t>(pid), static_cast<::pid_t>(tid), sig) using namespace lldb_private; +using namespace lldb_private::process_linux; static Operation* EXIT_OPERATION = nullptr; diff --git a/lldb/source/Plugins/Process/Linux/ProcessMonitor.h b/lldb/source/Plugins/Process/Linux/ProcessMonitor.h index 0543e930d40..9b4baf7ce54 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessMonitor.h +++ b/lldb/source/Plugins/Process/Linux/ProcessMonitor.h @@ -20,14 +20,20 @@ #include "lldb/Host/HostThread.h" #include "lldb/Host/Mutex.h" -namespace lldb_private -{ +namespace lldb_private { + class Error; class Module; class Scalar; -} // End lldb_private namespace. + +namespace process_linux { class ProcessLinux; + +} // namespace process_linux + +} // namespace lldb_private + class Operation; /// @class ProcessMonitor @@ -75,7 +81,7 @@ public: GetPID() const { return m_pid; } /// Returns the process associated with this ProcessMonitor. - ProcessLinux & + lldb_private::process_linux::ProcessLinux & GetProcess() { return *m_process; } /// Returns a file descriptor to the controlling terminal of the inferior @@ -195,7 +201,7 @@ public: WaitForInitialTIDStop(lldb::tid_t tid); private: - ProcessLinux *m_process; + lldb_private::process_linux::ProcessLinux *m_process; lldb_private::HostThread m_operation_thread; lldb_private::HostThread m_monitor_thread; diff --git a/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp b/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp index 16ba858a179..da1c33f64fd 100644 --- a/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp +++ b/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.cpp @@ -20,6 +20,7 @@ #include <sstream> using namespace lldb_private; +using namespace lldb_private::process_linux; //===----------------------------------------------------------------------===// diff --git a/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.h b/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.h index 67c5f8a9e94..17184f6f80a 100644 --- a/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.h +++ b/lldb/source/Plugins/Process/Linux/ThreadStateCoordinator.h @@ -21,8 +21,9 @@ #include "lldb/Core/Error.h" -namespace lldb_private -{ +namespace lldb_private { +namespace process_linux { + class ThreadStateCoordinator { public: @@ -229,6 +230,8 @@ namespace lldb_private bool m_log_event_processing; }; -} + +} // namespace process_linux +} // namespace lldb_private #endif diff --git a/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp b/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp index 11a3eef2352..3be122b7120 100644 --- a/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp +++ b/lldb/source/Plugins/Process/Utility/LinuxSignals.cpp @@ -12,7 +12,7 @@ // Project includes #include "LinuxSignals.h" -using namespace process_linux; +using namespace lldb_private::process_linux; LinuxSignals::LinuxSignals() : UnixSignals() diff --git a/lldb/source/Plugins/Process/Utility/LinuxSignals.h b/lldb/source/Plugins/Process/Utility/LinuxSignals.h index 9645b3d8725..5102bcb95e7 100644 --- a/lldb/source/Plugins/Process/Utility/LinuxSignals.h +++ b/lldb/source/Plugins/Process/Utility/LinuxSignals.h @@ -16,8 +16,8 @@ // Project includes #include "lldb/Target/UnixSignals.h" -namespace process_linux -{ +namespace lldb_private { +namespace process_linux { /// Linux specific set of Unix signals. class LinuxSignals @@ -30,6 +30,8 @@ namespace process_linux void Reset(); }; -} + +} // namespace lldb_private +} // namespace process_linux #endif diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp index 9b328e5436a..ccb6da4f670 100644 --- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips64.cpp @@ -17,8 +17,9 @@ #include "Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h" #include "RegisterContext_mips64.h" -using namespace lldb_private; using namespace lldb; +using namespace lldb_private; +using namespace lldb_private::process_linux; // GP registers typedef struct _GPR diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 62bc3627f69..0470665fe6b 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -43,6 +43,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_gdb_remote; GDBRemoteCommunication::History::History (uint32_t size) : m_packets(), @@ -93,7 +94,7 @@ GDBRemoteCommunication::History::AddPacket (const std::string &src, } void -GDBRemoteCommunication::History::Dump (lldb_private::Stream &strm) const +GDBRemoteCommunication::History::Dump (Stream &strm) const { const uint32_t size = GetNumPacketsInHistory (); const uint32_t first_idx = GetFirstSavedPacketIndex (); @@ -114,7 +115,7 @@ GDBRemoteCommunication::History::Dump (lldb_private::Stream &strm) const } void -GDBRemoteCommunication::History::Dump (lldb_private::Log *log) const +GDBRemoteCommunication::History::Dump (Log *log) const { if (log && !m_dumped_to_log) { @@ -679,7 +680,7 @@ GDBRemoteCommunication::ListenThread (lldb::thread_arg_t arg) Error GDBRemoteCommunication::StartDebugserverProcess (const char *hostname, uint16_t in_port, - lldb_private::ProcessLaunchInfo &launch_info, + ProcessLaunchInfo &launch_info, uint16_t &out_port) { Log *log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS)); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h index b704df3b72f..77f60ea76aa 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h @@ -27,6 +27,9 @@ #include "Utility/StringExtractorGDBRemote.h" +namespace lldb_private { +namespace process_gdb_remote { + typedef enum { eStoppointInvalid = -1, @@ -39,7 +42,7 @@ typedef enum class ProcessGDBRemote; -class GDBRemoteCommunication : public lldb_private::Communication +class GDBRemoteCommunication : public Communication { public: enum @@ -96,7 +99,7 @@ public: size_t payload_length); bool - GetSequenceMutex (lldb_private::Mutex::Locker& locker, const char *failure_message = NULL); + GetSequenceMutex (Mutex::Locker& locker, const char *failure_message = NULL); bool CheckForPacket (const uint8_t *src, @@ -139,20 +142,20 @@ public: uint32_t GetPacketTimeoutInMicroSeconds () const { - return m_packet_timeout * lldb_private::TimeValue::MicroSecPerSec; + return m_packet_timeout * TimeValue::MicroSecPerSec; } //------------------------------------------------------------------ // Start a debugserver instance on the current host using the // supplied connection URL. //------------------------------------------------------------------ - lldb_private::Error + Error StartDebugserverProcess (const char *hostname, uint16_t in_port, // If set to zero, then out_port will contain the bound port on exit - lldb_private::ProcessLaunchInfo &launch_info, + ProcessLaunchInfo &launch_info, uint16_t &out_port); void - DumpHistory(lldb_private::Stream &strm); + DumpHistory(Stream &strm); protected: @@ -209,10 +212,10 @@ protected: uint32_t bytes_transmitted); void - Dump (lldb_private::Stream &strm) const; + Dump (Stream &strm) const; void - Dump (lldb_private::Log *log) const; + Dump (Log *log) const; bool DidDumpToLog () const @@ -274,19 +277,19 @@ protected: uint32_t timeout_usec); bool - WaitForNotRunningPrivate (const lldb_private::TimeValue *timeout_ptr); + WaitForNotRunningPrivate (const TimeValue *timeout_ptr); //------------------------------------------------------------------ // Classes that inherit from GDBRemoteCommunication can see and modify these //------------------------------------------------------------------ uint32_t m_packet_timeout; #ifdef ENABLE_MUTEX_ERROR_CHECKING - lldb_private::TrackingMutex m_sequence_mutex; + TrackingMutex m_sequence_mutex; #else - lldb_private::Mutex m_sequence_mutex; // Restrict access to sending/receiving packets to a single thread at a time + Mutex m_sequence_mutex; // Restrict access to sending/receiving packets to a single thread at a time #endif - lldb_private::Predicate<bool> m_public_is_running; - lldb_private::Predicate<bool> m_private_is_running; + Predicate<bool> m_public_is_running; + Predicate<bool> m_private_is_running; History m_history; bool m_send_acks; bool m_is_platform; // Set to true if this class represents a platform, @@ -294,9 +297,8 @@ protected: // a single process - lldb_private::Error - StartListenThread (const char *hostname = "127.0.0.1", - uint16_t port = 0); + Error + StartListenThread (const char *hostname = "127.0.0.1", uint16_t port = 0); bool JoinListenThread (); @@ -305,7 +307,7 @@ protected: ListenThread (lldb::thread_arg_t arg); private: - lldb_private::HostThread m_listen_thread; + HostThread m_listen_thread; std::string m_listen_url; //------------------------------------------------------------------ @@ -314,4 +316,7 @@ private: DISALLOW_COPY_AND_ASSIGN (GDBRemoteCommunication); }; +} // namespace process_gdb_remote +} // namespace lldb_private + #endif // liblldb_GDBRemoteCommunication_h_ diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index aad69a06b9c..756406c4e8c 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -42,6 +42,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_gdb_remote; #if defined(LLDB_DISABLE_POSIX) && !defined(SIGSTOP) #define SIGSTOP 17 diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h index acd8a17db8b..4019ab74530 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h @@ -21,6 +21,9 @@ #include "GDBRemoteCommunication.h" +namespace lldb_private { +namespace process_gdb_remote { + class GDBRemoteCommunicationClient : public GDBRemoteCommunication { public: @@ -36,7 +39,7 @@ public: // we are communicating with it. //------------------------------------------------------------------ bool - HandshakeWithServer (lldb_private::Error *error_ptr); + HandshakeWithServer (Error *error_ptr); PacketResult SendPacketAndWaitForResponse (const char *send_payload, @@ -95,7 +98,7 @@ public: SendAsyncSignal (int signo); bool - SendInterrupt (lldb_private::Mutex::Locker &locker, + SendInterrupt (Mutex::Locker &locker, uint32_t seconds_to_wait_for_stop, bool &timed_out); @@ -126,7 +129,7 @@ public: /// response was received. //------------------------------------------------------------------ int - SendArgumentsPacket (const lldb_private::ProcessLaunchInfo &launch_info); + SendArgumentsPacket (const ProcessLaunchInfo &launch_info); //------------------------------------------------------------------ /// Sends a "QEnvironment:NAME=VALUE" packet that will build up the @@ -268,29 +271,28 @@ public: bool DeallocateMemory (lldb::addr_t addr); - lldb_private::Error + Error Detach (bool keep_stopped); - lldb_private::Error - GetMemoryRegionInfo (lldb::addr_t addr, - lldb_private::MemoryRegionInfo &range_info); + Error + GetMemoryRegionInfo (lldb::addr_t addr, MemoryRegionInfo &range_info); - lldb_private::Error + Error GetWatchpointSupportInfo (uint32_t &num); - lldb_private::Error + Error GetWatchpointSupportInfo (uint32_t &num, bool& after); - lldb_private::Error + Error GetWatchpointsTriggerAfterInstruction (bool &after); - const lldb_private::ArchSpec & + const ArchSpec & GetHostArchitecture (); uint32_t GetHostDefaultPacketTimeout(); - const lldb_private::ArchSpec & + const ArchSpec & GetProcessArchitecture (); void @@ -328,7 +330,7 @@ public: bool GetOSKernelDescription (std::string &s); - lldb_private::ArchSpec + ArchSpec GetSystemArchitecture (); bool @@ -341,12 +343,11 @@ public: GetSupportsThreadSuffix (); bool - GetProcessInfo (lldb::pid_t pid, - lldb_private::ProcessInstanceInfo &process_info); + GetProcessInfo (lldb::pid_t pid, ProcessInstanceInfo &process_info); uint32_t - FindProcesses (const lldb_private::ProcessInstanceInfoMatch &process_match_info, - lldb_private::ProcessInstanceInfoList &process_infos); + FindProcesses (const ProcessInstanceInfoMatch &process_match_info, + ProcessInstanceInfoList &process_infos); bool GetUserName (uint32_t uid, std::string &name); @@ -425,7 +426,7 @@ public: bool GetAugmentedLibrariesSVR4ReadSupported (); - lldb_private::LazyBool + LazyBool SupportsAllocDeallocMemory () // const { // Uncomment this to have lldb pretend the debug server doesn't respond to alloc/dealloc memory packets. @@ -444,22 +445,18 @@ public: } lldb::user_id_t - OpenFile (const lldb_private::FileSpec& file_spec, - uint32_t flags, - mode_t mode, - lldb_private::Error &error); + OpenFile (const FileSpec& file_spec, uint32_t flags, mode_t mode, Error &error); bool - CloseFile (lldb::user_id_t fd, - lldb_private::Error &error); + CloseFile (lldb::user_id_t fd, Error &error); lldb::user_id_t - GetFileSize (const lldb_private::FileSpec& file_spec); + GetFileSize (const FileSpec& file_spec); - lldb_private::Error + Error GetFilePermissions(const char *path, uint32_t &file_permissions); - lldb_private::Error + Error SetFilePermissions(const char *path, uint32_t file_permissions); uint64_t @@ -467,30 +464,29 @@ public: uint64_t offset, void *dst, uint64_t dst_len, - lldb_private::Error &error); + Error &error); uint64_t WriteFile (lldb::user_id_t fd, uint64_t offset, const void* src, uint64_t src_len, - lldb_private::Error &error); + Error &error); - lldb_private::Error + Error CreateSymlink (const char *src, const char *dst); - lldb_private::Error + Error Unlink (const char *path); - lldb_private::Error - MakeDirectory (const char *path, - uint32_t mode); + Error + MakeDirectory (const char *path, uint32_t mode); bool - GetFileExists (const lldb_private::FileSpec& file_spec); + GetFileExists (const FileSpec& file_spec); - 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 @@ -499,9 +495,7 @@ public: uint32_t timeout_sec); // Timeout in seconds to wait for shell program to finish bool - CalculateMD5 (const lldb_private::FileSpec& file_spec, - uint64_t &high, - uint64_t &low); + CalculateMD5 (const FileSpec& file_spec, uint64_t &high, uint64_t &low); std::string HarmonizeThreadIdsForProfileData (ProcessGDBRemote *process, @@ -535,9 +529,9 @@ public: GetThreadExtendedInfoSupported(); bool - GetModuleInfo (const lldb_private::FileSpec& module_file_spec, - const lldb_private::ArchSpec& arch_spec, - lldb_private::ModuleSpec &module_spec); + GetModuleInfo (const FileSpec& module_file_spec, + const ArchSpec& arch_spec, + ModuleSpec &module_spec); protected: @@ -555,35 +549,35 @@ protected: //------------------------------------------------------------------ // Classes that inherit from GDBRemoteCommunicationClient can see and modify these //------------------------------------------------------------------ - lldb_private::LazyBool m_supports_not_sending_acks; - lldb_private::LazyBool m_supports_thread_suffix; - lldb_private::LazyBool m_supports_threads_in_stop_reply; - lldb_private::LazyBool m_supports_vCont_all; - lldb_private::LazyBool m_supports_vCont_any; - lldb_private::LazyBool m_supports_vCont_c; - lldb_private::LazyBool m_supports_vCont_C; - lldb_private::LazyBool m_supports_vCont_s; - lldb_private::LazyBool m_supports_vCont_S; - lldb_private::LazyBool m_qHostInfo_is_valid; - lldb_private::LazyBool m_curr_pid_is_valid; - lldb_private::LazyBool m_qProcessInfo_is_valid; - lldb_private::LazyBool m_qGDBServerVersion_is_valid; - lldb_private::LazyBool m_supports_alloc_dealloc_memory; - lldb_private::LazyBool m_supports_memory_region_info; - lldb_private::LazyBool m_supports_watchpoint_support_info; - lldb_private::LazyBool m_supports_detach_stay_stopped; - lldb_private::LazyBool m_watchpoints_trigger_after_instruction; - lldb_private::LazyBool m_attach_or_wait_reply; - lldb_private::LazyBool m_prepare_for_reg_writing_reply; - lldb_private::LazyBool m_supports_p; - lldb_private::LazyBool m_supports_x; - lldb_private::LazyBool m_avoid_g_packets; - lldb_private::LazyBool m_supports_QSaveRegisterState; - lldb_private::LazyBool m_supports_qXfer_auxv_read; - lldb_private::LazyBool m_supports_qXfer_libraries_read; - lldb_private::LazyBool m_supports_qXfer_libraries_svr4_read; - lldb_private::LazyBool m_supports_augmented_libraries_svr4_read; - lldb_private::LazyBool m_supports_jThreadExtendedInfo; + LazyBool m_supports_not_sending_acks; + LazyBool m_supports_thread_suffix; + LazyBool m_supports_threads_in_stop_reply; + LazyBool m_supports_vCont_all; + LazyBool m_supports_vCont_any; + LazyBool m_supports_vCont_c; + LazyBool m_supports_vCont_C; + LazyBool m_supports_vCont_s; + LazyBool m_supports_vCont_S; + LazyBool m_qHostInfo_is_valid; + LazyBool m_curr_pid_is_valid; + LazyBool m_qProcessInfo_is_valid; + LazyBool m_qGDBServerVersion_is_valid; + LazyBool m_supports_alloc_dealloc_memory; + LazyBool m_supports_memory_region_info; + LazyBool m_supports_watchpoint_support_info; + LazyBool m_supports_detach_stay_stopped; + LazyBool m_watchpoints_trigger_after_instruction; + LazyBool m_attach_or_wait_reply; + LazyBool m_prepare_for_reg_writing_reply; + LazyBool m_supports_p; + LazyBool m_supports_x; + LazyBool m_avoid_g_packets; + LazyBool m_supports_QSaveRegisterState; + LazyBool m_supports_qXfer_auxv_read; + LazyBool m_supports_qXfer_libraries_read; + LazyBool m_supports_qXfer_libraries_svr4_read; + LazyBool m_supports_augmented_libraries_svr4_read; + LazyBool m_supports_jThreadExtendedInfo; bool m_supports_qProcessInfoPID:1, @@ -608,8 +602,8 @@ protected: // If we need to send a packet while the target is running, the m_async_XXX // member variables take care of making this happen. - lldb_private::Mutex m_async_mutex; - lldb_private::Predicate<bool> m_async_packet_predicate; + Mutex m_async_mutex; + Predicate<bool> m_async_packet_predicate; std::string m_async_packet; PacketResult m_async_result; StringExtractorGDBRemote m_async_response; @@ -618,8 +612,8 @@ protected: std::string m_partial_profile_data; std::map<uint64_t, uint32_t> m_thread_id_to_used_usec_map; - lldb_private::ArchSpec m_host_arch; - lldb_private::ArchSpec m_process_arch; + ArchSpec m_host_arch; + ArchSpec m_process_arch; uint32_t m_os_version_major; uint32_t m_os_version_minor; uint32_t m_os_version_update; @@ -633,7 +627,7 @@ protected: bool DecodeProcessInfoResponse (StringExtractorGDBRemote &response, - lldb_private::ProcessInstanceInfo &process_info); + ProcessInstanceInfo &process_info); private: //------------------------------------------------------------------ // For GDBRemoteCommunicationClient only @@ -641,4 +635,7 @@ private: DISALLOW_COPY_AND_ASSIGN (GDBRemoteCommunicationClient); }; +} // namespace process_gdb_remote +} // namespace lldb_private + #endif // liblldb_GDBRemoteCommunicationClient_h_ diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp index c24656159e1..409efdfa2f7 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp @@ -23,6 +23,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_gdb_remote; GDBRemoteCommunicationServer::GDBRemoteCommunicationServer(const char *comm_name, const char *listener_name) : diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h index 148545f4103..992c6dffaf5 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h @@ -20,16 +20,19 @@ #include "lldb/lldb-private-forward.h" #include "GDBRemoteCommunication.h" -class ProcessGDBRemote; class StringExtractorGDBRemote; -class GDBRemoteCommunicationServer : - public GDBRemoteCommunication +namespace lldb_private { +namespace process_gdb_remote { + +class ProcessGDBRemote; + +class GDBRemoteCommunicationServer : public GDBRemoteCommunication { public: using PortMap = std::map<uint16_t, lldb::pid_t>; using PacketHandler = std::function<PacketResult(StringExtractorGDBRemote &packet, - lldb_private::Error &error, + Error &error, bool &interrupt, bool &quit)>; @@ -44,14 +47,14 @@ public: PacketResult GetPacketAndSendResponse (uint32_t timeout_usec, - lldb_private::Error &error, + Error &error, bool &interrupt, bool &quit); // After connecting, do a little handshake with the client to make sure // we are at least communicating bool - HandshakeWithClient (lldb_private::Error *error_ptr); + HandshakeWithClient (Error *error_ptr); protected: std::map<StringExtractorGDBRemote::ServerPacketType, PacketHandler> m_packet_handlers; @@ -76,4 +79,7 @@ private: DISALLOW_COPY_AND_ASSIGN (GDBRemoteCommunicationServer); }; +} // namespace process_gdb_remote +} // namespace lldb_private + #endif // liblldb_GDBRemoteCommunicationServer_h_ diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp index 3e9ad7c3fdb..74e27beceff 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -45,6 +45,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_gdb_remote; #ifdef __ANDROID__ const static uint32_t g_default_packet_timeout_sec = 20; // seconds diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h index 8fc270fa462..c11a927ead4 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h @@ -23,9 +23,13 @@ #include "GDBRemoteCommunicationServer.h" #include "GDBRemoteCommunicationServerCommon.h" -class ProcessGDBRemote; class StringExtractorGDBRemote; +namespace lldb_private { +namespace process_gdb_remote { + +class ProcessGDBRemote; + class GDBRemoteCommunicationServerCommon : public GDBRemoteCommunicationServer { @@ -37,10 +41,10 @@ public: protected: std::set<lldb::pid_t> m_spawned_pids; - lldb_private::Mutex m_spawned_pids_mutex; - lldb_private::ProcessLaunchInfo m_process_launch_info; - lldb_private::Error m_process_launch_error; - lldb_private::ProcessInstanceInfoList m_proc_infos; + Mutex m_spawned_pids_mutex; + ProcessLaunchInfo m_process_launch_info; + Error m_process_launch_error; + ProcessInstanceInfoList m_proc_infos; uint32_t m_proc_infos_index; bool m_thread_suffix_supported; bool m_list_threads_in_stop_reply; @@ -154,12 +158,12 @@ protected: KillSpawnedProcess (lldb::pid_t pid); static void - CreateProcessInfoResponse (const lldb_private::ProcessInstanceInfo &proc_info, - lldb_private::StreamString &response); + CreateProcessInfoResponse (const ProcessInstanceInfo &proc_info, + StreamString &response); static void - CreateProcessInfoResponse_DebugServerStyle (const lldb_private::ProcessInstanceInfo &proc_info, - lldb_private::StreamString &response); + CreateProcessInfoResponse_DebugServerStyle (const ProcessInstanceInfo &proc_info, + StreamString &response); template <typename T> void @@ -168,7 +172,7 @@ protected: { RegisterPacketHandler(packet_type, [this, handler] (StringExtractorGDBRemote packet, - lldb_private::Error &error, + Error &error, bool &interrupt, bool &quit) { @@ -193,11 +197,14 @@ protected: /// An Error object indicating the success or failure of the /// launch. //------------------------------------------------------------------ - virtual lldb_private::Error + virtual Error LaunchProcess () = 0; - virtual lldb_private::FileSpec - FindModuleFile (const std::string& module_path, const lldb_private::ArchSpec& arch); + virtual FileSpec + FindModuleFile (const std::string& module_path, const ArchSpec& arch); }; +} // namespace process_gdb_remote +} // namespace lldb_private + #endif // liblldb_GDBRemoteCommunicationServerCommon_h_ diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index 3892f483904..3dfb6684e26 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -53,6 +53,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_gdb_remote; //---------------------------------------------------------------------- // GDBRemote Errors @@ -189,32 +190,32 @@ GDBRemoteCommunicationServerLLGS::RegisterPacketHandlers() }); } -lldb_private::Error +Error GDBRemoteCommunicationServerLLGS::SetLaunchArguments (const char *const args[], int argc) { if ((argc < 1) || !args || !args[0] || !args[0][0]) - return lldb_private::Error ("%s: no process command line specified to launch", __FUNCTION__); + return Error ("%s: no process command line specified to launch", __FUNCTION__); m_process_launch_info.SetArguments (const_cast<const char**> (args), true); - return lldb_private::Error (); + return Error (); } -lldb_private::Error +Error GDBRemoteCommunicationServerLLGS::SetLaunchFlags (unsigned int launch_flags) { m_process_launch_info.GetFlags ().Set (launch_flags); - return lldb_private::Error (); + return Error (); } -lldb_private::Error +Error GDBRemoteCommunicationServerLLGS::LaunchProcess () { Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS)); if (!m_process_launch_info.GetArguments ().GetArgumentCount ()) - return lldb_private::Error ("%s: no process command line specified to launch", __FUNCTION__); + return Error ("%s: no process command line specified to launch", __FUNCTION__); - lldb_private::Error error; + Error error; { Mutex::Locker locker (m_debugged_process_mutex); assert (!m_debugged_process_sp && "lldb-gdbserver creating debugged process but one already exists"); @@ -286,7 +287,7 @@ GDBRemoteCommunicationServerLLGS::LaunchProcess () return error; } -lldb_private::Error +Error GDBRemoteCommunicationServerLLGS::AttachToProcess (lldb::pid_t pid) { Error error; @@ -340,7 +341,7 @@ GDBRemoteCommunicationServerLLGS::AttachToProcess (lldb::pid_t pid) } void -GDBRemoteCommunicationServerLLGS::InitializeDelegate (lldb_private::NativeProcessProtocol *process) +GDBRemoteCommunicationServerLLGS::InitializeDelegate (NativeProcessProtocol *process) { assert (process && "process cannot be NULL"); Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS)); @@ -354,7 +355,7 @@ GDBRemoteCommunicationServerLLGS::InitializeDelegate (lldb_private::NativeProces } GDBRemoteCommunication::PacketResult -GDBRemoteCommunicationServerLLGS::SendWResponse (lldb_private::NativeProcessProtocol *process) +GDBRemoteCommunicationServerLLGS::SendWResponse (NativeProcessProtocol *process) { assert (process && "process cannot be NULL"); Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS)); @@ -653,7 +654,7 @@ GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread (lldb::tid_t tid) } void -GDBRemoteCommunicationServerLLGS::HandleInferiorState_Exited (lldb_private::NativeProcessProtocol *process) +GDBRemoteCommunicationServerLLGS::HandleInferiorState_Exited (NativeProcessProtocol *process) { assert (process && "process cannot be NULL"); @@ -705,7 +706,7 @@ GDBRemoteCommunicationServerLLGS::HandleInferiorState_Exited (lldb_private::Nati } void -GDBRemoteCommunicationServerLLGS::HandleInferiorState_Stopped (lldb_private::NativeProcessProtocol *process) +GDBRemoteCommunicationServerLLGS::HandleInferiorState_Stopped (NativeProcessProtocol *process) { assert (process && "process cannot be NULL"); @@ -734,7 +735,7 @@ GDBRemoteCommunicationServerLLGS::HandleInferiorState_Stopped (lldb_private::Nat } void -GDBRemoteCommunicationServerLLGS::ProcessStateChanged (lldb_private::NativeProcessProtocol *process, lldb::StateType state) +GDBRemoteCommunicationServerLLGS::ProcessStateChanged (NativeProcessProtocol *process, lldb::StateType state) { assert (process && "process cannot be NULL"); Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS)); @@ -793,7 +794,7 @@ GDBRemoteCommunicationServerLLGS::SendONotification (const char *buffer, uint32_ return SendPacketNoLock (response.GetData (), response.GetSize ()); } -lldb_private::Error +Error GDBRemoteCommunicationServerLLGS::SetSTDIOFileDescriptor (int fd) { Error error; @@ -1002,7 +1003,7 @@ GDBRemoteCommunicationServerLLGS::Handle_C (StringExtractorGDBRemote &packet) return SendIllFormedResponse (packet, "unexpected content after $C{signal-number}"); } - lldb_private::ResumeActionList resume_actions (StateType::eStateRunning, 0); + ResumeActionList resume_actions (StateType::eStateRunning, 0); Error error; // We have two branches: what to do if a continue thread is specified (in which case we target @@ -1015,7 +1016,7 @@ GDBRemoteCommunicationServerLLGS::Handle_C (StringExtractorGDBRemote &packet) if (signal_tid != LLDB_INVALID_THREAD_ID) { // The resume action for the continue thread (or all threads if a continue thread is not set). - lldb_private::ResumeAction action = { GetContinueThreadID (), StateType::eStateRunning, static_cast<int> (signo) }; + ResumeAction action = { GetContinueThreadID (), StateType::eStateRunning, static_cast<int> (signo) }; // Add the action for the continue thread (or all threads when the continue thread isn't present). resume_actions.Append (action); @@ -1080,7 +1081,7 @@ GDBRemoteCommunicationServerLLGS::Handle_c (StringExtractorGDBRemote &packet) } // Build the ResumeActionList - lldb_private::ResumeActionList actions (StateType::eStateRunning, 0); + ResumeActionList actions (StateType::eStateRunning, 0); Error error = m_debugged_process_sp->Resume (actions); if (error.Fail ()) @@ -1841,7 +1842,7 @@ GDBRemoteCommunicationServerLLGS::Handle_m (StringExtractorGDBRemote &packet) // Retrieve the process memory. lldb::addr_t bytes_read = 0; - lldb_private::Error error = m_debugged_process_sp->ReadMemory (read_addr, &buf[0], byte_count, bytes_read); + Error error = m_debugged_process_sp->ReadMemory (read_addr, &buf[0], byte_count, bytes_read); if (error.Fail ()) { if (log) @@ -1921,7 +1922,7 @@ GDBRemoteCommunicationServerLLGS::Handle_M (StringExtractorGDBRemote &packet) // Write the process memory. lldb::addr_t bytes_written = 0; - lldb_private::Error error = m_debugged_process_sp->WriteMemory (write_addr, &buf[0], byte_count, bytes_written); + Error error = m_debugged_process_sp->WriteMemory (write_addr, &buf[0], byte_count, bytes_written); if (error.Fail ()) { if (log) @@ -2234,10 +2235,10 @@ GDBRemoteCommunicationServerLLGS::Handle_s (StringExtractorGDBRemote &packet) return SendErrorResponse (0x33); // Create the step action for the given thread. - lldb_private::ResumeAction action = { tid, eStateStepping, 0 }; + ResumeAction action = { tid, eStateStepping, 0 }; // Setup the actions list. - lldb_private::ResumeActionList actions; + ResumeActionList actions; actions.Append (action); // All other threads stop while we're single stepping a thread. @@ -2642,7 +2643,7 @@ GDBRemoteCommunicationServerLLGS::MaybeCloseInferiorTerminalConnection () } -lldb_private::NativeThreadProtocolSP +NativeThreadProtocolSP GDBRemoteCommunicationServerLLGS::GetThreadFromSuffix (StringExtractorGDBRemote &packet) { NativeThreadProtocolSP thread_sp; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h index d7fc115fbe3..a47e9a19f0b 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h @@ -23,12 +23,16 @@ // Project includes #include "GDBRemoteCommunicationServerCommon.h" -class ProcessGDBRemote; class StringExtractorGDBRemote; +namespace lldb_private { +namespace process_gdb_remote { + +class ProcessGDBRemote; + class GDBRemoteCommunicationServerLLGS : public GDBRemoteCommunicationServerCommon, - public lldb_private::NativeProcessProtocol::NativeDelegate + public NativeProcessProtocol::NativeDelegate { public: //------------------------------------------------------------------ @@ -53,7 +57,7 @@ public: /// An Error object indicating the success or failure of making /// the setting. //------------------------------------------------------------------ - lldb_private::Error + Error SetLaunchArguments (const char *const args[], int argc); //------------------------------------------------------------------ @@ -66,7 +70,7 @@ public: /// An Error object indicating the success or failure of making /// the setting. //------------------------------------------------------------------ - lldb_private::Error + Error SetLaunchFlags (unsigned int launch_flags); //------------------------------------------------------------------ @@ -80,7 +84,7 @@ public: /// An Error object indicating the success or failure of the /// launch. //------------------------------------------------------------------ - lldb_private::Error + Error LaunchProcess () override; //------------------------------------------------------------------ @@ -93,33 +97,33 @@ public: /// An Error object indicating the success or failure of the /// attach operation. //------------------------------------------------------------------ - lldb_private::Error + Error AttachToProcess (lldb::pid_t pid); //------------------------------------------------------------------ // NativeProcessProtocol::NativeDelegate overrides //------------------------------------------------------------------ void - InitializeDelegate (lldb_private::NativeProcessProtocol *process) override; + InitializeDelegate (NativeProcessProtocol *process) override; void - ProcessStateChanged (lldb_private::NativeProcessProtocol *process, lldb::StateType state) override; + ProcessStateChanged (NativeProcessProtocol *process, lldb::StateType state) override; void - DidExec (lldb_private::NativeProcessProtocol *process) override; + DidExec (NativeProcessProtocol *process) override; protected: lldb::PlatformSP m_platform_sp; lldb::thread_t m_async_thread; lldb::tid_t m_current_tid; lldb::tid_t m_continue_tid; - lldb_private::Mutex m_debugged_process_mutex; - lldb_private::NativeProcessProtocolSP m_debugged_process_sp; + Mutex m_debugged_process_mutex; + NativeProcessProtocolSP m_debugged_process_sp; lldb::DebuggerSP m_debugger_sp; Communication m_stdio_communication; lldb::StateType m_inferior_prev_state; lldb::DataBufferSP m_active_auxv_buffer_sp; - lldb_private::Mutex m_saved_registers_mutex; + Mutex m_saved_registers_mutex; std::unordered_map<uint32_t, lldb::DataBufferSP> m_saved_registers_map; uint32_t m_next_saved_registers_id; @@ -127,7 +131,7 @@ protected: SendONotification (const char *buffer, uint32_t len); PacketResult - SendWResponse (lldb_private::NativeProcessProtocol *process); + SendWResponse (NativeProcessProtocol *process); PacketResult SendStopReplyPacketForThread (lldb::tid_t tid); @@ -246,14 +250,14 @@ protected: lldb::tid_t GetContinueThreadID () const { return m_continue_tid; } - lldb_private::Error + Error SetSTDIOFileDescriptor (int fd); static void STDIOReadThreadBytesReceived (void *baton, const void *src, size_t src_len); - lldb_private::FileSpec - FindModuleFile (const std::string& module_path, const lldb_private::ArchSpec& arch) override; + FileSpec + FindModuleFile (const std::string& module_path, const ArchSpec& arch) override; private: bool @@ -267,15 +271,15 @@ private: int status); void - HandleInferiorState_Exited (lldb_private::NativeProcessProtocol *process); + HandleInferiorState_Exited (NativeProcessProtocol *process); void - HandleInferiorState_Stopped (lldb_private::NativeProcessProtocol *process); + HandleInferiorState_Stopped (NativeProcessProtocol *process); void FlushInferiorOutput (); - lldb_private::NativeThreadProtocolSP + NativeThreadProtocolSP GetThreadFromSuffix (StringExtractorGDBRemote &packet); uint32_t @@ -296,4 +300,7 @@ private: DISALLOW_COPY_AND_ASSIGN (GDBRemoteCommunicationServerLLGS); }; +} // namespace process_gdb_remote +} // namespace lldb_private + #endif // liblldb_GDBRemoteCommunicationServerLLGS_h_ diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp index 346162f305b..0ab965853a5 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -33,6 +33,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_gdb_remote; //---------------------------------------------------------------------- // GDBRemoteCommunicationServerPlatform constructor @@ -275,11 +276,11 @@ GDBRemoteCommunicationServerPlatform::ReapDebugserverProcess (void *callback_bat return true; } -lldb_private::Error +Error GDBRemoteCommunicationServerPlatform::LaunchProcess () { if (!m_process_launch_info.GetArguments ().GetArgumentCount ()) - return lldb_private::Error ("%s: no process command line specified to launch", __FUNCTION__); + return Error ("%s: no process command line specified to launch", __FUNCTION__); // specify the process monitor if not already set. This should // generally be what happens since we need to reap started @@ -287,7 +288,7 @@ GDBRemoteCommunicationServerPlatform::LaunchProcess () if (!m_process_launch_info.GetMonitorProcessCallback ()) m_process_launch_info.SetMonitorProcessCallback(ReapDebugserverProcess, this, false); - lldb_private::Error error = m_platform_sp->LaunchProcess (m_process_launch_info); + Error error = m_platform_sp->LaunchProcess (m_process_launch_info); if (!error.Success ()) { fprintf (stderr, "%s: failed to launch executable %s", __FUNCTION__, m_process_launch_info.GetArguments ().GetArgumentAtIndex (0)); diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h index 430cc5e505e..4124b0424f5 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.h @@ -12,6 +12,9 @@ #include "GDBRemoteCommunicationServerCommon.h" +namespace lldb_private { +namespace process_gdb_remote { + class GDBRemoteCommunicationServerPlatform : public GDBRemoteCommunicationServerCommon { @@ -23,7 +26,7 @@ public: virtual ~GDBRemoteCommunicationServerPlatform(); - lldb_private::Error + Error LaunchProcess () override; // Set both ports to zero to let the platform automatically bind to @@ -93,4 +96,7 @@ private: DISALLOW_COPY_AND_ASSIGN (GDBRemoteCommunicationServerPlatform); }; +} // namespace process_gdb_remote +} // namespace lldb_private + #endif // liblldb_GDBRemoteCommunicationServerPlatform_h_ diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp index 6d7eca1a0ce..74b0d04859e 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -33,6 +33,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_gdb_remote; //---------------------------------------------------------------------- // GDBRemoteRegisterContext constructor @@ -151,7 +152,7 @@ GDBRemoteRegisterContext::PrivateSetRegisterValue (uint32_t reg, StringExtractor // Helper function for GDBRemoteRegisterContext::ReadRegisterBytes(). bool -GDBRemoteRegisterContext::GetPrimordialRegister(const lldb_private::RegisterInfo *reg_info, +GDBRemoteRegisterContext::GetPrimordialRegister(const RegisterInfo *reg_info, GDBRemoteCommunicationClient &gdb_comm) { const uint32_t reg = reg_info->kinds[eRegisterKindLLDB]; @@ -265,7 +266,7 @@ GDBRemoteRegisterContext::WriteRegister (const RegisterInfo *reg_info, // Helper function for GDBRemoteRegisterContext::WriteRegisterBytes(). bool -GDBRemoteRegisterContext::SetPrimordialRegister(const lldb_private::RegisterInfo *reg_info, +GDBRemoteRegisterContext::SetPrimordialRegister(const RegisterInfo *reg_info, GDBRemoteCommunicationClient &gdb_comm) { StreamString packet; @@ -316,7 +317,7 @@ GDBRemoteRegisterContext::SyncThreadState(Process *process) } bool -GDBRemoteRegisterContext::WriteRegisterBytes (const lldb_private::RegisterInfo *reg_info, DataExtractor &data, uint32_t data_offset) +GDBRemoteRegisterContext::WriteRegisterBytes (const RegisterInfo *reg_info, DataExtractor &data, uint32_t data_offset) { ExecutionContext exe_ctx (CalculateThread()); @@ -460,7 +461,7 @@ GDBRemoteRegisterContext::WriteRegisterBytes (const lldb_private::RegisterInfo * } bool -GDBRemoteRegisterContext::ReadAllRegisterValues (lldb_private::RegisterCheckpoint ®_checkpoint) +GDBRemoteRegisterContext::ReadAllRegisterValues (RegisterCheckpoint ®_checkpoint) { ExecutionContext exe_ctx (CalculateThread()); @@ -486,7 +487,7 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb_private::RegisterCheckpoin } bool -GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb_private::RegisterCheckpoint ®_checkpoint) +GDBRemoteRegisterContext::WriteAllRegisterValues (const RegisterCheckpoint ®_checkpoint) { uint32_t save_id = reg_checkpoint.GetID(); if (save_id != 0) diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h index 6702b7ceab4..117d280cc54 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h @@ -25,9 +25,13 @@ #include "GDBRemoteCommunicationClient.h" +class StringExtractor; + +namespace lldb_private { +namespace process_gdb_remote { + class ThreadGDBRemote; class ProcessGDBRemote; -class StringExtractor; class GDBRemoteDynamicRegisterInfo : public DynamicRegisterInfo @@ -47,7 +51,7 @@ public: }; -class GDBRemoteRegisterContext : public lldb_private::RegisterContext +class GDBRemoteRegisterContext : public RegisterContext { public: //------------------------------------------------------------------ @@ -70,20 +74,20 @@ public: size_t GetRegisterCount () override; - const lldb_private::RegisterInfo * + const RegisterInfo * GetRegisterInfoAtIndex (size_t reg) override; size_t GetRegisterSetCount () override; - const lldb_private::RegisterSet * + const RegisterSet * GetRegisterSet (size_t reg_set) override; bool - ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override; + ReadRegister (const RegisterInfo *reg_info, RegisterValue &value) override; bool - WriteRegister (const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override; + WriteRegister (const RegisterInfo *reg_info, const RegisterValue &value) override; bool ReadAllRegisterValues (lldb::DataBufferSP &data_sp) override; @@ -92,10 +96,10 @@ public: WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) override; bool - ReadAllRegisterValues (lldb_private::RegisterCheckpoint ®_checkpoint) override; + ReadAllRegisterValues (RegisterCheckpoint ®_checkpoint) override; bool - WriteAllRegisterValues (const lldb_private::RegisterCheckpoint ®_checkpoint) override; + WriteAllRegisterValues (const RegisterCheckpoint ®_checkpoint) override; uint32_t ConvertRegisterKindToRegisterNumber (lldb::RegisterKind kind, uint32_t num) override; @@ -104,12 +108,12 @@ protected: friend class ThreadGDBRemote; bool - ReadRegisterBytes (const lldb_private::RegisterInfo *reg_info, - lldb_private::DataExtractor &data); + ReadRegisterBytes (const RegisterInfo *reg_info, + DataExtractor &data); bool - WriteRegisterBytes (const lldb_private::RegisterInfo *reg_info, - lldb_private::DataExtractor &data, + WriteRegisterBytes (const RegisterInfo *reg_info, + DataExtractor &data, uint32_t data_offset); bool @@ -130,7 +134,7 @@ protected: } void - SetRegisterIsValid (const lldb_private::RegisterInfo *reg_info, bool valid) + SetRegisterIsValid (const RegisterInfo *reg_info, bool valid) { if (reg_info) return SetRegisterIsValid (reg_info->kinds[lldb::eRegisterKindLLDB], valid); @@ -147,19 +151,19 @@ protected: } void - SyncThreadState(lldb_private::Process *process); // Assumes the sequence mutex has already been acquired. + SyncThreadState(Process *process); // Assumes the sequence mutex has already been acquired. GDBRemoteDynamicRegisterInfo &m_reg_info; std::vector<bool> m_reg_valid; - lldb_private::DataExtractor m_reg_data; + DataExtractor m_reg_data; bool m_read_all_at_once; private: // Helper function for ReadRegisterBytes(). - bool GetPrimordialRegister(const lldb_private::RegisterInfo *reg_info, + bool GetPrimordialRegister(const RegisterInfo *reg_info, GDBRemoteCommunicationClient &gdb_comm); // Helper function for WriteRegisterBytes(). - bool SetPrimordialRegister(const lldb_private::RegisterInfo *reg_info, + bool SetPrimordialRegister(const RegisterInfo *reg_info, GDBRemoteCommunicationClient &gdb_comm); //------------------------------------------------------------------ @@ -168,4 +172,7 @@ private: DISALLOW_COPY_AND_ASSIGN (GDBRemoteRegisterContext); }; +} // namespace process_gdb_remote +} // namespace lldb_private + #endif // lldb_GDBRemoteRegisterContext_h_ diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index d9912cc1e53..55964350b39 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -73,6 +73,10 @@ #include "ProcessGDBRemoteLog.h" #include "ThreadGDBRemote.h" +#define DEBUGSERVER_BASENAME "debugserver" +using namespace lldb; +using namespace lldb_private; +using namespace lldb_private::process_gdb_remote; namespace lldb { @@ -85,18 +89,13 @@ namespace lldb void DumpProcessGDBRemotePacketHistory (void *p, const char *path) { - lldb_private::StreamFile strm; - lldb_private::Error error (strm.GetFile().Open(path, lldb_private::File::eOpenOptionWrite | lldb_private::File::eOpenOptionCanCreate)); + StreamFile strm; + Error error (strm.GetFile().Open(path, File::eOpenOptionWrite | File::eOpenOptionCanCreate)); if (error.Success()) ((ProcessGDBRemote *)p)->GetGDBRemote().DumpHistory (strm); } } -#define DEBUGSERVER_BASENAME "debugserver" -using namespace lldb; -using namespace lldb_private; - - namespace { static PropertyDefinition @@ -199,7 +198,7 @@ get_random_port () } #endif -lldb_private::ConstString +ConstString ProcessGDBRemote::GetPluginNameStatic() { static ConstString g_name("gdb-remote"); @@ -2240,7 +2239,7 @@ ProcessGDBRemote::DoDestroy () void ProcessGDBRemote::SetLastStopPacket (const StringExtractorGDBRemote &response) { - lldb_private::Mutex::Locker locker (m_last_stop_packet_mutex); + Mutex::Locker locker (m_last_stop_packet_mutex); const bool did_exec = response.GetStringRef().find(";reason:exec;") != std::string::npos; if (did_exec) { @@ -2380,7 +2379,7 @@ ProcessGDBRemote::DoWriteMemory (addr_t addr, const void *buf, size_t size, Erro lldb::addr_t ProcessGDBRemote::DoAllocateMemory (size_t size, uint32_t permissions, Error &error) { - lldb_private::Log *log (lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_PROCESS|LIBLLDB_LOG_EXPRESSIONS)); + Log *log (GetLogIfAnyCategoriesSet (LIBLLDB_LOG_PROCESS|LIBLLDB_LOG_EXPRESSIONS)); addr_t allocated_addr = LLDB_INVALID_ADDRESS; LazyBool supported = m_gdb_comm.SupportsAllocDeallocMemory(); @@ -2972,7 +2971,7 @@ ProcessGDBRemote::Initialize() } void -ProcessGDBRemote::DebuggerInitialize (lldb_private::Debugger &debugger) +ProcessGDBRemote::DebuggerInitialize (Debugger &debugger) { if (!PluginManager::GetSettingForProcessPlugin(debugger, PluginProperties::GetSettingName())) { @@ -3191,13 +3190,13 @@ ProcessGDBRemote::AsyncThread (void *arg) // bool ProcessGDBRemote::NewThreadNotifyBreakpointHit (void *baton, - lldb_private::StoppointCallbackContext *context, + StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id) { // I don't think I have to do anything here, just make sure I notice the new thread when it starts to // run so I can stop it if that's what I want to do. - Log *log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); if (log) log->Printf("Hit New Thread Notification breakpoint."); return false; @@ -3207,7 +3206,7 @@ ProcessGDBRemote::NewThreadNotifyBreakpointHit (void *baton, bool ProcessGDBRemote::StartNoticingNewThreads() { - Log *log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); if (m_thread_create_bp_sp) { if (log && log->GetVerbose()) @@ -3239,7 +3238,7 @@ ProcessGDBRemote::StartNoticingNewThreads() bool ProcessGDBRemote::StopNoticingNewThreads() { - Log *log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); if (log && log->GetVerbose()) log->Printf ("Disabling new thread notification breakpoint."); @@ -3249,7 +3248,7 @@ ProcessGDBRemote::StopNoticingNewThreads() return true; } -lldb_private::DynamicLoader * +DynamicLoader * ProcessGDBRemote::GetDynamicLoader () { if (m_dyld_ap.get() == NULL) diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h index 8cd445e8792..5cde354ff3c 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -34,29 +34,32 @@ #include "Utility/StringExtractor.h" #include "GDBRemoteRegisterContext.h" +namespace lldb_private { +namespace process_gdb_remote { + class ThreadGDBRemote; -class ProcessGDBRemote : public lldb_private::Process +class ProcessGDBRemote : public Process { public: //------------------------------------------------------------------ // Constructors and Destructors //------------------------------------------------------------------ static lldb::ProcessSP - CreateInstance (lldb_private::Target& target, - lldb_private::Listener &listener, - const lldb_private::FileSpec *crash_file_path); + CreateInstance (Target& target, + Listener &listener, + const FileSpec *crash_file_path); static void Initialize(); static void - DebuggerInitialize (lldb_private::Debugger &debugger); + DebuggerInitialize (Debugger &debugger); static void Terminate(); - static lldb_private::ConstString + static ConstString GetPluginNameStatic(); static const char * @@ -65,7 +68,7 @@ public: //------------------------------------------------------------------ // Constructors and Destructors //------------------------------------------------------------------ - ProcessGDBRemote(lldb_private::Target& target, lldb_private::Listener &listener); + ProcessGDBRemote(Target& target, Listener &listener); virtual ~ProcessGDBRemote(); @@ -74,54 +77,52 @@ public: // Check if a given Process //------------------------------------------------------------------ bool - CanDebug (lldb_private::Target &target, - bool plugin_specified_by_name) override; + CanDebug (Target &target, bool plugin_specified_by_name) override; - lldb_private::CommandObject * + CommandObject * GetPluginCommandObject() override; //------------------------------------------------------------------ // Creating a new process, or attaching to an existing one //------------------------------------------------------------------ - lldb_private::Error - WillLaunch (lldb_private::Module* module) override; + Error + WillLaunch (Module* module) override; - lldb_private::Error - DoLaunch (lldb_private::Module *exe_module, - lldb_private::ProcessLaunchInfo &launch_info) override; + Error + DoLaunch (Module *exe_module, ProcessLaunchInfo &launch_info) override; void DidLaunch () override; - lldb_private::Error + Error WillAttachToProcessWithID (lldb::pid_t pid) override; - lldb_private::Error + Error WillAttachToProcessWithName (const char *process_name, bool wait_for_launch) override; - lldb_private::Error - DoConnectRemote (lldb_private::Stream *strm, const char *remote_url) override; + Error + DoConnectRemote (Stream *strm, const char *remote_url) override; - lldb_private::Error + Error WillLaunchOrAttach (); - lldb_private::Error + Error DoAttachToProcessWithID (lldb::pid_t pid) override; - lldb_private::Error - DoAttachToProcessWithID (lldb::pid_t pid, const lldb_private::ProcessAttachInfo &attach_info) override; + Error + DoAttachToProcessWithID (lldb::pid_t pid, const ProcessAttachInfo &attach_info) override; - lldb_private::Error + Error DoAttachToProcessWithName (const char *process_name, - const lldb_private::ProcessAttachInfo &attach_info) override; + const ProcessAttachInfo &attach_info) override; void - DidAttach (lldb_private::ArchSpec &process_arch) override; + DidAttach (ArchSpec &process_arch) override; //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ - lldb_private::ConstString + ConstString GetPluginName() override; uint32_t @@ -130,25 +131,25 @@ public: //------------------------------------------------------------------ // Process Control //------------------------------------------------------------------ - lldb_private::Error + Error WillResume () override; - lldb_private::Error + Error DoResume () override; - lldb_private::Error + Error DoHalt (bool &caused_stop) override; - lldb_private::Error + Error DoDetach (bool keep_stopped) override; bool DetachRequiresHalt() override { return true; } - lldb_private::Error + Error DoSignal (int signal) override; - lldb_private::Error + Error DoDestroy () override; void @@ -167,49 +168,48 @@ public: // Process Memory //------------------------------------------------------------------ size_t - DoReadMemory (lldb::addr_t addr, void *buf, size_t size, lldb_private::Error &error) override; + DoReadMemory (lldb::addr_t addr, void *buf, size_t size, Error &error) override; size_t - DoWriteMemory (lldb::addr_t addr, const void *buf, size_t size, lldb_private::Error &error) override; + DoWriteMemory (lldb::addr_t addr, const void *buf, size_t size, Error &error) override; lldb::addr_t - DoAllocateMemory (size_t size, uint32_t permissions, lldb_private::Error &error) override; + DoAllocateMemory (size_t size, uint32_t permissions, Error &error) override; - lldb_private::Error - GetMemoryRegionInfo (lldb::addr_t load_addr, - lldb_private::MemoryRegionInfo ®ion_info) override; + Error + GetMemoryRegionInfo (lldb::addr_t load_addr, MemoryRegionInfo ®ion_info) override; - lldb_private::Error + Error DoDeallocateMemory (lldb::addr_t ptr) override; //------------------------------------------------------------------ // Process STDIO //------------------------------------------------------------------ size_t - PutSTDIN (const char *buf, size_t buf_size, lldb_private::Error &error) override; + PutSTDIN (const char *buf, size_t buf_size, Error &error) override; //---------------------------------------------------------------------- // Process Breakpoints //---------------------------------------------------------------------- - lldb_private::Error - EnableBreakpointSite (lldb_private::BreakpointSite *bp_site) override; + Error + EnableBreakpointSite (BreakpointSite *bp_site) override; - lldb_private::Error - DisableBreakpointSite (lldb_private::BreakpointSite *bp_site) override; + Error + DisableBreakpointSite (BreakpointSite *bp_site) override; //---------------------------------------------------------------------- // Process Watchpoints //---------------------------------------------------------------------- - lldb_private::Error - EnableWatchpoint (lldb_private::Watchpoint *wp, bool notify = true) override; + Error + EnableWatchpoint (Watchpoint *wp, bool notify = true) override; - lldb_private::Error - DisableWatchpoint (lldb_private::Watchpoint *wp, bool notify = true) override; + Error + DisableWatchpoint (Watchpoint *wp, bool notify = true) override; - lldb_private::Error + Error GetWatchpointSupportInfo (uint32_t &num) override; - lldb_private::Error + Error GetWatchpointSupportInfo (uint32_t &num, bool& after) override; bool @@ -224,7 +224,7 @@ public: return m_gdb_comm; } - lldb_private::Error + Error SendEventData(const char *data) override; //---------------------------------------------------------------------- @@ -237,9 +237,9 @@ public: SetUserSpecifiedMaxMemoryTransferSize (uint64_t user_specified_max); 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; protected: friend class ThreadGDBRemote; @@ -278,24 +278,24 @@ protected: void Clear ( ); - lldb_private::Flags & + Flags & GetFlags () { return m_flags; } - const lldb_private::Flags & + const Flags & GetFlags () const { return m_flags; } bool - UpdateThreadList (lldb_private::ThreadList &old_thread_list, - lldb_private::ThreadList &new_thread_list) override; + UpdateThreadList (ThreadList &old_thread_list, + ThreadList &new_thread_list) override; - lldb_private::Error - LaunchAndConnectToDebugserver (const lldb_private::ProcessInfo &process_info); + Error + LaunchAndConnectToDebugserver (const ProcessInfo &process_info); void KillDebugserverProcess (); @@ -307,12 +307,12 @@ protected: SetLastStopPacket (const StringExtractorGDBRemote &response); bool - ParsePythonTargetDefinition(const lldb_private::FileSpec &target_definition_fspec); + ParsePythonTargetDefinition(const FileSpec &target_definition_fspec); const lldb::DataBufferSP GetAuxvData() override; - lldb_private::StructuredData::ObjectSP + StructuredData::ObjectSP GetExtendedInfoForThread (lldb::tid_t tid); void @@ -328,15 +328,15 @@ protected: eBroadcastBitAsyncThreadDidExit = (1 << 2) }; - lldb_private::Flags m_flags; // Process specific flags (see eFlags enums) + Flags m_flags; // Process specific flags (see eFlags enums) GDBRemoteCommunicationClient m_gdb_comm; std::atomic<lldb::pid_t> m_debugserver_pid; StringExtractorGDBRemote m_last_stop_packet; - lldb_private::Mutex m_last_stop_packet_mutex; + Mutex m_last_stop_packet_mutex; GDBRemoteDynamicRegisterInfo m_register_info; - lldb_private::Broadcaster m_async_broadcaster; - lldb_private::HostThread m_async_thread; - lldb_private::Mutex m_async_thread_state_mutex; + Broadcaster m_async_broadcaster; + HostThread m_async_thread; + Mutex m_async_thread_state_mutex; typedef std::vector<lldb::tid_t> tid_collection; typedef std::vector< std::pair<lldb::tid_t,int> > tid_sig_collection; typedef std::map<lldb::addr_t, lldb::addr_t> MMapMap; @@ -380,16 +380,16 @@ protected: UpdateThreadIDList (); void - DidLaunchOrAttach (lldb_private::ArchSpec& process_arch); + DidLaunchOrAttach (ArchSpec& process_arch); - lldb_private::Error + Error ConnectToDebugserver (const char *host_port); const char * GetDispatchQueueNameForThread (lldb::addr_t thread_dispatch_qaddr, std::string &dispatch_queue_name); - lldb_private::DynamicLoader * + DynamicLoader * GetDynamicLoader () override; private: @@ -398,7 +398,7 @@ private: //------------------------------------------------------------------ static bool NewThreadNotifyBreakpointHit (void *baton, - lldb_private::StoppointCallbackContext *context, + StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id); @@ -406,4 +406,7 @@ private: }; +} // namespace process_gdb_remote +} // namespace lldb_private + #endif // liblldb_ProcessGDBRemote_h_ diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp index 0f73e44590b..d4726adc890 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp @@ -18,6 +18,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_gdb_remote; // We want to avoid global constructors where code needs to be run so here we diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h index c551f8eba59..3cd974d7d82 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h @@ -32,29 +32,35 @@ #define GDBR_LOG_ALL (UINT32_MAX) #define GDBR_LOG_DEFAULT GDBR_LOG_PACKETS +namespace lldb_private { +namespace process_gdb_remote { + class ProcessGDBRemoteLog { public: static void Initialize(); - static lldb_private::Log * + static Log * GetLogIfAllCategoriesSet(uint32_t mask = 0); - static lldb_private::Log * + static Log * GetLogIfAnyCategoryIsSet (uint32_t mask); static void - DisableLog (const char **categories, lldb_private::Stream *feedback_strm); + DisableLog (const char **categories, Stream *feedback_strm); - static lldb_private::Log * - EnableLog (lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **categories, lldb_private::Stream *feedback_strm); + static Log * + EnableLog (lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **categories, Stream *feedback_strm); static void - ListLogCategories (lldb_private::Stream *strm); + ListLogCategories (Stream *strm); static void LogIf (uint32_t mask, const char *format, ...); }; +} // namespace process_gdb_remote +} // namespace lldb_private + #endif // liblldb_ProcessGDBRemoteLog_h_ diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp index 6309f7511a4..e4108edc03f 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp @@ -30,6 +30,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_gdb_remote; //---------------------------------------------------------------------- // Thread Registers @@ -148,7 +149,7 @@ ThreadGDBRemote::FetchThreadExtendedInfo () { StructuredData::ObjectSP object_sp; const lldb::user_id_t tid = GetProtocolID(); - Log *log(lldb_private::GetLogIfAnyCategoriesSet (GDBR_LOG_THREAD)); + Log *log(GetLogIfAnyCategoriesSet (GDBR_LOG_THREAD)); if (log) log->Printf ("Fetching extended information for thread %4.4" PRIx64, tid); ProcessSP process_sp (GetProcess()); @@ -165,7 +166,7 @@ ThreadGDBRemote::WillResume (StateType resume_state) { int signo = GetResumeSignal(); const lldb::user_id_t tid = GetProtocolID(); - Log *log(lldb_private::GetLogIfAnyCategoriesSet (GDBR_LOG_THREAD)); + Log *log(GetLogIfAnyCategoriesSet (GDBR_LOG_THREAD)); if (log) log->Printf ("Resuming thread: %4.4" PRIx64 " with state: %s.", tid, StateAsCString(resume_state)); diff --git a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h index e465f19d188..8bff54456dc 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ThreadGDBRemote.h @@ -17,12 +17,16 @@ #include "lldb/Target/Thread.h" class StringExtractor; + +namespace lldb_private { +namespace process_gdb_remote { + class ProcessGDBRemote; -class ThreadGDBRemote : public lldb_private::Thread +class ThreadGDBRemote : public Thread { public: - ThreadGDBRemote (lldb_private::Process &process, lldb::tid_t tid); + ThreadGDBRemote (Process &process, lldb::tid_t tid); virtual ~ThreadGDBRemote (); @@ -52,10 +56,10 @@ public: GetRegisterContext () override; lldb::RegisterContextSP - CreateRegisterContextForFrame (lldb_private::StackFrame *frame) override; + CreateRegisterContextForFrame (StackFrame *frame) override; void - Dump (lldb_private::Log *log, uint32_t index); + Dump (Log *log, uint32_t index); static bool ThreadIDIsValid (lldb::tid_t thread); @@ -87,7 +91,7 @@ public: m_thread_dispatch_qaddr = thread_dispatch_qaddr; } - lldb_private::StructuredData::ObjectSP + StructuredData::ObjectSP FetchThreadExtendedInfo () override; protected: @@ -113,8 +117,9 @@ protected: bool CalculateStopInfo () override; - - }; +} // namespace process_gdb_remote +} // namespace lldb_private + #endif // liblldb_ThreadGDBRemote_h_ diff --git a/lldb/tools/lldb-server/lldb-gdbserver.cpp b/lldb/tools/lldb-server/lldb-gdbserver.cpp index 8117454a8a3..b66abf3a1b4 100644 --- a/lldb/tools/lldb-server/lldb-gdbserver.cpp +++ b/lldb/tools/lldb-server/lldb-gdbserver.cpp @@ -50,6 +50,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_gdb_remote; // lldb-gdbserver state diff --git a/lldb/tools/lldb-server/lldb-platform.cpp b/lldb/tools/lldb-server/lldb-platform.cpp index 2135633a06a..00e46199fcc 100644 --- a/lldb/tools/lldb-server/lldb-platform.cpp +++ b/lldb/tools/lldb-server/lldb-platform.cpp @@ -39,6 +39,7 @@ using namespace lldb; using namespace lldb_private; +using namespace lldb_private::process_gdb_remote; //---------------------------------------------------------------------- // option descriptors for getopt_long_only() |