1 //===-- RegisterCheckpoint.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_RegisterCheckpoint_h_
11 #define liblldb_RegisterCheckpoint_h_
13 #include "lldb/Target/StackID.h"
14 #include "lldb/Utility/UserID.h"
15 #include "lldb/lldb-private.h"
17 namespace lldb_private {
19 // Inherit from UserID in case pushing/popping all register values can be done
20 // using a 64 bit integer that holds a baton/cookie instead of actually having
21 // to read all register values into a buffer
22 class RegisterCheckpoint : public UserID {
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 be
28 // used to store the baton/cookie that refers to the remote saved state.
30 // The register checkpoint wants the raw register bytes, so they must be
31 // read into m_data_sp, or the save/restore checkpoint should fail.
35 RegisterCheckpoint(Reason reason)
36 : UserID(0), m_data_sp(), m_reason(reason) {}
38 ~RegisterCheckpoint() {}
40 lldb::DataBufferSP &GetData() { return m_data_sp; }
42 const lldb::DataBufferSP &GetData() const { return m_data_sp; }
45 lldb::DataBufferSP m_data_sp;
48 // Make RegisterCheckpointSP if you wish to share the data in this class.
49 DISALLOW_COPY_AND_ASSIGN(RegisterCheckpoint);
52 } // namespace lldb_private
54 #endif // liblldb_RegisterCheckpoint_h_