Added copy constructors and assignment operators to all lldb::SB* classes
so we don't end up with weak exports with some compilers.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@118312 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBBlock.cpp b/source/API/SBBlock.cpp
index 6898a77..32f1021 100644
--- a/source/API/SBBlock.cpp
+++ b/source/API/SBBlock.cpp
@@ -28,6 +28,18 @@
 {
 }
 
+SBBlock::SBBlock(const SBBlock &rhs) :
+    m_opaque_ptr (rhs.m_opaque_ptr)
+{
+}
+
+const SBBlock &
+SBBlock::operator = (const SBBlock &rhs)
+{
+    m_opaque_ptr = rhs.m_opaque_ptr;
+    return *this;
+}
+
 SBBlock::~SBBlock ()
 {
     m_opaque_ptr = NULL;
diff --git a/source/API/SBBreakpointLocation.cpp b/source/API/SBBreakpointLocation.cpp
index cb93624..ab75b4e 100644
--- a/source/API/SBBreakpointLocation.cpp
+++ b/source/API/SBBreakpointLocation.cpp
@@ -25,7 +25,8 @@
 using namespace lldb_private;
 
 
-SBBreakpointLocation::SBBreakpointLocation ()
+SBBreakpointLocation::SBBreakpointLocation () :
+    m_opaque_sp ()
 {
 }
 
@@ -43,6 +44,20 @@
     }
 }
 
+SBBreakpointLocation::SBBreakpointLocation(const SBBreakpointLocation &rhs) :
+    m_opaque_sp (rhs.m_opaque_sp)
+{
+}
+
+const SBBreakpointLocation &
+SBBreakpointLocation::operator = (const SBBreakpointLocation &rhs)
+{
+    if (this != &rhs)
+        m_opaque_sp = rhs.m_opaque_sp;
+    return *this;
+}
+
+
 SBBreakpointLocation::~SBBreakpointLocation ()
 {
 }
diff --git a/source/API/SBBroadcaster.cpp b/source/API/SBBroadcaster.cpp
index 348b710..9978d82 100644
--- a/source/API/SBBroadcaster.cpp
+++ b/source/API/SBBroadcaster.cpp
@@ -20,36 +20,49 @@
 
 
 SBBroadcaster::SBBroadcaster () :
-    m_opaque (NULL),
-    m_opaque_owned (false)
+    m_opaque_sp (),
+    m_opaque_ptr (NULL)
 {
-    Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
-
-    if (log)
-        log->Printf ("SBBroadcastetr::SBBroadcaster () => SBBroadcaster(%p)", this);
 }
 
-
 SBBroadcaster::SBBroadcaster (const char *name) :
-    m_opaque (new Broadcaster (name)),
-    m_opaque_owned (true)
+    m_opaque_sp (new Broadcaster (name)),
+    m_opaque_ptr (NULL)
 {
+    m_opaque_ptr = m_opaque_sp.get();
     Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
 
     if (log)
         log->Printf ("SBBroadcaster::SBBroadcaster (name=\"%s\") => SBBroadcaster(%p)",
-                     name, m_opaque);
+                     name, m_opaque_ptr);
 }
 
 SBBroadcaster::SBBroadcaster (lldb_private::Broadcaster *broadcaster, bool owns) :
-    m_opaque (broadcaster),
-    m_opaque_owned (owns)
+    m_opaque_sp (owns ? broadcaster : NULL),
+    m_opaque_ptr (broadcaster)
 {
     Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
 
     if (log)
-        log->Printf ("SBBroadcaster::SBBroadcaster (broadcaster=%p, bool owns=%i) "
-                     " => SBBroadcaster(%p)", broadcaster, owns, m_opaque);
+        log->Printf ("SBBroadcaster::SBBroadcaster (broadcaster=%p, bool owns=%i) => SBBroadcaster(%p)", 
+                     broadcaster, owns, m_opaque_ptr);
+}
+
+SBBroadcaster::SBBroadcaster (const SBBroadcaster &rhs) :
+    m_opaque_sp (rhs.m_opaque_sp),
+    m_opaque_ptr (rhs.m_opaque_ptr) 
+{
+}
+
+const SBBroadcaster &
+SBBroadcaster::operator = (const SBBroadcaster &rhs)
+{
+    if (this != &rhs)
+    {
+        m_opaque_sp = rhs.m_opaque_sp;
+        m_opaque_ptr = rhs.m_opaque_ptr;
+    }
+    return *this;
 }
 
 SBBroadcaster::~SBBroadcaster()
