diff options
author | Greg Clayton <gclayton@apple.com> | 2010-12-17 02:26:24 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-12-17 02:26:24 +0000 |
commit | f028a1fb84235d88c087ecb35288b7b71bd4a798 (patch) | |
tree | 0c24caeb34c28a97b5bc8b5b5011ef41f27bf649 /lldb/source/API/SBThread.cpp | |
parent | f638b26f177ab39201279dcaa57c10993ff70221 (diff) | |
download | bcm5719-llvm-f028a1fb84235d88c087ecb35288b7b71bd4a798.tar.gz bcm5719-llvm-f028a1fb84235d88c087ecb35288b7b71bd4a798.zip |
Added access to set the current stack frame within a thread so any command
line commands can use the current thread/frame.
Fixed an issue with expressions that get sandboxed in an objective C method
where unichar wasn't being passed down.
Added a "static size_t Scalar::GetMaxByteSize();" function in case we need
to know the max supported by size of something within a Scalar object.
llvm-svn: 122027
Diffstat (limited to 'lldb/source/API/SBThread.cpp')
-rw-r--r-- | lldb/source/API/SBThread.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index a2dde2d376c..cb7cfc5d76e 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -606,6 +606,53 @@ SBThread::GetFrameAtIndex (uint32_t idx) return sb_frame; } +lldb::SBFrame +SBThread::GetSelectedFrame () +{ + LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + + SBFrame sb_frame; + if (m_opaque_sp) + sb_frame.SetFrame (m_opaque_sp->GetSelectedFrame ()); + + if (log) + { + SBStream sstr; + sb_frame.GetDescription (sstr); + log->Printf ("SBThread(%p)::GetSelectedFrame () => SBFrame(%p): %s", + m_opaque_sp.get(), sb_frame.get(), sstr.GetData()); + } + + return sb_frame; +} + +lldb::SBFrame +SBThread::SetSelectedFrame (uint32_t idx) +{ + LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); + + SBFrame sb_frame; + if (m_opaque_sp) + { + lldb::StackFrameSP frame_sp (m_opaque_sp->GetStackFrameAtIndex (idx)); + if (frame_sp) + { + m_opaque_sp->SetSelectedFrame (frame_sp.get()); + sb_frame.SetFrame (frame_sp); + } + } + + if (log) + { + SBStream sstr; + sb_frame.GetDescription (sstr); + log->Printf ("SBThread(%p)::SetSelectedFrame (idx=%u) => SBFrame(%p): %s", + m_opaque_sp.get(), idx, sb_frame.get(), sstr.GetData()); + } + return sb_frame; +} + + bool SBThread::operator == (const SBThread &rhs) const { |