diff options
author | Jim Ingham <jingham@apple.com> | 2012-09-07 23:35:54 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2012-09-07 23:35:54 +0000 |
commit | 6cd41da75dcdccd3d021fe1a0d5b33f2f9725ed0 (patch) | |
tree | 57d917d07e9fbd25b1ab789ae1c8a9f7a02dd5f5 /lldb/source/Target/StackFrameList.cpp | |
parent | cfa4e9bdf3b2474594bcf8e447f2ead68f458ab9 (diff) | |
download | bcm5719-llvm-6cd41da75dcdccd3d021fe1a0d5b33f2f9725ed0.tar.gz bcm5719-llvm-6cd41da75dcdccd3d021fe1a0d5b33f2f9725ed0.zip |
Add SetCurrentInlinedDepth API.
In GetFramesUpTo, don't adjust the number of frames for the inlined depth if the number of frames in UINT32_MAX.
llvm-svn: 163432
Diffstat (limited to 'lldb/source/Target/StackFrameList.cpp')
-rw-r--r-- | lldb/source/Target/StackFrameList.cpp | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp index ce48c97f6ff..a21502516d1 100644 --- a/lldb/source/Target/StackFrameList.cpp +++ b/lldb/source/Target/StackFrameList.cpp @@ -13,6 +13,7 @@ // C++ Includes // Other libraries and framework includes // Project includes +#include "lldb/Core/Log.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/SourceManager.h" #include "lldb/Symbol/Block.h" @@ -77,13 +78,16 @@ StackFrameList::CalculateCurrentInlinedDepth() uint32_t StackFrameList::GetCurrentInlinedDepth () { - if (m_show_inlined_frames) + if (m_show_inlined_frames && m_current_inlined_pc != LLDB_INVALID_ADDRESS) { lldb::addr_t cur_pc = m_thread.GetRegisterContext()->GetPC(); if (cur_pc != m_current_inlined_pc) { m_current_inlined_pc = LLDB_INVALID_ADDRESS; m_current_inlined_depth = UINT32_MAX; + LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + if (log && log->GetVerbose()) + log->Printf ("GetCurrentInlinedDepth: invalidating current inlined depth.\n"); } return m_current_inlined_depth; } @@ -103,6 +107,9 @@ StackFrameList::ResetCurrentInlinedDepth () { m_current_inlined_depth = UINT32_MAX; m_current_inlined_pc = LLDB_INVALID_ADDRESS; + LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + if (log && log->GetVerbose()) + log->Printf ("ResetCurrentInlinedDepth: Invalidating current inlined depth.\n"); } else { @@ -169,6 +176,9 @@ StackFrameList::ResetCurrentInlinedDepth () } m_current_inlined_pc = curr_pc; m_current_inlined_depth = num_inlined_functions + 1; + LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + if (log && log->GetVerbose()) + log->Printf ("ResetCurrentInlinedDepth: setting inlined depth: %d 0x%llx.\n", m_current_inlined_depth, curr_pc); } break; @@ -200,6 +210,16 @@ StackFrameList::DecrementCurrentInlinedDepth () } void +StackFrameList::SetCurrentInlinedDepth (uint32_t new_depth) +{ + m_current_inlined_depth = new_depth; + if (new_depth == UINT32_MAX) + m_current_inlined_pc = LLDB_INVALID_ADDRESS; + else + m_current_inlined_pc = m_thread.GetRegisterContext()->GetPC(); +} + +void StackFrameList::GetFramesUpTo(uint32_t end_idx) { // We've already gotten more frames than asked for, or we've already finished unwinding, return. @@ -215,10 +235,11 @@ StackFrameList::GetFramesUpTo(uint32_t end_idx) #endif // If we are hiding some frames from the outside world, we need to add those onto the total count of // frames to fetch. However, we don't need ot do that if end_idx is 0 since in that case we always - // get the first concrete frame and all the inlined frames below it... + // get the first concrete frame and all the inlined frames below it... And of course, if end_idx is + // UINT32_MAX that means get all, so just do that... uint32_t inlined_depth = 0; - if (end_idx > 0) + if (end_idx > 0 && end_idx != UINT32_MAX) { inlined_depth = GetCurrentInlinedDepth(); if (inlined_depth != UINT32_MAX) @@ -322,8 +343,9 @@ StackFrameList::GetFramesUpTo(uint32_t end_idx) StackFrameList *prev_frames = m_prev_frames_sp.get(); StackFrameList *curr_frames = this; - curr_frames->m_current_inlined_depth = prev_frames->m_current_inlined_depth; - curr_frames->m_current_inlined_pc = prev_frames->m_current_inlined_pc; + //curr_frames->m_current_inlined_depth = prev_frames->m_current_inlined_depth; + //curr_frames->m_current_inlined_pc = prev_frames->m_current_inlined_pc; + //printf ("GetFramesUpTo: Copying current inlined depth: %d 0x%llx.\n", curr_frames->m_current_inlined_depth, curr_frames->m_current_inlined_pc); #if defined (DEBUG_STACK_FRAMES) s.PutCString("\nprev_frames:\n"); |