[Lldb-commits] [lldb] r129037 - /lldb/trunk/source/Core/EmulateInstruction.cpp
Caroline Tice
ctice at apple.com
Wed Apr 6 16:30:18 PDT 2011
Author: ctice
Date: Wed Apr 6 18:30:18 2011
New Revision: 129037
URL: http://llvm.org/viewvc/llvm-project?rev=129037&view=rev
Log:
Translate dwarf register numbers to internal register numbers
before trying to look them up in register contexts, in the
emulation callback functions that read & write the frame registers.
Modified:
lldb/trunk/source/Core/EmulateInstruction.cpp
Modified: lldb/trunk/source/Core/EmulateInstruction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/EmulateInstruction.cpp?rev=129037&r1=129036&r2=129037&view=diff
==============================================================================
--- lldb/trunk/source/Core/EmulateInstruction.cpp (original)
+++ lldb/trunk/source/Core/EmulateInstruction.cpp Wed Apr 6 18:30:18 2011
@@ -272,8 +272,12 @@
RegisterContext *reg_context = frame->GetRegisterContext().get();
Scalar value;
+ uint32_t internal_reg_num = reg_context->ConvertRegisterKindToRegisterNumber (reg_kind, reg_num);
- if (reg_context->ReadRegisterValue (reg_num, value))
+ if (internal_reg_num == LLDB_INVALID_REGNUM)
+ return false;
+
+ if (reg_context->ReadRegisterValue (internal_reg_num, value))
{
reg_value = value.GetRawBits64 (0);
return true;
@@ -296,7 +300,11 @@
RegisterContext *reg_context = frame->GetRegisterContext().get();
Scalar value (reg_value);
- return reg_context->WriteRegisterValue (reg_num, value);
+ uint32_t internal_reg_num = reg_context->ConvertRegisterKindToRegisterNumber (reg_kind, reg_num);
+ if (internal_reg_num != LLDB_INVALID_REGNUM)
+ return reg_context->WriteRegisterValue (internal_reg_num, value);
+ else
+ return false;
}
size_t
More information about the lldb-commits
mailing list