diff options
Diffstat (limited to 'lldb/source/Plugins/Process')
-rw-r--r-- | lldb/source/Plugins/Process/Linux/ProcessLinux.cpp | 27 | ||||
-rw-r--r-- | lldb/source/Plugins/Process/Linux/ProcessLinux.h | 12 |
2 files changed, 39 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp index 00bdda51036..d7fe1dae0a1 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.cpp @@ -13,6 +13,7 @@ #include "lldb/Core/PluginManager.h" #include "lldb/Host/Host.h" #include "lldb/Symbol/ObjectFile.h" +#include "lldb/Target/DynamicLoader.h" #include "lldb/Target/Target.h" #include "ProcessLinux.h" @@ -102,6 +103,19 @@ ProcessLinux::DoAttachToProcessWithID(lldb::pid_t pid) } Error +ProcessLinux::WillLaunch(Module* module) +{ + Error error; + + m_dyld_ap.reset(DynamicLoader::FindPlugin(this, "dynamic-loader.linux-dyld")); + if (m_dyld_ap.get() == NULL) + error.SetErrorString("unable to find the dynamic loader named " + "'dynamic-loader.linux-dyld'"); + + return error; +} + +Error ProcessLinux::DoLaunch(Module *module, char const *argv[], char const *envp[], @@ -128,6 +142,13 @@ ProcessLinux::DoLaunch(Module *module, return error; } +void +ProcessLinux::DidLaunch() +{ + if (m_dyld_ap.get() != NULL) + m_dyld_ap->DidLaunch(); +} + Error ProcessLinux::DoResume() { @@ -371,6 +392,12 @@ ProcessLinux::GetByteOrder() const return m_byte_order; } +DynamicLoader * +ProcessLinux::GetDynamicLoader() +{ + return m_dyld_ap.get(); +} + //------------------------------------------------------------------------------ // ProcessInterface protocol. diff --git a/lldb/source/Plugins/Process/Linux/ProcessLinux.h b/lldb/source/Plugins/Process/Linux/ProcessLinux.h index 3e23a7ad37e..fbf14df1988 100644 --- a/lldb/source/Plugins/Process/Linux/ProcessLinux.h +++ b/lldb/source/Plugins/Process/Linux/ProcessLinux.h @@ -60,6 +60,9 @@ public: CanDebug(lldb_private::Target &target); virtual lldb_private::Error + WillLaunch(lldb_private::Module *module); + + virtual lldb_private::Error DoAttachToProcessWithID(lldb::pid_t pid); virtual lldb_private::Error @@ -71,6 +74,9 @@ public: const char *stdout_path, const char *stderr_path); + virtual void + DidLaunch(); + virtual lldb_private::Error DoResume(); @@ -131,6 +137,9 @@ public: virtual lldb::addr_t GetImageInfoAddress(); + virtual lldb_private::DynamicLoader * + GetDynamicLoader(); + //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ @@ -176,6 +185,9 @@ private: lldb_private::Mutex m_message_mutex; std::queue<ProcessMessage> m_message_queue; + /// Dynamic loader plugin associated with this process. + std::auto_ptr<lldb_private::DynamicLoader> m_dyld_ap; + /// Updates the loaded sections provided by the executable. /// /// FIXME: It would probably be better to delegate this task to the |