diff options
author | Greg Clayton <gclayton@apple.com> | 2013-11-13 23:28:31 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-11-13 23:28:31 +0000 |
commit | f74cf86bc55b34e567c760212cb4bdb6158fd225 (patch) | |
tree | d6a775d137a7d653858f3df0faaf2367fd4f231e /lldb/tools/debugserver/source/DNBArch.h | |
parent | bcccb5db2e88533941c0c63a8693bb71ca0ac318 (diff) | |
download | bcm5719-llvm-f74cf86bc55b34e567c760212cb4bdb6158fd225.tar.gz bcm5719-llvm-f74cf86bc55b34e567c760212cb4bdb6158fd225.zip |
<rdar://problem/15172417>
Added two new GDB server packets to debugserver: "QSaveRegisterState" and "QRestoreRegiterState".
"QSaveRegisterState" makes the remote GDB server save all register values and it returns a save identifier as an unsigned integer. This packet can be used prior to running expressions to save all registers.
All registers can them we later restored with "QRestoreRegiterState:SAVEID" what SAVEID is the integer identifier that was returned from the call to QSaveRegisterState.
Cleaned up redundant code in lldb_private::Thread, lldb_private::ThreadPlanCallFunction.
Moved the lldb_private::Thread::RegisterCheckpoint into its own header file and it is now in the lldb_private namespace. Trimmed down the RegisterCheckpoint class to omit stuff that wasn't used (the stack ID).
Added a few new virtual methods to lldb_private::RegisterContext that allow subclasses to efficiently save/restore register states and changed the RegisterContextGDBRemote to take advantage of these new calls.
llvm-svn: 194621
Diffstat (limited to 'lldb/tools/debugserver/source/DNBArch.h')
-rw-r--r-- | lldb/tools/debugserver/source/DNBArch.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lldb/tools/debugserver/source/DNBArch.h b/lldb/tools/debugserver/source/DNBArch.h index 1c5c5b2db6f..e4f6bd2fada 100644 --- a/lldb/tools/debugserver/source/DNBArch.h +++ b/lldb/tools/debugserver/source/DNBArch.h @@ -58,10 +58,22 @@ public: static bool SetArchitecture (uint32_t cpu_type); + DNBArchProtocol () : + m_save_id(0) + { + + } + + virtual ~DNBArchProtocol () + { + + } virtual bool GetRegisterValue (int set, int reg, DNBRegisterValue *value) = 0; virtual bool SetRegisterValue (int set, int reg, const DNBRegisterValue *value) = 0; virtual nub_size_t GetRegisterContext (void *buf, nub_size_t buf_len) = 0; virtual nub_size_t SetRegisterContext (const void *buf, nub_size_t buf_len) = 0; + virtual uint32_t SaveRegisterState () = 0; + virtual bool RestoreRegisterState (uint32_t save_id) = 0; virtual kern_return_t GetRegisterState (int set, bool force) = 0; virtual kern_return_t SetRegisterState (int set) = 0; @@ -85,6 +97,11 @@ public: protected: friend class MachThread; + uint32_t GetNextRegisterStateSaveID () + { + return ++m_save_id; + } + enum { Trans_Pending = 0, // Transaction is pending, and checkpoint state has been snapshotted. @@ -94,6 +111,9 @@ protected: virtual bool StartTransForHWP() { return true; } virtual bool RollbackTransForHWP() { return true; } virtual bool FinishTransForHWP() { return true; } + + uint32_t m_save_id; // An always incrementing integer ID used with SaveRegisterState/RestoreRegisterState + }; |