aboutsummaryrefslogtreecommitdiffstats
path: root/source/Target/RegisterContext.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2013-11-06 16:48:53 +0000
committerEd Maste <emaste@FreeBSD.org>2013-11-06 16:48:53 +0000
commitf21a844f60ae6c74fcf1fddca32461acce3c1ee0 (patch)
tree56d79f94966870db1cecd65a7264510a25fd1cba /source/Target/RegisterContext.cpp
parent37d22554be9f5a677dad2a95b7ef22fe59c66a8a (diff)
downloadsrc-f21a844f60ae6c74fcf1fddca32461acce3c1ee0.tar.gz
src-f21a844f60ae6c74fcf1fddca32461acce3c1ee0.zip
Import lldb as of SVN r194122vendor/lldb/lldb-r194122
Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/vendor/lldb/dist/; revision=257752 svn path=/vendor/lldb/lldb-r194122/; revision=257753; tag=vendor/lldb/lldb-r194122
Diffstat (limited to 'source/Target/RegisterContext.cpp')
-rw-r--r--source/Target/RegisterContext.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/Target/RegisterContext.cpp b/source/Target/RegisterContext.cpp
index 0d89db724ab4..3d68ba8706c9 100644
--- a/source/Target/RegisterContext.cpp
+++ b/source/Target/RegisterContext.cpp
@@ -81,6 +81,15 @@ RegisterContext::GetRegisterInfoByName (const char *reg_name, uint32_t start_idx
return NULL;
}
+const RegisterInfo *
+RegisterContext::GetRegisterInfo (uint32_t kind, uint32_t num)
+{
+ const uint32_t reg_num = ConvertRegisterKindToRegisterNumber(kind, num);
+ if (reg_num == LLDB_INVALID_REGNUM)
+ return NULL;
+ return GetRegisterInfoAtIndex (reg_num);
+}
+
const char *
RegisterContext::GetRegisterName (uint32_t reg)
{
@@ -113,6 +122,19 @@ RegisterContext::SetPC(uint64_t pc)
return success;
}
+bool
+RegisterContext::SetPC(Address addr)
+{
+ TargetSP target_sp = m_thread.CalculateTarget();
+ Target *target = target_sp.get();
+
+ lldb::addr_t callAddr = addr.GetCallableLoadAddress (target);
+ if (callAddr == LLDB_INVALID_ADDRESS)
+ return false;
+
+ return SetPC (callAddr);
+}
+
uint64_t
RegisterContext::GetSP(uint64_t fail_value)
{