summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/UnwindAssembly
diff options
context:
space:
mode:
authorBhushan D. Attarde <Bhushan.Attarde@imgtec.com>2015-03-18 09:21:29 +0000
committerBhushan D. Attarde <Bhushan.Attarde@imgtec.com>2015-03-18 09:21:29 +0000
commit29e5937cd9aff35b701dc866aaff5f35689e8581 (patch)
tree0d1a1010d0cd94ad999a093dc232b48ace03ec29 /lldb/source/Plugins/UnwindAssembly
parent41c56755be44d0de42c7c8d272b128f7fc2a0d87 (diff)
downloadbcm5719-llvm-29e5937cd9aff35b701dc866aaff5f35689e8581.tar.gz
bcm5719-llvm-29e5937cd9aff35b701dc866aaff5f35689e8581.zip
Initial Assembly profiler for mips64
Summary: This is initial implementation of assembly profiler which only scans prologue/epilogue assembly instructions to create CFI instructions. Reviewers: clayborg, jasonmolenda Differential Revision: http://reviews.llvm.org/D7696 llvm-svn: 232619
Diffstat (limited to 'lldb/source/Plugins/UnwindAssembly')
-rw-r--r--lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp30
1 files changed, 29 insertions, 1 deletions
diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
index a560365d2b4..6fa95fcb386 100644
--- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -610,7 +610,6 @@ UnwindAssemblyInstEmulation::WriteRegister (EmulateInstruction *instruction,
case EmulateInstruction::eContextRegisterPlusOffset:
case EmulateInstruction::eContextAdjustPC:
case EmulateInstruction::eContextRegisterStore:
- case EmulateInstruction::eContextRegisterLoad:
case EmulateInstruction::eContextAbsoluteBranchRegister:
case EmulateInstruction::eContextSupervisorCall:
case EmulateInstruction::eContextTableBranchReadMemory:
@@ -634,6 +633,35 @@ UnwindAssemblyInstEmulation::WriteRegister (EmulateInstruction *instruction,
// }
break;
+ case EmulateInstruction::eContextRegisterLoad:
+ {
+ const uint32_t unwind_reg_kind = m_unwind_plan_ptr->GetRegisterKind();
+ const uint32_t reg_num = reg_info->kinds[unwind_reg_kind];
+ if (reg_num != LLDB_INVALID_REGNUM)
+ {
+ m_curr_row->SetRegisterLocationToRegister (reg_num, reg_num, must_replace);
+ m_curr_row_modified = true;
+ m_curr_insn_restored_a_register = true;
+
+ if (reg_info->kinds[eRegisterKindGeneric] == LLDB_REGNUM_GENERIC_RA)
+ {
+ // This load was restoring the return address register,
+ // so this is also how we will unwind the PC...
+ RegisterInfo pc_reg_info;
+ if (instruction->GetRegisterInfo (eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC, pc_reg_info))
+ {
+ uint32_t pc_reg_num = pc_reg_info.kinds[unwind_reg_kind];
+ if (pc_reg_num != LLDB_INVALID_REGNUM)
+ {
+ m_curr_row->SetRegisterLocationToRegister (pc_reg_num, reg_num, must_replace);
+ m_curr_row_modified = true;
+ }
+ }
+ }
+ }
+ }
+ break;
+
case EmulateInstruction::eContextRelativeBranchImmediate:
{
OpenPOWER on IntegriCloud