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
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 {
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
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.
36 RegisterCheckpoint(Reason reason)
37 : UserID(0), m_data_sp(), m_reason(reason) {}
39 ~RegisterCheckpoint() {}
41 lldb::DataBufferSP &GetData() { return m_data_sp; }
43 const lldb::DataBufferSP &GetData() const { return m_data_sp; }
46 lldb::DataBufferSP m_data_sp;
49 // Make RegisterCheckpointSP if you wish to share the data in this class.
50 DISALLOW_COPY_AND_ASSIGN(RegisterCheckpoint);
53 } // namespace lldb_private
55 #endif // liblldb_RegisterCheckpoint_h_