diff options
author | Adrian McCarthy <amccarth@google.com> | 2015-08-24 16:00:51 +0000 |
---|---|---|
committer | Adrian McCarthy <amccarth@google.com> | 2015-08-24 16:00:51 +0000 |
commit | 27785dd5300825e60d5ff7edf5a2bada85004b58 (patch) | |
tree | c5a03e2890b6331638b2f2a55861bce8dd57e465 /lldb/source/Plugins/Process/Windows/DebuggerThread.h | |
parent | 550dfe79ca8c3a2ec5fbf2e34ad40fe66eb7c09f (diff) | |
download | bcm5719-llvm-27785dd5300825e60d5ff7edf5a2bada85004b58.tar.gz bcm5719-llvm-27785dd5300825e60d5ff7edf5a2bada85004b58.zip |
Reorg code to allow Windows Process Plugins to share some common code.
Differential Revision: http://reviews.llvm.org/D12252
llvm-svn: 245850
Diffstat (limited to 'lldb/source/Plugins/Process/Windows/DebuggerThread.h')
-rw-r--r-- | lldb/source/Plugins/Process/Windows/DebuggerThread.h | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/lldb/source/Plugins/Process/Windows/DebuggerThread.h b/lldb/source/Plugins/Process/Windows/DebuggerThread.h deleted file mode 100644 index 3646d86e5af..00000000000 --- a/lldb/source/Plugins/Process/Windows/DebuggerThread.h +++ /dev/null @@ -1,98 +0,0 @@ -//===-- DebuggerThread.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_DebuggerThread_H_ -#define liblldb_Plugins_Process_Windows_DebuggerThread_H_ - -#include <atomic> -#include <memory> - -#include "ForwardDecl.h" -#include "lldb/Host/HostProcess.h" -#include "lldb/Host/HostThread.h" -#include "lldb/Host/Predicate.h" -#include "lldb/Host/windows/windows.h" - -namespace lldb_private -{ - -//---------------------------------------------------------------------- -// DebuggerThread -// -// Debugs a single process, notifying listeners as appropriate when interesting -// things occur. -//---------------------------------------------------------------------- -class DebuggerThread : public std::enable_shared_from_this<DebuggerThread> -{ - public: - DebuggerThread(DebugDelegateSP debug_delegate); - virtual ~DebuggerThread(); - - Error DebugLaunch(const ProcessLaunchInfo &launch_info); - Error DebugAttach(lldb::pid_t pid, const ProcessAttachInfo &attach_info); - - HostProcess - GetProcess() const - { - return m_process; - } - HostThread - GetMainThread() const - { - return m_main_thread; - } - std::weak_ptr<ExceptionRecord> - GetActiveException() - { - return m_active_exception; - } - - Error StopDebugging(bool terminate); - - void ContinueAsyncException(ExceptionResult result); - - private: - void FreeProcessHandles(); - void DebugLoop(); - ExceptionResult HandleExceptionEvent(const EXCEPTION_DEBUG_INFO &info, DWORD thread_id); - DWORD HandleCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO &info, DWORD thread_id); - DWORD HandleCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO &info, DWORD thread_id); - DWORD HandleExitThreadEvent(const EXIT_THREAD_DEBUG_INFO &info, DWORD thread_id); - DWORD HandleExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO &info, DWORD thread_id); - DWORD HandleLoadDllEvent(const LOAD_DLL_DEBUG_INFO &info, DWORD thread_id); - DWORD HandleUnloadDllEvent(const UNLOAD_DLL_DEBUG_INFO &info, DWORD thread_id); - DWORD HandleODSEvent(const OUTPUT_DEBUG_STRING_INFO &info, DWORD thread_id); - DWORD HandleRipEvent(const RIP_INFO &info, DWORD thread_id); - - DebugDelegateSP m_debug_delegate; - - HostProcess m_process; // The process being debugged. - HostThread m_main_thread; // The main thread of the inferior. - HANDLE m_image_file; // The image file of the process being debugged. - - ExceptionRecordSP m_active_exception; // The current exception waiting to be handled - - Predicate<ExceptionResult> m_exception_pred; // A predicate which gets signalled when an exception - // is finished processing and the debug loop can be - // continued. - - HANDLE m_debugging_ended_event; // An event which gets signalled by the debugger thread when it - // exits the debugger loop and is detached from the inferior. - - std::atomic<DWORD> m_pid_to_detach; // Signals the loop to detach from the process (specified by pid). - bool m_detached; // Indicates we've detached from the inferior process and the debug loop can exit. - - static lldb::thread_result_t DebuggerThreadLaunchRoutine(void *data); - lldb::thread_result_t DebuggerThreadLaunchRoutine(const ProcessLaunchInfo &launch_info); - static lldb::thread_result_t DebuggerThreadAttachRoutine(void *data); - lldb::thread_result_t DebuggerThreadAttachRoutine(lldb::pid_t pid, const ProcessAttachInfo &launch_info); -}; -} - -#endif |