@@ -63,15 +76,15 @@
     Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
 
     if (log)
-        log->Printf ("SBBroadcaster(%p)::BroadcastEventByType (event_type=0x%8.8x, unique=%i)", m_opaque, event_type, unique);
+        log->Printf ("SBBroadcaster(%p)::BroadcastEventByType (event_type=0x%8.8x, unique=%i)", m_opaque_ptr, event_type, unique);
 
-    if (m_opaque == NULL)
+    if (m_opaque_ptr == NULL)
         return;
 
     if (unique)
-        m_opaque->BroadcastEventIfUnique (event_type);
+        m_opaque_ptr->BroadcastEventIfUnique (event_type);
     else
-        m_opaque->BroadcastEvent (event_type);
+        m_opaque_ptr->BroadcastEvent (event_type);
 }
 
 void
@@ -80,16 +93,16 @@
     Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
 
     if (log)
-        log->Printf ("SBBroadcaster(%p)::BroadcastEventByType (SBEvent(%p), unique=%i)", m_opaque, event.get(), unique);
+        log->Printf ("SBBroadcaster(%p)::BroadcastEventByType (SBEvent(%p), unique=%i)", m_opaque_ptr, event.get(), unique);
 
-    if (m_opaque == NULL)
+    if (m_opaque_ptr == NULL)
         return;
 
     EventSP event_sp = event.GetSP ();
     if (unique)
-        m_opaque->BroadcastEventIfUnique (event_sp);
+        m_opaque_ptr->BroadcastEventIfUnique (event_sp);
     else
-        m_opaque->BroadcastEvent (event_sp);
+        m_opaque_ptr->BroadcastEvent (event_sp);
 }
 
 void
@@ -97,74 +110,75 @@
 {
     Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
     if (log)
-        log->Printf ("SBBroadcaster(%p)::AddInitialEventsToListener (SBListener(%p), event_mask=0x%8.8x)", m_opaque, listener.get(), requested_events);
-    if (m_opaque)
-        m_opaque->AddInitialEventsToListener (listener.get(), requested_events);
+        log->Printf ("SBBroadcaster(%p)::AddInitialEventsToListener (SBListener(%p), event_mask=0x%8.8x)", m_opaque_ptr, listener.get(), requested_events);
+    if (m_opaque_ptr)
+        m_opaque_ptr->AddInitialEventsToListener (listener.get(), requested_events);
 }
 
 uint32_t
 SBBroadcaster::AddListener (const SBListener &listener, uint32_t event_mask)
 {
-    if (m_opaque)
-        return m_opaque->AddListener (listener.get(), event_mask);
+    if (m_opaque_ptr)
+        return m_opaque_ptr->AddListener (listener.get(), event_mask);
     return 0;
 }
 
 const char *
 SBBroadcaster::GetName () const
 {
-    if (m_opaque)
-        return m_opaque->GetBroadcasterName().GetCString();
+    if (m_opaque_ptr)
+        return m_opaque_ptr->GetBroadcasterName().GetCString();
     return NULL;
 }
 
 bool
 SBBroadcaster::EventTypeHasListeners (uint32_t event_type)
 {
-    if (m_opaque)
-        return m_opaque->EventTypeHasListeners (event_type);
+    if (m_opaque_ptr)
+        return m_opaque_ptr->EventTypeHasListeners (event_type);
     return false;
 }
 
 bool
 SBBroadcaster::RemoveListener (const SBListener &listener, uint32_t event_mask)
 {
-    if (m_opaque)
-        return m_opaque->RemoveListener (listener.get(), event_mask);
+    if (m_opaque_ptr)
+        return m_opaque_ptr->RemoveListener (listener.get(), event_mask);
     return false;
 }
 
 Broadcaster *
 SBBroadcaster::get () const
 {
-    return m_opaque;
+    return m_opaque_ptr;
 }
 
 void
 SBBroadcaster::reset (Broadcaster *broadcaster, bool owns)
 {
-    if (m_opaque && m_opaque_owned)
-        delete m_opaque;
-    m_opaque = broadcaster;
-    m_opaque_owned = owns;
+    if (owns)
+        m_opaque_sp.reset (broadcaster);
+    else
+        m_opaque_sp.reset ();
+    m_opaque_ptr = broadcaster;
 }
 
 
 bool
 SBBroadcaster::IsValid () const
 {
-    return m_opaque != NULL;
+    return m_opaque_ptr != NULL;
 }
 
 bool
 SBBroadcaster::operator == (const SBBroadcaster &rhs) const
 {
-    return m_opaque == rhs.m_opaque;
+    return m_opaque_ptr == rhs.m_opaque_ptr;
     
 }
 
 bool
 SBBroadcaster::operator != (const SBBroadcaster &rhs) const
 {
-    return m_opaque != rhs.m_opaque;
+    return m_opaque_ptr != rhs.m_opaque_ptr;
 }
