Add null RegisterContext assertions

This makes these failures slightly more obvious, avoiding the need to
run LLDB under a debugger or rely on a LLDB core.  I encountered these
while bringing up a new OS/arch combination.

llvm-svn: 230236
This commit is contained in:
Ed Maste
2015-02-23 18:12:20 +00:00
parent afe27c7d27
commit ff1b5c4244
2 changed files with 2 additions and 0 deletions

View File

@@ -343,6 +343,7 @@ StackFrameList::GetFramesUpTo(uint32_t end_idx)
m_frames.push_back (unwind_frame_sp);
}
assert(unwind_frame_sp);
SymbolContext unwind_sc = unwind_frame_sp->GetSymbolContext (eSymbolContextBlock | eSymbolContextFunction);
Block *unwind_block = unwind_sc.block;
if (unwind_block)

View File

@@ -156,6 +156,7 @@ ThreadPlan::WillResume (StateType resume_state, bool current_plan)
if (log)
{
RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
assert (reg_ctx);
addr_t pc = reg_ctx->GetPC();
addr_t sp = reg_ctx->GetSP();
addr_t fp = reg_ctx->GetFP();