aboutsummaryrefslogtreecommitdiff
path: root/include/lldb/Target/Platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Target/Platform.h')
-rw-r--r--include/lldb/Target/Platform.h84
1 files changed, 75 insertions, 9 deletions
diff --git a/include/lldb/Target/Platform.h b/include/lldb/Target/Platform.h
index 80011fd120de..e3d6abe3f398 100644
--- a/include/lldb/Target/Platform.h
+++ b/include/lldb/Target/Platform.h
@@ -18,6 +18,7 @@
// Other libraries and framework includes
// Project includes
+#include "lldb/lldb-private-forward.h"
#include "lldb/lldb-public.h"
#include "lldb/Core/ArchSpec.h"
#include "lldb/Core/ConstString.h"
@@ -25,6 +26,10 @@
#include "lldb/Interpreter/Options.h"
#include "lldb/Host/Mutex.h"
+// TODO pull NativeDelegate class out of NativeProcessProtocol so we
+// can just forward ref the NativeDelegate rather than include it here.
+#include "../../../source/Host/common/NativeProcessProtocol.h"
+
namespace lldb_private {
//----------------------------------------------------------------------
@@ -174,13 +179,13 @@ namespace lldb_private {
/// m_arch - The architecture we are looking for when resolving
/// the symbol file.
/// m_uuid - The UUID of the executable and symbol file. This
- /// can often be used to match up an exectuable with
+ /// can often be used to match up an executable with
/// a symbol file, or resolve an symbol file in a
/// symbol file bundle.
///
/// @param[out] sym_file
/// The resolved symbol file spec if the returned error
- /// indicates succes.
+ /// indicates success.
///
/// @return
/// Returns an error that describes success or failure.
@@ -215,7 +220,7 @@ namespace lldb_private {
bool
GetOSKernelDescription (std::string &s);
- // Returns the the name of the platform
+ // Returns the name of the platform
ConstString
GetName ();
@@ -241,7 +246,7 @@ namespace lldb_private {
//
// Remote classes must be connected for this to succeed. Local
// subclasses don't need to override this function as it will just
- // call the Host::GetOSVersion().
+ // call the HostInfo::GetOSVersion().
//------------------------------------------------------------------
virtual bool
GetRemoteOSVersion ()
@@ -326,7 +331,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
virtual FileSpecList
LocateExecutableScriptingResources (Target *target,
- Module &module);
+ Module &module,
+ Stream* feedback_stream);
virtual Error
GetSharedModule (const ModuleSpec &module_spec,
@@ -349,7 +355,7 @@ namespace lldb_private {
/// A zero based architecture index
///
/// @param[out] arch
- /// A copy of the archgitecture at index if the return value is
+ /// A copy of the architecture at index if the return value is
/// \b true.
///
/// @return
@@ -413,7 +419,7 @@ namespace lldb_private {
/// attempt to attach to the process with the process ID of \a pid.
/// The platform subclass should return an appropriate ProcessSP
/// subclass that is attached to the process, or an empty shared
- /// pointer with an appriopriate error.
+ /// pointer with an appropriate error.
///
/// @param[in] pid
/// The process ID that we should attempt to attach to.
@@ -422,7 +428,7 @@ namespace lldb_private {
/// An appropriate ProcessSP containing a valid shared pointer
/// to the default Process subclass for the platform that is
/// attached to the process, or an empty shared pointer with an
- /// appriopriate error fill into the \a error object.
+ /// appropriate error fill into the \a error object.
//------------------------------------------------------------------
virtual lldb::ProcessSP
Attach (ProcessAttachInfo &attach_info,
@@ -858,13 +864,72 @@ namespace lldb_private {
virtual const std::vector<ConstString> &
GetTrapHandlerSymbolNames ();
+ //------------------------------------------------------------------
+ /// Launch a process for debugging.
+ ///
+ /// This differs from Launch in that it returns a NativeProcessProtocol.
+ /// Currently used by lldb-gdbserver.
+ ///
+ /// @param[in] launch_info
+ /// Information required to launch the process.
+ ///
+ /// @param[in] native_delegate
+ /// The delegate that will receive messages regarding the
+ /// inferior. Must outlive the NativeProcessProtocol
+ /// instance.
+ ///
+ /// @param[out] process_sp
+ /// On successful return from the method, this parameter
+ /// contains the shared pointer to the
+ /// NativeProcessProtocol that can be used to manipulate
+ /// the native process.
+ ///
+ /// @return
+ /// An error object indicating if the operation succeeded,
+ /// and if not, what error occurred.
+ //------------------------------------------------------------------
+ virtual Error
+ LaunchNativeProcess (
+ ProcessLaunchInfo &launch_info,
+ lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
+ NativeProcessProtocolSP &process_sp);
+
+ //------------------------------------------------------------------
+ /// Attach to an existing process on the given platform.
+ ///
+ /// This method differs from Attach() in that it returns a
+ /// NativeProcessProtocol. Currently this is used by lldb-gdbserver.
+ ///
+ /// @param[in] pid
+ /// pid of the process locatable by the platform.
+ ///
+ /// @param[in] native_delegate
+ /// The delegate that will receive messages regarding the
+ /// inferior. Must outlive the NativeProcessProtocol
+ /// instance.
+ ///
+ /// @param[out] process_sp
+ /// On successful return from the method, this parameter
+ /// contains the shared pointer to the
+ /// NativeProcessProtocol that can be used to manipulate
+ /// the native process.
+ ///
+ /// @return
+ /// An error object indicating if the operation succeeded,
+ /// and if not, what error occurred.
+ //------------------------------------------------------------------
+ virtual Error
+ AttachNativeProcess (lldb::pid_t pid,
+ lldb_private::NativeProcessProtocol::NativeDelegate &native_delegate,
+ NativeProcessProtocolSP &process_sp);
+
protected:
bool m_is_host;
// Set to true when we are able to actually set the OS version while
// being connected. For remote platforms, we might set the version ahead
// of time before we actually connect and this version might change when
// we actually connect to a remote platform. For the host platform this
- // will be set to the once we call Host::GetOSVersion().
+ // will be set to the once we call HostInfo::GetOSVersion().
bool m_os_version_set_while_connected;
bool m_system_arch_set_while_connected;
ConstString m_sdk_sysroot; // the root location of where the SDK files are all located
@@ -892,6 +957,7 @@ namespace lldb_private {
std::string m_local_cache_directory;
std::vector<ConstString> m_trap_handlers;
bool m_calculated_trap_handlers;
+ Mutex m_trap_handler_mutex;
//------------------------------------------------------------------
/// Ask the Platform subclass to fill in the list of trap handler names