diff --git a/source/API/SBCommandInterpreter.cpp b/source/API/SBCommandInterpreter.cpp
index d5ccd20..3f467f7 100644
--- a/source/API/SBCommandInterpreter.cpp
+++ b/source/API/SBCommandInterpreter.cpp
@@ -40,6 +40,18 @@
                      " => SBCommandInterpreter(%p)", interpreter, m_opaque_ptr);
 }
 
+SBCommandInterpreter::SBCommandInterpreter(const SBCommandInterpreter &rhs) :
+    m_opaque_ptr (rhs.m_opaque_ptr)
+{
+}
+
+const SBCommandInterpreter &
+SBCommandInterpreter::operator = (const SBCommandInterpreter &rhs)
+{
+    m_opaque_ptr = rhs.m_opaque_ptr;
+    return *this;
+}
+
 SBCommandInterpreter::~SBCommandInterpreter ()
 {
 }
diff --git a/source/API/SBCommandReturnObject.cpp b/source/API/SBCommandReturnObject.cpp
index 778ecb0..b9981fb 100644
--- a/source/API/SBCommandReturnObject.cpp
+++ b/source/API/SBCommandReturnObject.cpp
@@ -21,6 +21,27 @@
 {
 }
 
+SBCommandReturnObject::SBCommandReturnObject (const SBCommandReturnObject &rhs):
+    m_opaque_ap ()
+{
+    if (rhs.m_opaque_ap.get())
+        m_opaque_ap.reset (new CommandReturnObject (*rhs.m_opaque_ap));
+}
+
+const SBCommandReturnObject &
+SBCommandReturnObject::operator = (const SBCommandReturnObject &rhs)
+{
+    if (this != &rhs)
+    {
+        if (rhs.m_opaque_ap.get())
+            m_opaque_ap.reset (new CommandReturnObject (*rhs.m_opaque_ap));
+        else
+            m_opaque_ap.reset();
+    }
+    return *this;
+}
+
+
 SBCommandReturnObject::~SBCommandReturnObject ()
 {
     // m_opaque_ap will automatically delete any pointer it owns
diff --git a/source/API/SBCompileUnit.cpp b/source/API/SBCompileUnit.cpp
index 3950507..a103fc3 100644
--- a/source/API/SBCompileUnit.cpp
+++ b/source/API/SBCompileUnit.cpp
@@ -29,6 +29,19 @@
 {
 }
 
+SBCompileUnit::SBCompileUnit(const SBCompileUnit &rhs) :
+    m_opaque_ptr (rhs.m_opaque_ptr)
+{
+}
+
+const SBCompileUnit &
+SBCompileUnit::operator = (const SBCompileUnit &rhs)
+{
+    m_opaque_ptr = rhs.m_opaque_ptr;
+    return *this;
+}
+
+
 SBCompileUnit::~SBCompileUnit ()
 {
     m_opaque_ptr = NULL;
diff --git a/source/API/SBDebugger.cpp b/source/API/SBDebugger.cpp
index cf49d75..b8190b7 100644
--- a/source/API/SBDebugger.cpp
+++ b/source/API/SBDebugger.cpp
@@ -85,6 +85,21 @@
 {
 }
 
+SBDebugger::SBDebugger(const SBDebugger &rhs) :
+    m_opaque_sp (rhs.m_opaque_sp)
+{
+}
+
+SBDebugger &
+SBDebugger::operator = (const SBDebugger &rhs)
+{
+    if (this != &rhs)
+    {
+        m_opaque_sp = rhs.m_opaque_sp;
+    }
+    return *this;
+}
+
 SBDebugger::~SBDebugger ()
 {
 }
@@ -355,7 +370,7 @@
 SBDebugger::GetSourceManager ()
 {
     static SourceManager g_lldb_source_manager;
-    static SBSourceManager g_sb_source_manager (g_lldb_source_manager);
+    static SBSourceManager g_sb_source_manager (&g_lldb_source_manager);
     return g_sb_source_manager;
 }
 
diff --git a/source/API/SBEvent.cpp b/source/API/SBEvent.cpp
index a976c42..9c7a392 100644
--- a/source/API/SBEvent.cpp
+++ b/source/API/SBEvent.cpp
@@ -25,22 +25,40 @@
 
 SBEvent::SBEvent () :
     m_event_sp (),
-    m_opaque (NULL)
+    m_opaque_ptr (NULL)
 {
 }
 
 SBEvent::SBEvent (uint32_t event_type, const char *cstr, uint32_t cstr_len) :
     m_event_sp (new Event (event_type, new EventDataBytes (cstr, cstr_len))),
-    m_opaque (m_event_sp.get())
+    m_opaque_ptr (m_event_sp.get())
 {
 }
 
 SBEvent::SBEvent (EventSP &event_sp) :
     m_event_sp (event_sp),
-    m_opaque (event_sp.get())
+    m_opaque_ptr (event_sp.get())
 {
 }
 
+SBEvent::SBEvent (const SBEvent &rhs) :
+    m_event_sp (rhs.m_event_sp),
+    m_opaque_ptr (rhs.m_opaque_ptr)
+{
+    
+}
+    
+const SBEvent &
+SBEvent::operator = (const SBEvent &rhs)
+{
+    if (this != &rhs)
+    {
+        m_event_sp = rhs.m_event_sp;
+        m_opaque_ptr = rhs.m_opaque_ptr;
+    }
+    return *this;
+}
+
 SBEvent::~SBEvent()
 {
 }
@@ -136,31 +154,31 @@
     // There is a dangerous accessor call GetSharedPtr which can be used, so if
     // we have anything valid in m_event_sp, we must use that since if it gets
     // used by a function that puts something in there, then it won't update
-    // m_opaque...
+    // m_opaque_ptr...
     if (m_event_sp)
-        m_opaque = m_event_sp.get();
+        m_opaque_ptr = m_event_sp.get();
 
-    return m_opaque;
+    return m_opaque_ptr;
 }
 
 void
 SBEvent::reset (EventSP &event_sp)
 {
     m_event_sp = event_sp;
-    m_opaque = m_event_sp.get();
+    m_opaque_ptr = m_event_sp.get();
 }
 
 void
 SBEvent::reset (Event* event_ptr)
 {
-    m_opaque = event_ptr;
+    m_opaque_ptr = event_ptr;
     m_event_sp.reset();
 }
 
 bool
 SBEvent::IsValid() const
 {
-    // Do NOT use m_opaque directly!!! Must use the SBEvent::get()
+    // Do NOT use m_opaque_ptr directly!!! Must use the SBEvent::get()
     // accessor. See comments in SBEvent::get()....
     return SBEvent::get() != NULL;
 
@@ -186,7 +204,7 @@
     if (get())
     {
         description.ref();
-        m_opaque->Dump (description.get());
+        m_opaque_ptr->Dump (description.get());
     }
     else
         description.Printf ("No value");
@@ -200,7 +218,7 @@
     if (get())
     {
         description.ref();
-        m_opaque->Dump (description.get());
+        m_opaque_ptr->Dump (description.get());
     }
     else
         description.Printf ("No value");
diff --git a/source/API/SBFrame.cpp b/source/API/SBFrame.cpp
index c0f2f55..9701ada 100644
--- a/source/API/SBFrame.cpp
+++ b/source/API/SBFrame.cpp
@@ -63,6 +63,19 @@
     }
 }
 
