Deleted Added
full compact
RegisterCheckpoint.h (258884) RegisterCheckpoint.h (314564)
1//===-- RegisterCheckpoint.h ------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_RegisterCheckpoint_h_
11#define liblldb_RegisterCheckpoint_h_
12
1//===-- RegisterCheckpoint.h ------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_RegisterCheckpoint_h_
11#define liblldb_RegisterCheckpoint_h_
12
13#include "lldb/lldb-private.h"
14#include "lldb/Core/UserID.h"
15#include "lldb/Target/StackID.h"
13#include "lldb/Core/UserID.h"
14#include "lldb/Target/StackID.h"
15#include "lldb/lldb-private.h"
16
17namespace lldb_private {
18
16
17namespace lldb_private {
18
19 // Inherit from UserID in case pushing/popping all register values can be
20 // done using a 64 bit integer that holds a baton/cookie instead of actually
21 // having to read all register values into a buffer
22 class RegisterCheckpoint : public UserID
23 {
24 public:
25
26 enum class Reason {
27 // An expression is about to be run on the thread if the protocol that
28 // talks to the debuggee supports checkpointing the registers using a
29 // push/pop then the UserID base class in the RegisterCheckpoint can
30 // be used to store the baton/cookie that refers to the remote saved
31 // state.
32 eExpression,
33 // The register checkpoint wants the raw register bytes, so they must
34 // be read into m_data_sp, or the save/restore checkpoint should fail.
35 eDataBackup
36 };
37
38 RegisterCheckpoint(Reason reason) :
39 UserID(0),
40 m_data_sp (),
41 m_reason(reason)
42 {
43 }
44
45 ~RegisterCheckpoint()
46 {
47 }
48
49 lldb::DataBufferSP &
50 GetData()
51 {
52 return m_data_sp;
53 }
54
55 const lldb::DataBufferSP &
56 GetData() const
57 {
58 return m_data_sp;
59 }
60
61 protected:
62 lldb::DataBufferSP m_data_sp;
63 Reason m_reason;
64
65 // Make RegisterCheckpointSP if you wish to share the data in this class.
66 DISALLOW_COPY_AND_ASSIGN(RegisterCheckpoint);
67 };
68
19// Inherit from UserID in case pushing/popping all register values can be
20// done using a 64 bit integer that holds a baton/cookie instead of actually
21// having to read all register values into a buffer
22class RegisterCheckpoint : public UserID {
23public:
24 enum class Reason {
25 // An expression is about to be run on the thread if the protocol that
26 // talks to the debuggee supports checkpointing the registers using a
27 // push/pop then the UserID base class in the RegisterCheckpoint can
28 // be used to store the baton/cookie that refers to the remote saved
29 // state.
30 eExpression,
31 // The register checkpoint wants the raw register bytes, so they must
32 // be read into m_data_sp, or the save/restore checkpoint should fail.
33 eDataBackup
34 };
35
36 RegisterCheckpoint(Reason reason)
37 : UserID(0), m_data_sp(), m_reason(reason) {}
38
39 ~RegisterCheckpoint() {}
40
41 lldb::DataBufferSP &GetData() { return m_data_sp; }
42
43 const lldb::DataBufferSP &GetData() const { return m_data_sp; }
44
45protected:
46 lldb::DataBufferSP m_data_sp;
47 Reason m_reason;
48
49 // Make RegisterCheckpointSP if you wish to share the data in this class.
50 DISALLOW_COPY_AND_ASSIGN(RegisterCheckpoint);
51};
52
69} // namespace lldb_private
70
53} // namespace lldb_private
54
71#endif // liblldb_RegisterCheckpoint_h_
55#endif // liblldb_RegisterCheckpoint_h_