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.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@122027 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBThread.cpp b/source/API/SBThread.cpp
index a2dde2d..cb7cfc5 100644
--- a/source/API/SBThread.cpp
+++ b/source/API/SBThread.cpp
@@ -606,6 +606,53 @@
     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
 {