+SBFrame::SBFrame(const SBFrame &rhs) :
+    m_opaque_sp (rhs.m_opaque_sp)
+{
+}
+
+const SBFrame &
+SBFrame::operator = (const SBFrame &rhs)
+{
+    if (this != &rhs)
+        m_opaque_sp = rhs.m_opaque_sp;
+    return *this;
+}
+
 SBFrame::~SBFrame()
 {
 }
diff --git a/source/API/SBFunction.cpp b/source/API/SBFunction.cpp
index 34f879a..79b7543 100644
--- a/source/API/SBFunction.cpp
+++ b/source/API/SBFunction.cpp
@@ -32,6 +32,18 @@
 {
 }
 
+SBFunction::SBFunction (const lldb::SBFunction &rhs) :
+    m_opaque_ptr (rhs.m_opaque_ptr)
+{
+}
+
+const SBFunction &
+SBFunction::operator = (const SBFunction &rhs)
+{
+    m_opaque_ptr = rhs.m_opaque_ptr;
+    return *this;
+}
+
 SBFunction::~SBFunction ()
 {
     m_opaque_ptr = NULL;
diff --git a/source/API/SBInstruction.cpp b/source/API/SBInstruction.cpp
index 13d68a1..01718a3 100644
--- a/source/API/SBInstruction.cpp
+++ b/source/API/SBInstruction.cpp
@@ -28,6 +28,19 @@
 {
 }
 
+SBInstruction::SBInstruction(const SBInstruction &rhs) :
+    m_opaque_sp (rhs.m_opaque_sp)
+{
+}
+
+const SBInstruction &
+SBInstruction::operator = (const SBInstruction &rhs)
+{
+    if (this != &rhs)
+        m_opaque_sp = rhs.m_opaque_sp;
+    return *this;
+}
+
 SBInstruction::~SBInstruction ()
 {
 }
diff --git a/source/API/SBInstructionList.cpp b/source/API/SBInstructionList.cpp
index b27ddfa..ce70d95 100644
--- a/source/API/SBInstructionList.cpp
+++ b/source/API/SBInstructionList.cpp
@@ -22,6 +22,20 @@
 {
 }
 
+SBInstructionList::SBInstructionList(const SBInstructionList &rhs) :
+    m_opaque_sp (rhs.m_opaque_sp)
+{
+}
+
+const SBInstructionList &
+SBInstructionList::operator = (const SBInstructionList &rhs)
+{
+    if (this != &rhs)
+        m_opaque_sp = rhs.m_opaque_sp;
+    return *this;
+}
+
+
 SBInstructionList::~SBInstructionList ()
 {
 }
diff --git a/source/API/SBListener.cpp b/source/API/SBListener.cpp
index b6fbcf6..00b98b2 100644
--- a/source/API/SBListener.cpp
+++ b/source/API/SBListener.cpp
@@ -23,15 +23,17 @@
 
 
 SBListener::SBListener () :
-    m_opaque_ptr (NULL),
-    m_opaque_ptr_owned (false)
+    m_opaque_sp (),
+    m_opaque_ptr (NULL)
 {
 }
 
 SBListener::SBListener (const char *name) :
-    m_opaque_ptr (new Listener (name)),
-    m_opaque_ptr_owned (true)
+    m_opaque_sp (new Listener (name)),
+    m_opaque_ptr (NULL)
 {
+    m_opaque_ptr = m_opaque_sp.get();
+
     Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
 
     if (log)
@@ -39,22 +41,32 @@
                      name, m_opaque_ptr);
 }
 
