diff options
author | Todd Fiala <tfiala@google.com> | 2014-01-28 00:34:23 +0000 |
---|---|---|
committer | Todd Fiala <tfiala@google.com> | 2014-01-28 00:34:23 +0000 |
commit | b8b49ec92bd33b3158f9bf0a74165ac6334f4136 (patch) | |
tree | 0812dc4544a086b3b304b0c0c0944c08b27f98ec /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp | |
parent | 2e87e14490a60ce4f7da4f432b2af8b505a67d71 (diff) | |
download | bcm5719-llvm-b8b49ec92bd33b3158f9bf0a74165ac6334f4136.tar.gz bcm5719-llvm-b8b49ec92bd33b3158f9bf0a74165ac6334f4136.zip |
Modified GDBProcessCommunicationServer to launch via the platform.
GDBProcessCommunicationServer now optionally takes a PlatformSP that
defaults to the default platform for the host.
GDBProcessCommunicationServer::LaunchProcess () now uses the platform
to launch the process.
lldb-gdbserver now takes an optional --platform={platform_plugin_name}
or -p {platform_plugin_name} command line option. If no platform is
specified, the default platform for the host is used; otherwise, if
the platform_plugin_name matches a registered platform plugin or
matches the default platform's name (which is not necessarily
registered by name in the case of 'host'), that platform is used. If
the platform name cannot be resolved, lldb-gdbserver exits after
printing all the available platform plugin names and the default
platform plugin name.
llvm-svn: 200266
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp index f002cc05041..df95542d2c0 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp @@ -25,6 +25,7 @@ #include "lldb/Host/File.h" #include "lldb/Host/Host.h" #include "lldb/Host/TimeValue.h" +#include "lldb/Target/Platform.h" #include "lldb/Target/Process.h" // Project includes @@ -40,6 +41,7 @@ using namespace lldb_private; //---------------------------------------------------------------------- GDBRemoteCommunicationServer::GDBRemoteCommunicationServer(bool is_platform) : GDBRemoteCommunication ("gdb-remote.server", "gdb-remote.server.rx_packet", is_platform), + m_platform_sp (Platform::GetDefaultPlatform ()), m_async_thread (LLDB_INVALID_HOST_THREAD), m_process_launch_info (), m_process_launch_error (), @@ -52,6 +54,23 @@ GDBRemoteCommunicationServer::GDBRemoteCommunicationServer(bool is_platform) : { } +GDBRemoteCommunicationServer::GDBRemoteCommunicationServer(bool is_platform, + const lldb::PlatformSP& platform_sp) : + GDBRemoteCommunication ("gdb-remote.server", "gdb-remote.server.rx_packet", is_platform), + m_platform_sp (platform_sp), + m_async_thread (LLDB_INVALID_HOST_THREAD), + m_process_launch_info (), + m_process_launch_error (), + m_spawned_pids (), + m_spawned_pids_mutex (Mutex::eMutexTypeRecursive), + m_proc_infos (), + m_proc_infos_index (0), + m_port_map (), + m_port_offset(0) +{ + assert(platform_sp); +} + //---------------------------------------------------------------------- // Destructor //---------------------------------------------------------------------- @@ -304,7 +323,7 @@ GDBRemoteCommunicationServer::LaunchProcess () if (!m_process_launch_info.GetMonitorProcessCallback ()) m_process_launch_info.SetMonitorProcessCallback(ReapDebuggedProcess, this, false); - lldb_private::Error error = Host::LaunchProcess (m_process_launch_info); + lldb_private::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)); |