summaryrefslogtreecommitdiffstats
path: root/lldb/tools/debugserver/source/DNB.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2013-11-13 23:28:31 +0000
committerGreg Clayton <gclayton@apple.com>2013-11-13 23:28:31 +0000
commitf74cf86bc55b34e567c760212cb4bdb6158fd225 (patch)
treed6a775d137a7d653858f3df0faaf2367fd4f231e /lldb/tools/debugserver/source/DNB.cpp
parentbcccb5db2e88533941c0c63a8693bb71ca0ac318 (diff)
downloadbcm5719-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/DNB.cpp')
-rw-r--r--lldb/tools/debugserver/source/DNB.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/lldb/tools/debugserver/source/DNB.cpp b/lldb/tools/debugserver/source/DNB.cpp
index dd54c6a7b09..b7feeb3a249 100644
--- a/lldb/tools/debugserver/source/DNB.cpp
+++ b/lldb/tools/debugserver/source/DNB.cpp
@@ -1765,6 +1765,31 @@ DNBThreadSetRegisterContext (nub_process_t pid, nub_thread_t tid, const void *bu
return 0;
}
+uint32_t
+DNBThreadSaveRegisterState (nub_process_t pid, nub_thread_t tid)
+{
+ if (tid != INVALID_NUB_THREAD)
+ {
+ MachProcessSP procSP;
+ if (GetProcessSP (pid, procSP))
+ return procSP->GetThreadList().SaveRegisterState (tid);
+ }
+ return 0;
+}
+nub_bool_t
+DNBThreadRestoreRegisterState (nub_process_t pid, nub_thread_t tid, uint32_t save_id)
+{
+ if (tid != INVALID_NUB_THREAD)
+ {
+ MachProcessSP procSP;
+ if (GetProcessSP (pid, procSP))
+ return procSP->GetThreadList().RestoreRegisterState (tid, save_id);
+ }
+ return false;
+}
+
+
+
//----------------------------------------------------------------------
// Read a register value by name.
//----------------------------------------------------------------------
OpenPOWER on IntegriCloud