+
+SBListener::SBListener (const SBListener &rhs) :
+    m_opaque_sp (rhs.m_opaque_sp),
+    m_opaque_ptr (rhs.m_opaque_ptr)
+{
+}
+
+const lldb::SBListener &
+SBListener::operator = (const lldb::SBListener &rhs)
+{
+    if (this != &rhs)
+    {
+        m_opaque_sp = rhs.m_opaque_sp;
+        m_opaque_ptr = rhs.m_opaque_ptr;
+    }
+    return *this;
+}
+
 SBListener::SBListener (Listener &listener) :
-    m_opaque_ptr (&listener),
-    m_opaque_ptr_owned (false)
+    m_opaque_sp (),
+    m_opaque_ptr (&listener)
 {
 }
 
 SBListener::~SBListener ()
 {
-    if (m_opaque_ptr_owned)
-    {
-        if (m_opaque_ptr)
-        {
-            delete m_opaque_ptr;
-            m_opaque_ptr = NULL;
-        }
-    }
 }
 
 bool
@@ -365,11 +377,12 @@
 }
 
 void
-SBListener::reset(Listener *listener, bool transfer_ownership)
+SBListener::reset(Listener *listener, bool owns)
 {
-    if (m_opaque_ptr_owned && m_opaque_ptr)
-        delete m_opaque_ptr;
-    m_opaque_ptr_owned = transfer_ownership;
+    if (owns)
+        m_opaque_sp.reset (listener);
+    else
+        m_opaque_sp.reset ();
     m_opaque_ptr = listener;
 }
 
