1 //===-- ProcessWindowsLive.h ------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_Plugins_Process_Windows_Live_ProcessWindowsLive_H_
11 #define liblldb_Plugins_Process_Windows_Live_ProcessWindowsLive_H_
19 // Other libraries and framework includes
20 #include "ForwardDecl.h"
21 #include "IDebugDelegate.h"
22 #include "lldb/lldb-forward.h"
23 #include "lldb/Core/Error.h"
24 #include "lldb/Host/HostThread.h"
25 #include "lldb/Target/Process.h"
27 #include "llvm/Support/Mutex.h"
29 #include "plugins/Process/Windows/Common/ProcessWindows.h"
33 namespace lldb_private
36 class ProcessWindowsData;
38 class ProcessWindowsLive : public lldb_private::ProcessWindows, public lldb_private::IDebugDelegate
41 //------------------------------------------------------------------
43 //------------------------------------------------------------------
44 static lldb::ProcessSP
45 CreateInstance(lldb::TargetSP target_sp,
46 lldb_private::Listener &listener,
47 const lldb_private::FileSpec *);
55 static lldb_private::ConstString
56 GetPluginNameStatic();
59 GetPluginDescriptionStatic();
61 //------------------------------------------------------------------
62 // Constructors and destructors
63 //------------------------------------------------------------------
64 ProcessWindowsLive(lldb::TargetSP target_sp,
65 lldb_private::Listener &listener);
67 ~ProcessWindowsLive();
69 // lldb_private::Process overrides
70 lldb_private::ConstString GetPluginName() override;
71 uint32_t GetPluginVersion() override;
73 lldb_private::Error EnableBreakpointSite(lldb_private::BreakpointSite *bp_site) override;
74 lldb_private::Error DisableBreakpointSite(lldb_private::BreakpointSite *bp_site) override;
76 lldb_private::Error DoDetach(bool keep_stopped) override;
77 lldb_private::Error DoLaunch(lldb_private::Module *exe_module, lldb_private::ProcessLaunchInfo &launch_info) override;
78 lldb_private::Error DoAttachToProcessWithID(lldb::pid_t pid,
79 const lldb_private::ProcessAttachInfo &attach_info) override;
80 lldb_private::Error DoResume() override;
81 lldb_private::Error DoDestroy() override;
82 lldb_private::Error DoHalt(bool &caused_stop) override;
84 void DidLaunch() override;
85 void DidAttach(lldb_private::ArchSpec &arch_spec) override;
87 void RefreshStateAfterStop() override;
89 bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override;
91 DestroyRequiresHalt() override
95 bool UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &new_thread_list) override;
96 bool IsAlive() override;
98 size_t DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size, lldb_private::Error &error) override;
99 size_t DoWriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size, lldb_private::Error &error) override;
100 lldb_private::Error GetMemoryRegionInfo(lldb::addr_t vm_addr, lldb_private::MemoryRegionInfo &info) override;
102 // IDebugDelegate overrides.
103 void OnExitProcess(uint32_t exit_code) override;
104 void OnDebuggerConnected(lldb::addr_t image_base) override;
105 ExceptionResult OnDebugException(bool first_chance, const lldb_private::ExceptionRecord &record) override;
106 void OnCreateThread(const lldb_private::HostThread &thread) override;
107 void OnExitThread(lldb::tid_t thread_id, uint32_t exit_code) override;
108 void OnLoadDll(const lldb_private::ModuleSpec &module_spec, lldb::addr_t module_addr) override;
109 void OnUnloadDll(lldb::addr_t module_addr) override;
110 void OnDebugString(const std::string &string) override;
111 void OnDebuggerError(const lldb_private::Error &error, uint32_t type) override;
114 lldb_private::Error WaitForDebuggerConnection(lldb_private::DebuggerThreadSP debugger,
115 lldb_private::HostProcess &process);
117 llvm::sys::Mutex m_mutex;
119 // Data for the active debugging session.
120 std::unique_ptr<lldb_private::ProcessWindowsData> m_session_data;
125 #endif // liblldb_Plugins_Process_Windows_Live_ProcessWindowsLive_H_