blob: 80079c430c01d2e702b87da2ec36b3a39219515d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
//===-- DriverMessages.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_DriverMessages_H_
#define liblldb_Plugins_Process_Windows_DriverMessages_H_
#include "ForwardDecl.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"
namespace lldb_private
{
class ProcessLaunchInfo;
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.
eDetachProcess, // Detach from a process that the debugger currently controls.
eSuspendProcess, // Suspend a process.
eResumeProcess, // Resume a suspended process.
};
class DriverMessage : public llvm::ThreadSafeRefCountedBase<DriverMessage>
{
public:
virtual ~DriverMessage();
const DriverMessageResult *WaitForCompletion();
void CompleteMessage(const DriverMessageResult *result);
DriverMessageType
GetMessageType() const
{
return m_message_type;
}
protected:
explicit DriverMessage(DriverMessageType message_type);
private:
Predicate<const DriverMessageResult *> m_completion_predicate;
DriverMessageType m_message_type;
};
class DriverLaunchProcessMessage : public DriverMessage
{
public:
static DriverLaunchProcessMessage *Create(const ProcessLaunchInfo &launch_info, DebugDelegateSP debug_delegate);
const ProcessLaunchInfo &
GetLaunchInfo() const
{
return m_launch_info;
}
DebugDelegateSP
GetDebugDelegate() const
{
return m_debug_delegate;
}
private:
DriverLaunchProcessMessage(const ProcessLaunchInfo &launch_info, DebugDelegateSP debug_delegate);
const ProcessLaunchInfo &m_launch_info;
DebugDelegateSP m_debug_delegate;
};
}
#endif
|