lldb::SBTarget and lldb::SBProcess are now thread hardened. They both still
contain shared pointers to the lldb_private::Target and lldb_private::Process
objects respectively as we won't want the target or process just going away.

Also cleaned up the lldb::SBModule to remove dangerous pointer accessors.

For any code the public API files, we should always be grabbing shared 
pointers to any objects for the current class, and any other classes prior
to running code with them.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149238 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBSymbolContext.cpp b/source/API/SBSymbolContext.cpp
index 1ec79df..0f7ce8c 100644
--- a/source/API/SBSymbolContext.cpp
+++ b/source/API/SBSymbolContext.cpp
@@ -90,15 +90,19 @@
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
 
     SBModule sb_module;
+    ModuleSP module_sp;
     if (m_opaque_ap.get())
-        sb_module.SetModule(m_opaque_ap->module_sp);
+    {
+        module_sp = m_opaque_ap->module_sp;
+        sb_module.SetSP (module_sp);
+    }
 
     if (log)
     {
         SBStream sstr;
         sb_module.GetDescription (sstr);
         log->Printf ("SBSymbolContext(%p)::GetModule () => SBModule(%p): %s", 
-                     m_opaque_ap.get(), sb_module.get(), sstr.GetData());
+                     m_opaque_ap.get(), module_sp.get(), sstr.GetData());
     }
 
     return sb_module;
@@ -177,7 +181,7 @@
 void
 SBSymbolContext::SetModule (lldb::SBModule module)
 {
-    ref().module_sp = module.get_sp();
+    ref().module_sp = module.GetSP();
 }
 
 void