diff --git a/source/API/SBModule.cpp b/source/API/SBModule.cpp
index c6c2d75..a631412 100644
--- a/source/API/SBModule.cpp
+++ b/source/API/SBModule.cpp
@@ -30,6 +30,19 @@
 {
 }
 
+SBModule::SBModule(const SBModule &rhs) :
+    m_opaque_sp (rhs.m_opaque_sp)
+{
+}
+
+const SBModule &
+SBModule::operator = (const SBModule &rhs)
+{
+    if (this != &rhs)
+        m_opaque_sp = rhs.m_opaque_sp;
+    return *this;
+}
+
 SBModule::~SBModule ()
 {
 }
diff --git a/source/API/SBProcess.cpp b/source/API/SBProcess.cpp
index 0c52b6b..8202a32 100644
--- a/source/API/SBProcess.cpp
+++ b/source/API/SBProcess.cpp
@@ -61,6 +61,14 @@
 {
 }
 
+const SBProcess&
+SBProcess::operator = (const SBProcess& rhs)
+{
+    if (this != &rhs)
+        m_opaque_sp = rhs.m_opaque_sp;
+    return *this;
+}
+
 //----------------------------------------------------------------------
 // Destructor
 //----------------------------------------------------------------------
diff --git a/source/API/SBSourceManager.cpp b/source/API/SBSourceManager.cpp
index 701665e..32f792d 100644
--- a/source/API/SBSourceManager.cpp
+++ b/source/API/SBSourceManager.cpp
@@ -20,8 +20,8 @@
 using namespace lldb_private;
 
 
-SBSourceManager::SBSourceManager (SourceManager& source_manager) :
-    m_opaque_ref (source_manager)
+SBSourceManager::SBSourceManager (SourceManager* source_manager) :
+    m_opaque_ptr (source_manager)
 {
 }
 
@@ -29,6 +29,18 @@
 {
 }
 
+SBSourceManager::SBSourceManager(const SBSourceManager &rhs) :
+    m_opaque_ptr (rhs.m_opaque_ptr)
+{
+}
+
+const SBSourceManager &
+SBSourceManager::operator = (const SBSourceManager &rhs)
+{
+    m_opaque_ptr = rhs.m_opaque_ptr;
+    return *this;
+}
+
 size_t
 SBSourceManager::DisplaySourceLinesWithLineNumbers
 (
@@ -40,6 +52,9 @@
     FILE *f
 )
 {
+    if (m_opaque_ptr == NULL)
+        return 0;
+
     if (f == NULL)
         return 0;
 
@@ -48,18 +63,12 @@
         StreamFile str (f);
 
 
-        return m_opaque_ref.DisplaySourceLinesWithLineNumbers (*file,
-                                                               line,
-                                                               context_before,
-                                                               context_after,
-                                                               current_line_cstr,
-                                                               &str);
+        return m_opaque_ptr->DisplaySourceLinesWithLineNumbers (*file,
+                                                                line,
+                                                                context_before,
+                                                                context_after,
+                                                                current_line_cstr,
+                                                                &str);
     }
     return 0;
 }
-
-SourceManager &
-SBSourceManager::GetLLDBManager ()
-{
-    return m_opaque_ref;
-}
diff --git a/source/API/SBStringList.cpp b/source/API/SBStringList.cpp
index beb7606..129d2f4 100644
--- a/source/API/SBStringList.cpp
+++ b/source/API/SBStringList.cpp
@@ -34,21 +34,23 @@
 }
 
 
