[Lldb-commits] [lldb] r221322 - Rename some classes in ProcessWindows.
Zachary Turner
zturner at google.com
Tue Nov 4 16:33:29 PST 2014
Author: zturner
Date: Tue Nov 4 18:33:28 2014
New Revision: 221322
URL: http://llvm.org/viewvc/llvm-project?rev=221322&view=rev
Log:
Rename some classes in ProcessWindows.
Renamed monitor -> driver, to make clear that the implementation here
is in no way related to that of other process plugins which have also
implemented classes with similar names such as DebugMonitor.
Also created a DebugEventHandler interface, which will be used by
implementors to get notified when debugging events happen in the
inferiors.
Added:
lldb/trunk/source/Plugins/Process/Windows/DriverMessageResults.cpp
lldb/trunk/source/Plugins/Process/Windows/DriverMessageResults.h
- copied, changed from r221241, lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.h
lldb/trunk/source/Plugins/Process/Windows/DriverMessages.cpp
- copied, changed from r221241, lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.cpp
lldb/trunk/source/Plugins/Process/Windows/DriverMessages.h
- copied, changed from r221241, lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.h
lldb/trunk/source/Plugins/Process/Windows/IDebugEventHandler.h
lldb/trunk/source/Plugins/Process/Windows/ProcessMessages.h
- copied, changed from r221241, lldb/trunk/source/Plugins/Process/Windows/SlaveMessages.h
Removed:
lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.cpp
lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.h
lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.cpp
lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.h
lldb/trunk/source/Plugins/Process/Windows/SlaveMessages.h
Modified:
lldb/trunk/source/Plugins/Process/Windows/CMakeLists.txt
lldb/trunk/source/Plugins/Process/Windows/DebugDriverThread.cpp
lldb/trunk/source/Plugins/Process/Windows/DebugDriverThread.h
lldb/trunk/source/Plugins/Process/Windows/DebugOneProcessThread.cpp
lldb/trunk/source/Plugins/Process/Windows/DebugOneProcessThread.h
lldb/trunk/source/Plugins/Process/Windows/DebugProcessLauncher.cpp
Modified: lldb/trunk/source/Plugins/Process/Windows/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/CMakeLists.txt?rev=221322&r1=221321&r2=221322&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Process/Windows/CMakeLists.txt Tue Nov 4 18:33:28 2014
@@ -4,8 +4,8 @@ include_directories(.)
include_directories(../Utility)
add_lldb_library(lldbPluginProcessWindows
- DebugMonitorMessages.cpp
- DebugMonitorMessageResults.cpp
+ DriverMessages.cpp
+ DriverMessageResults.cpp
DebugOneProcessThread.cpp
DebugProcessLauncher.cpp
DebugDriverThread.cpp
Modified: lldb/trunk/source/Plugins/Process/Windows/DebugDriverThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DebugDriverThread.cpp?rev=221322&r1=221321&r2=221322&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DebugDriverThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Windows/DebugDriverThread.cpp Tue Nov 4 18:33:28 2014
@@ -8,10 +8,10 @@
//===----------------------------------------------------------------------===//
#include "DebugDriverThread.h"
-#include "DebugMonitorMessages.h"
-#include "DebugMonitorMessageResults.h"
+#include "DriverMessages.h"
+#include "DriverMessageResults.h"
#include "DebugOneProcessThread.h"
-#include "SlaveMessages.h"
+#include "ProcessMessages.h"
#include "lldb/Core/Log.h"
#include "lldb/Host/ThreadLauncher.h"
@@ -26,10 +26,10 @@ DebugDriverThread *DebugDriverThread::m_
DebugDriverThread::DebugDriverThread()
{
- m_monitor_thread = ThreadLauncher::LaunchThread("lldb.plugin.process-windows.monitor-thread", MonitorThread, this, nullptr);
+ m_driver_thread = ThreadLauncher::LaunchThread("lldb.plugin.process-windows.driver-thread", DriverThread, this, nullptr);
m_shutdown_event = ::CreateEvent(NULL, TRUE, FALSE, NULL);
- m_monitor_event = ::CreateEvent(NULL, FALSE, FALSE, NULL);
- ::CreatePipe(&m_monitor_pipe_read, &m_monitor_pipe_write, NULL, 1024);
+ m_driver_message_event = ::CreateEvent(NULL, FALSE, FALSE, NULL);
+ ::CreatePipe(&m_driver_pipe_read, &m_driver_pipe_write, NULL, 1024);
}
DebugDriverThread::~DebugDriverThread()
@@ -65,17 +65,17 @@ DebugDriverThread::Shutdown()
if (!m_shutdown_event)
return;
::SetEvent(m_shutdown_event);
- m_monitor_thread.Join(nullptr);
+ m_driver_thread.Join(nullptr);
::CloseHandle(m_shutdown_event);
- ::CloseHandle(m_monitor_event);
- ::CloseHandle(m_monitor_pipe_read);
- ::CloseHandle(m_monitor_pipe_write);
+ ::CloseHandle(m_driver_message_event);
+ ::CloseHandle(m_driver_pipe_read);
+ ::CloseHandle(m_driver_pipe_write);
m_shutdown_event = nullptr;
- m_monitor_event = nullptr;
- m_monitor_pipe_read = nullptr;
- m_monitor_pipe_write = nullptr;
+ m_driver_message_event = nullptr;
+ m_driver_pipe_read = nullptr;
+ m_driver_pipe_write = nullptr;
}
DebugDriverThread &
@@ -85,29 +85,29 @@ DebugDriverThread::GetInstance()
}
void
-DebugDriverThread::PostDebugMessage(const DebugMonitorMessage *message)
+DebugDriverThread::PostDebugMessage(const DriverMessage *message)
{
message->Retain();
- if (!::WriteFile(m_monitor_pipe_write, &message, sizeof(message), NULL, NULL))
+ if (!::WriteFile(m_driver_pipe_write, &message, sizeof(message), NULL, NULL))
{
message->Release();
return;
}
- ::SetEvent(m_monitor_event);
+ ::SetEvent(m_driver_message_event);
}
-const DebugMonitorMessageResult *
-DebugDriverThread::HandleMonitorMessage(const DebugMonitorMessage *message)
+const DriverMessageResult *
+DebugDriverThread::HandleDriverMessage(const DriverMessage *message)
{
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
switch (message->GetMessageType())
{
- case MonitorMessageType::eLaunchProcess:
+ case DriverMessageType::eLaunchProcess:
{
- const auto *launch_message = static_cast<const LaunchProcessMessage *>(message);
- return HandleMonitorMessage(launch_message);
+ const auto *launch_message = static_cast<const DriverLaunchProcessMessage *>(message);
+ return HandleDriverMessage(launch_message);
}
default:
if (log)
@@ -116,8 +116,8 @@ DebugDriverThread::HandleMonitorMessage(
}
}
-const LaunchProcessMessageResult *
-DebugDriverThread::HandleMonitorMessage(const LaunchProcessMessage *launch_message)
+const DriverLaunchProcessMessageResult *
+DebugDriverThread::HandleDriverMessage(const DriverLaunchProcessMessage *launch_message)
{
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
const char *exe = launch_message->GetLaunchInfo().GetExecutableFile().GetPath().c_str();
@@ -127,8 +127,8 @@ DebugDriverThread::HandleMonitorMessage(
// Create a DebugOneProcessThread which will do the actual creation and enter a debug loop on
// a background thread, only returning after the process has been created on the background
// thread.
- std::shared_ptr<DebugOneProcessThread> slave(new DebugOneProcessThread(m_monitor_thread));
- const LaunchProcessMessageResult *result = slave->DebugLaunch(launch_message);
+ std::shared_ptr<DebugOneProcessThread> slave(new DebugOneProcessThread(m_driver_thread));
+ const DriverLaunchProcessMessageResult *result = slave->DebugLaunch(launch_message);
if (result && result->GetError().Success())
{
if (log)
@@ -144,7 +144,12 @@ DebugDriverThread::HandleMonitorMessage(
}
void
-DebugDriverThread::HandleSlaveEvent(const SlaveMessageProcessExited &message)
+DebugDriverThread::OnProcessLaunched(const ProcessMessageCreateProcess &message)
+{
+}
+
+void
+DebugDriverThread::OnExitProcess(const ProcessMessageExitProcess &message)
{
lldb::pid_t pid = message.GetProcess().GetProcessId();
@@ -154,7 +159,42 @@ DebugDriverThread::HandleSlaveEvent(cons
}
void
-DebugDriverThread::HandleSlaveEvent(const SlaveMessageRipEvent &message)
+DebugDriverThread::OnDebuggerConnected(const ProcessMessageDebuggerConnected &message)
+{
+}
+
+void
+DebugDriverThread::OnDebugException(const ProcessMessageException &message)
+{
+}
+
+void
+DebugDriverThread::OnCreateThread(const ProcessMessageCreateThread &message)
+{
+}
+
+void
+DebugDriverThread::OnExitThread(const ProcessMessageExitThread &message)
+{
+}
+
+void
+DebugDriverThread::OnLoadDll(const ProcessMessageLoadDll &message)
+{
+}
+
+void
+DebugDriverThread::OnUnloadDll(const ProcessMessageUnloadDll &message)
+{
+}
+
+void
+DebugDriverThread::OnDebugString(const ProcessMessageDebugString &message)
+{
+}
+
+void
+DebugDriverThread::OnDebuggerError(const ProcessMessageDebuggerError &message)
{
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
@@ -169,10 +209,10 @@ DebugDriverThread::HandleSlaveEvent(cons
}
bool
-DebugDriverThread::ProcessMonitorMessages()
+DebugDriverThread::ProcessDriverMessages()
{
DWORD bytes_available = 0;
- if (!PeekNamedPipe(m_monitor_pipe_read, NULL, 0, NULL, &bytes_available, NULL))
+ if (!PeekNamedPipe(m_driver_pipe_read, NULL, 0, NULL, &bytes_available, NULL))
{
// There's some kind of error with the named pipe. Fail out and stop monitoring.
return false;
@@ -184,14 +224,14 @@ DebugDriverThread::ProcessMonitorMessage
return true;
}
- int count = bytes_available / sizeof(DebugMonitorMessage *);
- std::vector<DebugMonitorMessage *> messages(count);
- if (!::ReadFile(m_monitor_pipe_read, &messages[0], bytes_available, NULL, NULL))
+ int count = bytes_available / sizeof(DriverMessage *);
+ std::vector<DriverMessage *> messages(count);
+ if (!::ReadFile(m_driver_pipe_read, &messages[0], bytes_available, NULL, NULL))
return false;
- for (DebugMonitorMessage *message : messages)
+ for (DriverMessage *message : messages)
{
- const DebugMonitorMessageResult *result = HandleMonitorMessage(message);
+ const DriverMessageResult *result = HandleDriverMessage(message);
message->CompleteMessage(result);
message->Release();
}
@@ -199,20 +239,20 @@ DebugDriverThread::ProcessMonitorMessage
}
lldb::thread_result_t
-DebugDriverThread::MonitorThread(void *data)
+DebugDriverThread::DriverThread(void *data)
{
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
if (log)
log->Printf("ProcessWindows DebugDriverThread starting up.");
- DebugDriverThread *monitor_thread = static_cast<DebugDriverThread *>(data);
- const int kMonitorEventIndex = 0;
+ DebugDriverThread *driver_thread = static_cast<DebugDriverThread *>(data);
+ const int kDriverMessageEventIndex = 0;
const int kShutdownEventIndex = 1;
Error error;
HANDLE events[kShutdownEventIndex + 1];
- events[kMonitorEventIndex] = monitor_thread->m_monitor_event;
- events[kShutdownEventIndex] = monitor_thread->m_shutdown_event;
+ events[kDriverMessageEventIndex] = driver_thread->m_driver_message_event;
+ events[kShutdownEventIndex] = driver_thread->m_shutdown_event;
while (true)
{
@@ -221,9 +261,9 @@ DebugDriverThread::MonitorThread(void *d
DWORD result = WaitForMultipleObjectsEx(llvm::array_lengthof(events), events, FALSE, 1000, TRUE);
switch (result)
{
- case WAIT_OBJECT_0 + kMonitorEventIndex:
+ case WAIT_OBJECT_0 + kDriverMessageEventIndex:
// LLDB is telling us to do something. Process pending messages in our queue.
- monitor_thread->ProcessMonitorMessages();
+ driver_thread->ProcessDriverMessages();
break;
case WAIT_OBJECT_0 + kShutdownEventIndex:
error.SetErrorString("Shutdown event received.");
@@ -242,6 +282,6 @@ DebugDriverThread::MonitorThread(void *d
}
if (log)
- log->Printf("ProcessWindows Debug monitor thread exiting. %s", error.AsCString());
+ log->Printf("ProcessWindows Debug driver thread exiting. %s", error.AsCString());
return 0;
}
Modified: lldb/trunk/source/Plugins/Process/Windows/DebugDriverThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DebugDriverThread.h?rev=221322&r1=221321&r2=221322&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DebugDriverThread.h (original)
+++ lldb/trunk/source/Plugins/Process/Windows/DebugDriverThread.h Tue Nov 4 18:33:28 2014
@@ -10,6 +10,8 @@
#ifndef liblldb_Plugins_Process_Windows_DebugDriverThread_H_
#define liblldb_Plugins_Process_Windows_DebugDriverThread_H_
+#include "IDebugEventHandler.h"
+
#include "lldb/Host/HostThread.h"
#include "lldb/Host/windows/windows.h"
#include "lldb/lldb-types.h"
@@ -20,14 +22,12 @@ class ProcessWindows;
namespace lldb_private
{
-class DebugMonitorMessage;
-class DebugMonitorMessageResult;
-class DebugOneProcessThread;
-class LaunchProcessMessage;
-class LaunchProcessMessageResult;
+class DriverMessage;
+class DriverMessageResult;
+class DriverLaunchProcessMessage;
+class DriverLaunchProcessMessageResult;
-class SlaveMessageProcessExited;
-class SlaveMessageRipEvent;
+class DebugOneProcessThread;
//----------------------------------------------------------------------
// DebugDriverThread
@@ -36,7 +36,7 @@ class SlaveMessageRipEvent;
// debugger to do different things like launching processes, attaching to
// processes, etc.
//----------------------------------------------------------------------
-class DebugDriverThread
+class DebugDriverThread : public IDebugEventHandler
{
friend class DebugOneProcessThread;
@@ -47,32 +47,42 @@ class DebugDriverThread
static void Teardown();
static DebugDriverThread &GetInstance();
- void PostDebugMessage(const DebugMonitorMessage *message);
+ void PostDebugMessage(const DriverMessage *message);
private:
DebugDriverThread();
void Shutdown();
- bool ProcessMonitorMessages();
- const DebugMonitorMessageResult *HandleMonitorMessage(const DebugMonitorMessage *message);
- const LaunchProcessMessageResult *HandleMonitorMessage(const LaunchProcessMessage *launch_message);
-
- // Slave message handlers. These are invoked by the
- void HandleSlaveEvent(const SlaveMessageProcessExited &message);
- void HandleSlaveEvent(const SlaveMessageRipEvent &message);
+ bool ProcessDriverMessages();
+
+ const DriverMessageResult *HandleDriverMessage(const DriverMessage *message);
+ const DriverLaunchProcessMessageResult *HandleDriverMessage(const DriverLaunchProcessMessage *launch_message);
+
+ // Debug event handlers. These are invoked on the driver thread by way of QueueUserAPC as
+ // events happen in the inferiors.
+ virtual void OnProcessLaunched(const ProcessMessageCreateProcess &message) override;
+ virtual void OnExitProcess(const ProcessMessageExitProcess &message) override;
+ virtual void OnDebuggerConnected(const ProcessMessageDebuggerConnected &message) override;
+ virtual void OnDebugException(const ProcessMessageException &message) override;
+ virtual void OnCreateThread(const ProcessMessageCreateThread &message) override;
+ virtual void OnExitThread(const ProcessMessageExitThread &message) override;
+ virtual void OnLoadDll(const ProcessMessageLoadDll &message) override;
+ virtual void OnUnloadDll(const ProcessMessageUnloadDll &message) override;
+ virtual void OnDebugString(const ProcessMessageDebugString &message) override;
+ virtual void OnDebuggerError(const ProcessMessageDebuggerError &message) override;
static DebugDriverThread *m_instance;
std::map<lldb::pid_t, std::shared_ptr<DebugOneProcessThread>> m_debugged_processes;
- HANDLE m_monitor_event;
+ HANDLE m_driver_message_event;
HANDLE m_shutdown_event;
- HANDLE m_monitor_pipe_read;
- HANDLE m_monitor_pipe_write;
- lldb_private::HostThread m_monitor_thread;
+ HANDLE m_driver_pipe_read;
+ HANDLE m_driver_pipe_write;
+ lldb_private::HostThread m_driver_thread;
- static lldb::thread_result_t MonitorThread(void *data);
+ static lldb::thread_result_t DriverThread(void *data);
};
}
Removed: lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.cpp?rev=221321&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.cpp (removed)
@@ -1,55 +0,0 @@
-//===-- DebugMonitorMessageResults.cpp --------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "DebugMonitorMessageResults.h"
-#include "DebugMonitorMessages.h"
-
-#include "lldb/Core/Error.h"
-#include "lldb/Host/HostProcess.h"
-#include "lldb/Target/ProcessLaunchInfo.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-DebugMonitorMessageResult::DebugMonitorMessageResult(const DebugMonitorMessage *message)
- : m_message(message)
-{
- Retain();
- if (m_message)
- m_message->Retain();
-}
-
-DebugMonitorMessageResult::~DebugMonitorMessageResult()
-{
- if (m_message)
- m_message->Release();
-}
-
-void
-DebugMonitorMessageResult::SetError(const Error &error)
-{
- m_error = error;
-}
-
-LaunchProcessMessageResult::LaunchProcessMessageResult(const LaunchProcessMessage *message)
- : DebugMonitorMessageResult(message)
-{
-}
-
-LaunchProcessMessageResult *
-LaunchProcessMessageResult::Create(const LaunchProcessMessage *message)
-{
- return new LaunchProcessMessageResult(message);
-}
-
-void
-LaunchProcessMessageResult::SetProcess(const HostProcess &process)
-{
- m_process = process;
-}
Removed: lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.h?rev=221321&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.h (original)
+++ lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.h (removed)
@@ -1,70 +0,0 @@
-//===-- DebugMonitorMessages.h ----------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_Plugins_Process_Windows_DebugMonitorMessageResults_H_
-#define liblldb_Plugins_Process_Windows_DebugMonitorMessageResults_H_
-
-#include "lldb/Core/Error.h"
-#include "lldb/Host/HostProcess.h"
-
-#include "llvm/ADT/IntrusiveRefCntPtr.h"
-
-namespace lldb_private
-{
-
-class DebugMonitorMessage;
-class DebugMonitorMessageResult;
-class LaunchProcessMessage;
-
-class DebugMonitorMessageResult : public llvm::ThreadSafeRefCountedBase<DebugMonitorMessageResult>
-{
- public:
- virtual ~DebugMonitorMessageResult();
-
- const Error &
- GetError() const
- {
- return m_error;
- }
- const DebugMonitorMessage *
- GetOriginalMessage() const
- {
- return m_message;
- }
-
- void SetError(const Error &error);
-
- protected:
- explicit DebugMonitorMessageResult(const DebugMonitorMessage *message);
-
- private:
- Error m_error;
- const DebugMonitorMessage *m_message;
-};
-
-class LaunchProcessMessageResult : public DebugMonitorMessageResult
-{
- public:
- static LaunchProcessMessageResult *Create(const LaunchProcessMessage *message);
-
- void SetProcess(const HostProcess &process);
- const HostProcess &
- GetProcess() const
- {
- return m_process;
- }
-
- private:
- LaunchProcessMessageResult(const LaunchProcessMessage *message);
-
- HostProcess m_process;
-};
-}
-
-#endif
Removed: lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.cpp?rev=221321&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.cpp (removed)
@@ -1,62 +0,0 @@
-//===-- DebugMonitorMessages.cpp --------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "DebugMonitorMessages.h"
-#include "DebugMonitorMessageResults.h"
-
-#include "lldb/Core/Error.h"
-#include "lldb/Host/HostProcess.h"
-#include "lldb/Target/ProcessLaunchInfo.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-DebugMonitorMessage::DebugMonitorMessage(MonitorMessageType message_type)
- : m_message_type(message_type)
-{
- Retain();
- m_completion_predicate.SetValue(nullptr, eBroadcastNever);
-}
-
-DebugMonitorMessage::~DebugMonitorMessage()
-{
- const DebugMonitorMessageResult *result = m_completion_predicate.GetValue();
- if (result)
- result->Release();
- m_completion_predicate.SetValue(nullptr, eBroadcastNever);
-}
-
-const DebugMonitorMessageResult *
-DebugMonitorMessage::WaitForCompletion()
-{
- const DebugMonitorMessageResult *result = nullptr;
- m_completion_predicate.WaitForValueNotEqualTo(nullptr, result);
- return result;
-}
-
-void
-DebugMonitorMessage::CompleteMessage(const DebugMonitorMessageResult *result)
-{
- if (result)
- result->Retain();
- m_completion_predicate.SetValue(result, eBroadcastAlways);
-}
-
-LaunchProcessMessage::LaunchProcessMessage(const ProcessLaunchInfo &launch_info, lldb::ProcessSP process_plugin)
- : DebugMonitorMessage(MonitorMessageType::eLaunchProcess)
- , m_launch_info(launch_info)
- , m_process_plugin(process_plugin)
-{
-}
-
-LaunchProcessMessage *
-LaunchProcessMessage::Create(const ProcessLaunchInfo &launch_info, lldb::ProcessSP process_plugin)
-{
- return new LaunchProcessMessage(launch_info, process_plugin);
-}
Removed: lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.h?rev=221321&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.h (original)
+++ lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.h (removed)
@@ -1,86 +0,0 @@
-//===-- DebugMonitorMessages.h ----------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_Plugins_Process_Windows_DebugMonitorMessages_H_
-#define liblldb_Plugins_Process_Windows_DebugMonitorMessages_H_
-
-#include "lldb/Host/Predicate.h"
-#include "lldb/Host/HostThread.h"
-#include "lldb/Host/windows/windows.h"
-#include "lldb/lldb-types.h"
-
-#include "llvm/ADT/IntrusiveRefCntPtr.h"
-
-#include <map>
-#include <memory>
-
-class ProcessWindows;
-
-namespace lldb_private
-{
-class DebugMonitorMessage;
-class DebugMonitorMessageResult;
-class ProcessLaunchInfo;
-
-enum class MonitorMessageType
-{
- eLaunchProcess, // Launch a process under the control of the debugger.
- eAttachProcess, // Attach to an existing process, and give control to the debugger.
- eDetachProcess, // Detach from a process that the debugger currently controls.
- eSuspendProcess, // Suspend a process.
- eResumeProcess, // Resume a suspended process.
-};
-
-class DebugMonitorMessage : public llvm::ThreadSafeRefCountedBase<DebugMonitorMessage>
-{
- public:
- virtual ~DebugMonitorMessage();
-
- const DebugMonitorMessageResult *WaitForCompletion();
- void CompleteMessage(const DebugMonitorMessageResult *result);
-
- MonitorMessageType
- GetMessageType() const
- {
- return m_message_type;
- }
-
- protected:
- explicit DebugMonitorMessage(MonitorMessageType message_type);
-
- private:
- Predicate<const DebugMonitorMessageResult *> m_completion_predicate;
- MonitorMessageType m_message_type;
-};
-
-class LaunchProcessMessage : public DebugMonitorMessage
-{
- public:
- static LaunchProcessMessage *Create(const ProcessLaunchInfo &launch_info, lldb::ProcessSP m_process_plugin);
- const ProcessLaunchInfo &
- GetLaunchInfo() const
- {
- return m_launch_info;
- }
-
- lldb::ProcessSP
- GetProcessPlugin() const
- {
- return m_process_plugin;
- }
-
- private:
- LaunchProcessMessage(const ProcessLaunchInfo &launch_info, lldb::ProcessSP m_process_plugin);
-
- const ProcessLaunchInfo &m_launch_info;
- lldb::ProcessSP m_process_plugin;
-};
-}
-
-#endif
Modified: lldb/trunk/source/Plugins/Process/Windows/DebugOneProcessThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DebugOneProcessThread.cpp?rev=221322&r1=221321&r2=221322&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DebugOneProcessThread.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Windows/DebugOneProcessThread.cpp Tue Nov 4 18:33:28 2014
@@ -9,9 +9,9 @@
#include "DebugDriverThread.h"
#include "DebugOneProcessThread.h"
-#include "DebugMonitorMessages.h"
-#include "DebugMonitorMessageResults.h"
-#include "SlaveMessages.h"
+#include "DriverMessages.h"
+#include "DriverMessageResults.h"
+#include "ProcessMessages.h"
#include "lldb/Core/Error.h"
#include "lldb/Core/Log.h"
@@ -31,7 +31,7 @@ namespace
struct DebugLaunchContext
{
DebugOneProcessThread *instance;
- const LaunchProcessMessage *launch;
+ const DriverLaunchProcessMessage *launch;
};
}
@@ -45,11 +45,11 @@ DebugOneProcessThread::~DebugOneProcessT
{
}
-const LaunchProcessMessageResult *
-DebugOneProcessThread::DebugLaunch(const LaunchProcessMessage *message)
+const DriverLaunchProcessMessageResult *
+DebugOneProcessThread::DebugLaunch(const DriverLaunchProcessMessage *message)
{
Error error;
- const LaunchProcessMessageResult *result = nullptr;
+ const DriverLaunchProcessMessageResult *result = nullptr;
DebugLaunchContext context;
context.instance = this;
context.launch = message;
@@ -70,7 +70,7 @@ DebugOneProcessThread::DebugLaunchThread
}
lldb::thread_result_t
-DebugOneProcessThread::DebugLaunchThread(const LaunchProcessMessage *message)
+DebugOneProcessThread::DebugLaunchThread(const DriverLaunchProcessMessage *message)
{
// Grab a shared_ptr reference to this so that we know it won't get deleted until after the
// thread routine has exited.
@@ -89,14 +89,14 @@ DebugOneProcessThread::DebugLaunchThread
name_stream.flush();
ThisThread::SetName(thread_name.c_str());
- LaunchProcessMessageResult *result = LaunchProcessMessageResult::Create(message);
+ DriverLaunchProcessMessageResult *result = DriverLaunchProcessMessageResult::Create(message);
result->SetError(error);
result->SetProcess(m_process);
m_launch_predicate.SetValue(result, eBroadcastAlways);
DebugLoop();
if (log)
- log->Printf("Debug monitor thread '%s' exiting.", thread_name.c_str());
+ log->Printf("Debug slave thread '%s' exiting.", thread_name.c_str());
return 0;
}
@@ -175,7 +175,7 @@ DWORD
DebugOneProcessThread::HandleExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO &info, DWORD thread_id)
{
HANDLE driver = m_driver_thread.GetNativeThread().GetSystemHandle();
- SlaveMessageProcessExited *message = new SlaveMessageProcessExited(m_process, info.dwExitCode);
+ ProcessMessageExitProcess *message = new ProcessMessageExitProcess(m_process, info.dwExitCode);
QueueUserAPC(NotifySlaveProcessExited, driver, reinterpret_cast<ULONG_PTR>(message));
return DBG_CONTINUE;
@@ -204,7 +204,7 @@ DebugOneProcessThread::HandleRipEvent(co
{
HANDLE driver = m_driver_thread.GetNativeThread().GetSystemHandle();
Error error(info.dwError, eErrorTypeWin32);
- SlaveMessageRipEvent *message = new SlaveMessageRipEvent(m_process, error, info.dwType);
+ ProcessMessageDebuggerError *message = new ProcessMessageDebuggerError(m_process, error, info.dwType);
QueueUserAPC(NotifySlaveRipEvent, driver, reinterpret_cast<ULONG_PTR>(message));
return DBG_CONTINUE;
@@ -213,15 +213,15 @@ DebugOneProcessThread::HandleRipEvent(co
void
DebugOneProcessThread::NotifySlaveProcessExited(ULONG_PTR message)
{
- SlaveMessageProcessExited *slave_message = reinterpret_cast<SlaveMessageProcessExited *>(message);
- DebugDriverThread::GetInstance().HandleSlaveEvent(*slave_message);
+ ProcessMessageExitProcess *slave_message = reinterpret_cast<ProcessMessageExitProcess *>(message);
+ DebugDriverThread::GetInstance().OnExitProcess(*slave_message);
delete slave_message;
}
void
DebugOneProcessThread::NotifySlaveRipEvent(ULONG_PTR message)
{
- SlaveMessageRipEvent *slave_message = reinterpret_cast<SlaveMessageRipEvent *>(message);
- DebugDriverThread::GetInstance().HandleSlaveEvent(*slave_message);
+ ProcessMessageDebuggerError *slave_message = reinterpret_cast<ProcessMessageDebuggerError *>(message);
+ DebugDriverThread::GetInstance().OnDebuggerError(*slave_message);
delete slave_message;
}
Modified: lldb/trunk/source/Plugins/Process/Windows/DebugOneProcessThread.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DebugOneProcessThread.h?rev=221322&r1=221321&r2=221322&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DebugOneProcessThread.h (original)
+++ lldb/trunk/source/Plugins/Process/Windows/DebugOneProcessThread.h Tue Nov 4 18:33:28 2014
@@ -17,8 +17,8 @@
namespace lldb_private
{
-class LaunchProcessMessage;
-class LaunchProcessMessageResult;
+class DriverLaunchProcessMessage;
+class DriverLaunchProcessMessageResult;
//----------------------------------------------------------------------
// DebugOneProcessThread
@@ -32,7 +32,7 @@ class DebugOneProcessThread : public std
DebugOneProcessThread(HostThread driver_thread);
virtual ~DebugOneProcessThread();
- const LaunchProcessMessageResult *DebugLaunch(const LaunchProcessMessage *message);
+ const DriverLaunchProcessMessageResult *DebugLaunch(const DriverLaunchProcessMessage *message);
private:
void DebugLoop();
@@ -51,12 +51,12 @@ class DebugOneProcessThread : public std
// The main debug driver thread which is controlling this slave.
lldb_private::HostThread m_driver_thread;
- Predicate<const LaunchProcessMessageResult *> m_launch_predicate;
+ Predicate<const DriverLaunchProcessMessageResult *> m_launch_predicate;
lldb::ProcessSP m_process_plugin;
HostProcess m_process;
static lldb::thread_result_t DebugLaunchThread(void *data);
- lldb::thread_result_t DebugLaunchThread(const LaunchProcessMessage *message);
+ lldb::thread_result_t DebugLaunchThread(const DriverLaunchProcessMessage *message);
};
}
Modified: lldb/trunk/source/Plugins/Process/Windows/DebugProcessLauncher.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DebugProcessLauncher.cpp?rev=221322&r1=221321&r2=221322&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DebugProcessLauncher.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Windows/DebugProcessLauncher.cpp Tue Nov 4 18:33:28 2014
@@ -8,8 +8,8 @@
//===----------------------------------------------------------------------===//
#include "DebugDriverThread.h"
-#include "DebugMonitorMessages.h"
-#include "DebugMonitorMessageResults.h"
+#include "DriverMessages.h"
+#include "DriverMessageResults.h"
#include "DebugProcessLauncher.h"
#include "lldb/Core/Error.h"
@@ -27,9 +27,9 @@ DebugProcessLauncher::DebugProcessLaunch
HostProcess
DebugProcessLauncher::LaunchProcess(const ProcessLaunchInfo &launch_info, Error &error)
{
- LaunchProcessMessage *message = LaunchProcessMessage::Create(launch_info, m_process_plugin);
+ DriverLaunchProcessMessage *message = DriverLaunchProcessMessage::Create(launch_info, m_process_plugin);
DebugDriverThread::GetInstance().PostDebugMessage(message);
- const LaunchProcessMessageResult *result = static_cast<const LaunchProcessMessageResult *>(message->WaitForCompletion());
+ const DriverLaunchProcessMessageResult *result = static_cast<const DriverLaunchProcessMessageResult *>(message->WaitForCompletion());
error = result->GetError();
HostProcess process = result->GetProcess();
Added: lldb/trunk/source/Plugins/Process/Windows/DriverMessageResults.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DriverMessageResults.cpp?rev=221322&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DriverMessageResults.cpp (added)
+++ lldb/trunk/source/Plugins/Process/Windows/DriverMessageResults.cpp Tue Nov 4 18:33:28 2014
@@ -0,0 +1,55 @@
+//===-- DriverMessageResults.cpp --------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "DriverMessageResults.h"
+#include "DriverMessages.h"
+
+#include "lldb/Core/Error.h"
+#include "lldb/Host/HostProcess.h"
+#include "lldb/Target/ProcessLaunchInfo.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+DriverMessageResult::DriverMessageResult(const DriverMessage *message)
+ : m_message(message)
+{
+ Retain();
+ if (m_message)
+ m_message->Retain();
+}
+
+DriverMessageResult::~DriverMessageResult()
+{
+ if (m_message)
+ m_message->Release();
+}
+
+void
+DriverMessageResult::SetError(const Error &error)
+{
+ m_error = error;
+}
+
+DriverLaunchProcessMessageResult::DriverLaunchProcessMessageResult(const DriverLaunchProcessMessage *message)
+ : DriverMessageResult(message)
+{
+}
+
+DriverLaunchProcessMessageResult *
+DriverLaunchProcessMessageResult::Create(const DriverLaunchProcessMessage *message)
+{
+ return new DriverLaunchProcessMessageResult(message);
+}
+
+void
+DriverLaunchProcessMessageResult::SetProcess(const HostProcess &process)
+{
+ m_process = process;
+}
Copied: lldb/trunk/source/Plugins/Process/Windows/DriverMessageResults.h (from r221241, lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DriverMessageResults.h?p2=lldb/trunk/source/Plugins/Process/Windows/DriverMessageResults.h&p1=lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.h&r1=221241&r2=221322&rev=221322&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessageResults.h (original)
+++ lldb/trunk/source/Plugins/Process/Windows/DriverMessageResults.h Tue Nov 4 18:33:28 2014
@@ -1,4 +1,4 @@
-//===-- DebugMonitorMessages.h ----------------------------------*- C++ -*-===//
+//===-- DriverMessageResults.h ----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_Plugins_Process_Windows_DebugMonitorMessageResults_H_
-#define liblldb_Plugins_Process_Windows_DebugMonitorMessageResults_H_
+#ifndef liblldb_Plugins_Process_Windows_DriverMessageResults_H_
+#define liblldb_Plugins_Process_Windows_DriverMessageResults_H_
#include "lldb/Core/Error.h"
#include "lldb/Host/HostProcess.h"
@@ -18,21 +18,21 @@
namespace lldb_private
{
-class DebugMonitorMessage;
-class DebugMonitorMessageResult;
-class LaunchProcessMessage;
+class DriverMessage;
+class DriverMessageResult;
+class DriverLaunchProcessMessage;
-class DebugMonitorMessageResult : public llvm::ThreadSafeRefCountedBase<DebugMonitorMessageResult>
+class DriverMessageResult : public llvm::ThreadSafeRefCountedBase<DriverMessageResult>
{
public:
- virtual ~DebugMonitorMessageResult();
+ virtual ~DriverMessageResult();
const Error &
GetError() const
{
return m_error;
}
- const DebugMonitorMessage *
+ const DriverMessage *
GetOriginalMessage() const
{
return m_message;
@@ -41,17 +41,17 @@ class DebugMonitorMessageResult : public
void SetError(const Error &error);
protected:
- explicit DebugMonitorMessageResult(const DebugMonitorMessage *message);
+ explicit DriverMessageResult(const DriverMessage *message);
private:
Error m_error;
- const DebugMonitorMessage *m_message;
+ const DriverMessage *m_message;
};
-class LaunchProcessMessageResult : public DebugMonitorMessageResult
+class DriverLaunchProcessMessageResult : public DriverMessageResult
{
public:
- static LaunchProcessMessageResult *Create(const LaunchProcessMessage *message);
+ static DriverLaunchProcessMessageResult *Create(const DriverLaunchProcessMessage *message);
void SetProcess(const HostProcess &process);
const HostProcess &
@@ -61,7 +61,7 @@ class LaunchProcessMessageResult : publi
}
private:
- LaunchProcessMessageResult(const LaunchProcessMessage *message);
+ DriverLaunchProcessMessageResult(const DriverLaunchProcessMessage *message);
HostProcess m_process;
};
Copied: lldb/trunk/source/Plugins/Process/Windows/DriverMessages.cpp (from r221241, lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.cpp)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DriverMessages.cpp?p2=lldb/trunk/source/Plugins/Process/Windows/DriverMessages.cpp&p1=lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.cpp&r1=221241&r2=221322&rev=221322&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Windows/DriverMessages.cpp Tue Nov 4 18:33:28 2014
@@ -1,4 +1,4 @@
-//===-- DebugMonitorMessages.cpp --------------------------------*- C++ -*-===//
+//===-- DriverMessages.cpp --------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#include "DebugMonitorMessages.h"
-#include "DebugMonitorMessageResults.h"
+#include "DriverMessages.h"
+#include "DriverMessageResults.h"
#include "lldb/Core/Error.h"
#include "lldb/Host/HostProcess.h"
@@ -17,46 +17,46 @@
using namespace lldb;
using namespace lldb_private;
-DebugMonitorMessage::DebugMonitorMessage(MonitorMessageType message_type)
+DriverMessage::DriverMessage(DriverMessageType message_type)
: m_message_type(message_type)
{
Retain();
m_completion_predicate.SetValue(nullptr, eBroadcastNever);
}
-DebugMonitorMessage::~DebugMonitorMessage()
+DriverMessage::~DriverMessage()
{
- const DebugMonitorMessageResult *result = m_completion_predicate.GetValue();
+ const DriverMessageResult *result = m_completion_predicate.GetValue();
if (result)
result->Release();
m_completion_predicate.SetValue(nullptr, eBroadcastNever);
}
-const DebugMonitorMessageResult *
-DebugMonitorMessage::WaitForCompletion()
+const DriverMessageResult *
+DriverMessage::WaitForCompletion()
{
- const DebugMonitorMessageResult *result = nullptr;
+ const DriverMessageResult *result = nullptr;
m_completion_predicate.WaitForValueNotEqualTo(nullptr, result);
return result;
}
void
-DebugMonitorMessage::CompleteMessage(const DebugMonitorMessageResult *result)
+DriverMessage::CompleteMessage(const DriverMessageResult *result)
{
if (result)
result->Retain();
m_completion_predicate.SetValue(result, eBroadcastAlways);
}
-LaunchProcessMessage::LaunchProcessMessage(const ProcessLaunchInfo &launch_info, lldb::ProcessSP process_plugin)
- : DebugMonitorMessage(MonitorMessageType::eLaunchProcess)
+DriverLaunchProcessMessage::DriverLaunchProcessMessage(const ProcessLaunchInfo &launch_info, lldb::ProcessSP process_plugin)
+ : DriverMessage(DriverMessageType::eLaunchProcess)
, m_launch_info(launch_info)
, m_process_plugin(process_plugin)
{
}
-LaunchProcessMessage *
-LaunchProcessMessage::Create(const ProcessLaunchInfo &launch_info, lldb::ProcessSP process_plugin)
+DriverLaunchProcessMessage *
+DriverLaunchProcessMessage::Create(const ProcessLaunchInfo &launch_info, lldb::ProcessSP process_plugin)
{
- return new LaunchProcessMessage(launch_info, process_plugin);
+ return new DriverLaunchProcessMessage(launch_info, process_plugin);
}
Copied: lldb/trunk/source/Plugins/Process/Windows/DriverMessages.h (from r221241, lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/DriverMessages.h?p2=lldb/trunk/source/Plugins/Process/Windows/DriverMessages.h&p1=lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.h&r1=221241&r2=221322&rev=221322&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/DebugMonitorMessages.h (original)
+++ lldb/trunk/source/Plugins/Process/Windows/DriverMessages.h Tue Nov 4 18:33:28 2014
@@ -1,4 +1,4 @@
-//===-- DebugMonitorMessages.h ----------------------------------*- C++ -*-===//
+//===-- DriverMessages.h ----------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_Plugins_Process_Windows_DebugMonitorMessages_H_
-#define liblldb_Plugins_Process_Windows_DebugMonitorMessages_H_
+#ifndef liblldb_Plugins_Process_Windows_DriverMessages_H_
+#define liblldb_Plugins_Process_Windows_DriverMessages_H_
#include "lldb/Host/Predicate.h"
#include "lldb/Host/HostThread.h"
@@ -24,11 +24,11 @@ class ProcessWindows;
namespace lldb_private
{
-class DebugMonitorMessage;
-class DebugMonitorMessageResult;
+class DriverMessage;
+class DriverMessageResult;
class ProcessLaunchInfo;
-enum class MonitorMessageType
+enum class DriverMessageType
{
eLaunchProcess, // Launch a process under the control of the debugger.
eAttachProcess, // Attach to an existing process, and give control to the debugger.
@@ -37,32 +37,33 @@ enum class MonitorMessageType
eResumeProcess, // Resume a suspended process.
};
-class DebugMonitorMessage : public llvm::ThreadSafeRefCountedBase<DebugMonitorMessage>
+class DriverMessage : public llvm::ThreadSafeRefCountedBase<DriverMessage>
{
public:
- virtual ~DebugMonitorMessage();
+ virtual ~DriverMessage();
- const DebugMonitorMessageResult *WaitForCompletion();
- void CompleteMessage(const DebugMonitorMessageResult *result);
+ const DriverMessageResult *WaitForCompletion();
+ void CompleteMessage(const DriverMessageResult *result);
- MonitorMessageType
+ DriverMessageType
GetMessageType() const
{
return m_message_type;
}
protected:
- explicit DebugMonitorMessage(MonitorMessageType message_type);
+ explicit DriverMessage(DriverMessageType message_type);
private:
- Predicate<const DebugMonitorMessageResult *> m_completion_predicate;
- MonitorMessageType m_message_type;
+ Predicate<const DriverMessageResult *> m_completion_predicate;
+ DriverMessageType m_message_type;
};
-class LaunchProcessMessage : public DebugMonitorMessage
+class DriverLaunchProcessMessage : public DriverMessage
{
public:
- static LaunchProcessMessage *Create(const ProcessLaunchInfo &launch_info, lldb::ProcessSP m_process_plugin);
+ static DriverLaunchProcessMessage *Create(const ProcessLaunchInfo &launch_info, lldb::ProcessSP m_process_plugin);
+
const ProcessLaunchInfo &
GetLaunchInfo() const
{
@@ -76,7 +77,7 @@ class LaunchProcessMessage : public Debu
}
private:
- LaunchProcessMessage(const ProcessLaunchInfo &launch_info, lldb::ProcessSP m_process_plugin);
+ DriverLaunchProcessMessage(const ProcessLaunchInfo &launch_info, lldb::ProcessSP m_process_plugin);
const ProcessLaunchInfo &m_launch_info;
lldb::ProcessSP m_process_plugin;
Added: lldb/trunk/source/Plugins/Process/Windows/IDebugEventHandler.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/IDebugEventHandler.h?rev=221322&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/IDebugEventHandler.h (added)
+++ lldb/trunk/source/Plugins/Process/Windows/IDebugEventHandler.h Tue Nov 4 18:33:28 2014
@@ -0,0 +1,51 @@
+//===-- IDebugEventHandler.h ------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_Plugins_Process_Windows_IDebugEventHandler_H_
+#define liblldb_Plugins_Process_Windows_IDebugEventHandler_H_
+
+namespace lldb_private
+{
+
+class ProcessMessageCreateProcess;
+class ProcessMessageExitProcess;
+class ProcessMessageDebuggerConnected;
+class ProcessMessageException;
+class ProcessMessageCreateThread;
+class ProcessMessageExitThread;
+class ProcessMessageLoadDll;
+class ProcessMessageUnloadDll;
+class ProcessMessageDebugString;
+class ProcessMessageDebuggerError;
+
+//----------------------------------------------------------------------
+// IDebugEventHandler
+//
+// IDebugEventHandler defines an interface which allows implementors to receive
+// notification of events that happen in a debugged process.
+//----------------------------------------------------------------------
+class IDebugEventHandler
+{
+ public:
+ virtual ~IDebugEventHandler() {}
+
+ virtual void OnProcessLaunched(const ProcessMessageCreateProcess &message) = 0;
+ virtual void OnExitProcess(const ProcessMessageExitProcess &message) = 0;
+ virtual void OnDebuggerConnected(const ProcessMessageDebuggerConnected &message) = 0;
+ virtual void OnDebugException(const ProcessMessageException &message) = 0;
+ virtual void OnCreateThread(const ProcessMessageCreateThread &message) = 0;
+ virtual void OnExitThread(const ProcessMessageExitThread &message) = 0;
+ virtual void OnLoadDll(const ProcessMessageLoadDll &message) = 0;
+ virtual void OnUnloadDll(const ProcessMessageUnloadDll &message) = 0;
+ virtual void OnDebugString(const ProcessMessageDebugString &message) = 0;
+ virtual void OnDebuggerError(const ProcessMessageDebuggerError &message) = 0;
+};
+}
+
+#endif
Copied: lldb/trunk/source/Plugins/Process/Windows/ProcessMessages.h (from r221241, lldb/trunk/source/Plugins/Process/Windows/SlaveMessages.h)
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/ProcessMessages.h?p2=lldb/trunk/source/Plugins/Process/Windows/ProcessMessages.h&p1=lldb/trunk/source/Plugins/Process/Windows/SlaveMessages.h&r1=221241&r2=221322&rev=221322&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/SlaveMessages.h (original)
+++ lldb/trunk/source/Plugins/Process/Windows/ProcessMessages.h Tue Nov 4 18:33:28 2014
@@ -1,4 +1,4 @@
-//===-- SlaveMessages.h -----------------------------------------*- C++ -*-===//
+//===-- ProcessMessages.h -----------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_Plugins_Process_Windows_SlaveMessages_H_
-#define liblldb_Plugins_Process_Windows_SlaveMessages_H_
+#ifndef liblldb_Plugins_Process_Windows_ProcessMessages_H_
+#define liblldb_Plugins_Process_Windows_ProcessMessages_H_
#include "lldb/Core/Error.h"
#include "lldb/Host/HostProcess.h"
@@ -17,21 +17,20 @@ namespace lldb_private
{
//----------------------------------------------------------------------
-// SlaveMessageBase
+// ProcessMessageBase
//
-// SlaveMessageBase serves as a base class for all messages which debug slaves
-// can send up to the driver thread to notify it of events related to processes
-// which are being debugged.
+// ProcessMessageBase serves as a base class for all messages which represent
+// events that happen in the context of debugging a single process.
//----------------------------------------------------------------------
-class SlaveMessageBase
+class ProcessMessageBase
{
public:
- SlaveMessageBase(const HostProcess &process)
+ ProcessMessageBase(const HostProcess &process)
: m_process(process)
{
}
- virtual ~SlaveMessageBase() {}
+ virtual ~ProcessMessageBase() {}
const HostProcess &
GetProcess() const
@@ -43,11 +42,11 @@ class SlaveMessageBase
HostProcess m_process;
};
-class SlaveMessageProcessExited : public SlaveMessageBase
+class ProcessMessageExitProcess : public ProcessMessageBase
{
public:
- SlaveMessageProcessExited(const HostProcess &process, DWORD exit_code)
- : SlaveMessageBase(process)
+ ProcessMessageExitProcess(const HostProcess &process, DWORD exit_code)
+ : ProcessMessageBase(process)
, m_exit_code(exit_code)
{
}
@@ -59,11 +58,11 @@ class SlaveMessageProcessExited : public
DWORD m_exit_code;
};
-class SlaveMessageRipEvent : public SlaveMessageBase
+class ProcessMessageDebuggerError : public ProcessMessageBase
{
public:
- SlaveMessageRipEvent(const HostProcess &process, const Error &error, DWORD type)
- : SlaveMessageBase(process)
+ ProcessMessageDebuggerError(const HostProcess &process, const Error &error, DWORD type)
+ : ProcessMessageBase(process)
, m_error(error)
, m_type(type)
{
@@ -74,6 +73,7 @@ class SlaveMessageRipEvent : public Slav
{
return m_error;
}
+
DWORD
GetType() const { return m_type; }
Removed: lldb/trunk/source/Plugins/Process/Windows/SlaveMessages.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Windows/SlaveMessages.h?rev=221321&view=auto
==============================================================================
--- lldb/trunk/source/Plugins/Process/Windows/SlaveMessages.h (original)
+++ lldb/trunk/source/Plugins/Process/Windows/SlaveMessages.h (removed)
@@ -1,86 +0,0 @@
-//===-- SlaveMessages.h -----------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_Plugins_Process_Windows_SlaveMessages_H_
-#define liblldb_Plugins_Process_Windows_SlaveMessages_H_
-
-#include "lldb/Core/Error.h"
-#include "lldb/Host/HostProcess.h"
-
-namespace lldb_private
-{
-
-//----------------------------------------------------------------------
-// SlaveMessageBase
-//
-// SlaveMessageBase serves as a base class for all messages which debug slaves
-// can send up to the driver thread to notify it of events related to processes
-// which are being debugged.
-//----------------------------------------------------------------------
-class SlaveMessageBase
-{
- public:
- SlaveMessageBase(const HostProcess &process)
- : m_process(process)
- {
- }
-
- virtual ~SlaveMessageBase() {}
-
- const HostProcess &
- GetProcess() const
- {
- return m_process;
- }
-
- protected:
- HostProcess m_process;
-};
-
-class SlaveMessageProcessExited : public SlaveMessageBase
-{
- public:
- SlaveMessageProcessExited(const HostProcess &process, DWORD exit_code)
- : SlaveMessageBase(process)
- , m_exit_code(exit_code)
- {
- }
-
- DWORD
- GetExitCode() const { return m_exit_code; }
-
- private:
- DWORD m_exit_code;
-};
-
-class SlaveMessageRipEvent : public SlaveMessageBase
-{
- public:
- SlaveMessageRipEvent(const HostProcess &process, const Error &error, DWORD type)
- : SlaveMessageBase(process)
- , m_error(error)
- , m_type(type)
- {
- }
-
- const Error &
- GetError() const
- {
- return m_error;
- }
- DWORD
- GetType() const { return m_type; }
-
- private:
- Error m_error;
- DWORD m_type;
-};
-}
-
-#endif
More information about the lldb-commits
mailing list