-
-SBStringList::~SBStringList ()
-{
-}
-
-
 const SBStringList &
 SBStringList::operator = (const SBStringList &rhs)
 {
-    if (rhs.IsValid())
-        m_opaque_ap.reset (new lldb_private::StringList(*rhs));
-
+    if (this != &rhs)
+    {
+        if (rhs.IsValid())
+            m_opaque_ap.reset(new lldb_private::StringList(*rhs));
+        else
+            m_opaque_ap.reset();
+    }
     return *this;
 }
 
+SBStringList::~SBStringList ()
+{
+}
+
 const lldb_private::StringList *
 SBStringList::operator->() const
 {
diff --git a/source/API/SBSymbol.cpp b/source/API/SBSymbol.cpp
index f5b09c9..b8dc521 100644
--- a/source/API/SBSymbol.cpp
+++ b/source/API/SBSymbol.cpp
@@ -29,6 +29,19 @@
 {
 }
 
+SBSymbol::SBSymbol (const lldb::SBSymbol &rhs) :
+    m_opaque_ptr (rhs.m_opaque_ptr)
+{
+}
+
+const SBSymbol &
+SBSymbol::operator = (const SBSymbol &rhs)
+{
+    m_opaque_ptr = rhs.m_opaque_ptr;
+    return *this;
+}
+
+
 SBSymbol::~SBSymbol ()
 {
     m_opaque_ptr = NULL;
diff --git a/source/API/SBTarget.cpp b/source/API/SBTarget.cpp
index 72aef3f..0154d60 100644
--- a/source/API/SBTarget.cpp
+++ b/source/API/SBTarget.cpp
@@ -64,6 +64,14 @@
 {
 }
 
+const SBTarget&
+SBTarget::operator = (const SBTarget& rhs)
+{
+    if (this != &rhs)
+        m_opaque_sp = rhs.m_opaque_sp;
+    return *this;
+}
+
 //----------------------------------------------------------------------
 // Destructor
 //----------------------------------------------------------------------
diff --git a/source/API/SBType.cpp b/source/API/SBType.cpp
index c94b0e4..271049d 100644
--- a/source/API/SBType.cpp
+++ b/source/API/SBType.cpp
@@ -40,7 +40,21 @@
     m_type (clang_type)
 {
 }
-    
+
+SBType::SBType (const SBType &rhs) :
+    m_ast (rhs.m_ast),
+    m_type (rhs.m_type)
+{
+}
+
+const SBType &
+SBType::operator =(const SBType &rhs)
+{
+    m_ast = rhs.m_ast;
+    m_type = rhs.m_type;
+    return *this;
+}
+
 SBType::~SBType ()
 {
 }
@@ -212,6 +226,35 @@
 {
 }
 
+SBTypeMember::SBTypeMember (const SBTypeMember &rhs) :
+    m_ast (rhs.m_ast),
+    m_parent_type (rhs.m_parent_type),
+    m_member_type (rhs.m_member_type),
+    m_member_name (rhs.m_member_name),
+    m_offset (rhs.m_offset),
+    m_bit_size (rhs.m_bit_size),
+    m_bit_offset (rhs.m_bit_offset),
+    m_is_base_class (rhs.m_is_base_class)
+{
+}
+
+const SBTypeMember&
+SBTypeMember::operator =(const SBTypeMember &rhs)
+{
+    if (this != &rhs)
+    {
+        m_ast = rhs.m_ast;
+        m_parent_type = rhs.m_parent_type;
+        m_member_type = rhs.m_member_type;
+        m_member_name = rhs.m_member_name;
+        m_offset = rhs.m_offset;
+        m_bit_size = rhs.m_bit_size;
+        m_bit_offset = rhs.m_bit_offset;
+        m_is_base_class = rhs.m_is_base_class;
+    }
+    return *this;
+}
+
 SBTypeMember::~SBTypeMember ()
 {
     SetName (NULL);
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp
index 54f822e..a4b3db2 100644
--- a/source/API/SBValue.cpp
+++ b/source/API/SBValue.cpp
@@ -44,6 +44,19 @@
 {
 }
 
+SBValue::SBValue(const SBValue &rhs) :
+    m_opaque_sp (rhs.m_opaque_sp)
+{
+}
+
+const SBValue &
+SBValue::operator = (const SBValue &rhs)
+{
+    if (this != &rhs)
+        m_opaque_sp = rhs.m_opaque_sp;
+    return *this;
+}
+
 SBValue::~SBValue()
 {
 }