summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/API/SBAddress.cpp10
-rw-r--r--lldb/source/API/SBBlock.cpp9
-rw-r--r--lldb/source/API/SBBreakpoint.cpp11
-rw-r--r--lldb/source/API/SBBreakpointLocation.cpp10
-rw-r--r--lldb/source/API/SBCommandReturnObject.cpp8
-rw-r--r--lldb/source/API/SBCompileUnit.cpp10
-rw-r--r--lldb/source/API/SBDebugger.cpp9
-rw-r--r--lldb/source/API/SBError.cpp8
-rw-r--r--lldb/source/API/SBEvent.cpp10
-rw-r--r--lldb/source/API/SBFileSpec.cpp8
-rw-r--r--lldb/source/API/SBFrame.cpp10
-rw-r--r--lldb/source/API/SBFunction.cpp10
-rw-r--r--lldb/source/API/SBLineEntry.cpp8
-rw-r--r--lldb/source/API/SBModule.cpp10
-rw-r--r--lldb/source/API/SBProcess.cpp8
-rw-r--r--lldb/source/API/SBSymbol.cpp13
-rw-r--r--lldb/source/API/SBSymbolContext.cpp25
-rw-r--r--lldb/source/API/SBTarget.cpp10
-rw-r--r--lldb/source/API/SBThread.cpp8
-rw-r--r--lldb/source/API/SBType.cpp8
-rw-r--r--lldb/source/API/SBValue.cpp8
21 files changed, 27 insertions, 184 deletions
diff --git a/lldb/source/API/SBAddress.cpp b/lldb/source/API/SBAddress.cpp
index 0afe914e6df..7f21cf79fca 100644
--- a/lldb/source/API/SBAddress.cpp
+++ b/lldb/source/API/SBAddress.cpp
@@ -140,6 +140,7 @@ SBAddress::operator*() const
bool
SBAddress::GetDescription (SBStream &description)
{
+ description.ref();
if (m_opaque_ap.get())
{
m_opaque_ap->DumpDebug (description.get());
@@ -149,12 +150,3 @@ SBAddress::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBAddress::__repr__ ()
-{
- SBStream description;
- description.ref(); // Make sure it contains a valid StreamString.
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBBlock.cpp b/lldb/source/API/SBBlock.cpp
index 02db9b2237a..b57936d9fe0 100644
--- a/lldb/source/API/SBBlock.cpp
+++ b/lldb/source/API/SBBlock.cpp
@@ -158,12 +158,3 @@ SBBlock::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBBlock::__repr__ ()
-{
- SBStream description;
- description.ref();
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBBreakpoint.cpp b/lldb/source/API/SBBreakpoint.cpp
index aa84575be2e..70a70458b36 100644
--- a/lldb/source/API/SBBreakpoint.cpp
+++ b/lldb/source/API/SBBreakpoint.cpp
@@ -337,7 +337,7 @@ SBBreakpoint::GetDescription (const char *description_level, SBStream &descripti
else
level = eDescriptionLevelBrief;
-
+ description.ref();
m_opaque_sp->GetDescription (description.get(), level);
description.get()->EOL();
}
@@ -347,15 +347,6 @@ SBBreakpoint::GetDescription (const char *description_level, SBStream &descripti
return true;
}
-PyObject *
-SBBreakpoint::__repr__ ()
-{
- SBStream description;
- description.ref();
- GetDescription ("full", description);
- return PyString_FromString (description.GetData());
-}
-
bool
SBBreakpoint::PrivateBreakpointHitCallback
(
diff --git a/lldb/source/API/SBBreakpointLocation.cpp b/lldb/source/API/SBBreakpointLocation.cpp
index f7e059ba967..07300eabac4 100644
--- a/lldb/source/API/SBBreakpointLocation.cpp
+++ b/lldb/source/API/SBBreakpointLocation.cpp
@@ -212,6 +212,7 @@ SBBreakpointLocation::GetDescription (const char *description_level, SBStream &d
else
level = eDescriptionLevelBrief;
+ description.ref();
m_opaque_sp->GetDescription (description.get(), level);
description.get()->EOL();
}
@@ -221,15 +222,6 @@ SBBreakpointLocation::GetDescription (const char *description_level, SBStream &d
return true;
}
-PyObject *
-SBBreakpointLocation::__repr__ ()
-{
- SBStream description;
- description.ref();
- GetDescription ("full", description);
- return PyString_FromString (description.GetData());
-}
-
SBBreakpoint
SBBreakpointLocation::GetBreakpoint ()
{
diff --git a/lldb/source/API/SBCommandReturnObject.cpp b/lldb/source/API/SBCommandReturnObject.cpp
index 458ce504e3d..35195f6da23 100644
--- a/lldb/source/API/SBCommandReturnObject.cpp
+++ b/lldb/source/API/SBCommandReturnObject.cpp
@@ -188,11 +188,3 @@ SBCommandReturnObject::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBCommandReturnObject::__repr__ ()
-{
- SBStream description;
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBCompileUnit.cpp b/lldb/source/API/SBCompileUnit.cpp
index 9e68e28c01d..42bbf82a7e5 100644
--- a/lldb/source/API/SBCompileUnit.cpp
+++ b/lldb/source/API/SBCompileUnit.cpp
@@ -125,6 +125,7 @@ SBCompileUnit::GetDescription (SBStream &description)
{
if (m_opaque_ptr)
{
+ description.ref();
m_opaque_ptr->Dump (description.get(), false);
}
else
@@ -132,12 +133,3 @@ SBCompileUnit::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBCompileUnit::__repr__ ()
-{
- SBStream description;
- description.ref();
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBDebugger.cpp b/lldb/source/API/SBDebugger.cpp
index 0a48e69cb79..81658d5ab59 100644
--- a/lldb/source/API/SBDebugger.cpp
+++ b/lldb/source/API/SBDebugger.cpp
@@ -695,12 +695,3 @@ SBDebugger::GetDescription (SBStream &description)
return true;
}
-
-
-PyObject *
-SBDebugger::__repr__ ()
-{
- SBStream description;
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBError.cpp b/lldb/source/API/SBError.cpp
index 136561981b6..9553b6f4166 100644
--- a/lldb/source/API/SBError.cpp
+++ b/lldb/source/API/SBError.cpp
@@ -198,11 +198,3 @@ SBError::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBError::__repr__ ()
-{
- SBStream description;
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBEvent.cpp b/lldb/source/API/SBEvent.cpp
index d77f0020835..d1123e7f858 100644
--- a/lldb/source/API/SBEvent.cpp
+++ b/lldb/source/API/SBEvent.cpp
@@ -156,6 +156,7 @@ SBEvent::GetDescription (SBStream &description)
{
if (m_opaque)
{
+ description.ref();
m_opaque->Dump (description.get());
}
else
@@ -163,12 +164,3 @@ SBEvent::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBEvent::__repr__ ()
-{
- SBStream description;
- description.ref();
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp
index 1edd9468b50..36fcf1bbf2e 100644
--- a/lldb/source/API/SBFileSpec.cpp
+++ b/lldb/source/API/SBFileSpec.cpp
@@ -158,11 +158,3 @@ SBFileSpec::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBFileSpec::__repr__ ()
-{
- SBStream description;
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp
index 90952691df0..9e0f35d0a1d 100644
--- a/lldb/source/API/SBFrame.cpp
+++ b/lldb/source/API/SBFrame.cpp
@@ -394,6 +394,7 @@ SBFrame::GetDescription (SBStream &description)
{
if (m_opaque_sp)
{
+ description.ref();
m_opaque_sp->Dump (description.get(), true, false);
}
else
@@ -401,12 +402,3 @@ SBFrame::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBFrame::__repr__ ()
-{
- SBStream description;
- description.ref();
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBFunction.cpp b/lldb/source/API/SBFunction.cpp
index 4c5f64e23ca..38e349bd3f9 100644
--- a/lldb/source/API/SBFunction.cpp
+++ b/lldb/source/API/SBFunction.cpp
@@ -69,6 +69,7 @@ SBFunction::GetDescription (SBStream &description)
{
if (m_opaque_ptr)
{
+ description.ref();
m_opaque_ptr->Dump (description.get(), false);
}
else
@@ -76,12 +77,3 @@ SBFunction::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBFunction::__repr__ ()
-{
- SBStream description;
- description.ref();
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBLineEntry.cpp b/lldb/source/API/SBLineEntry.cpp
index 27f01d5a2da..023afb94aad 100644
--- a/lldb/source/API/SBLineEntry.cpp
+++ b/lldb/source/API/SBLineEntry.cpp
@@ -172,11 +172,3 @@ SBLineEntry::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBLineEntry::__repr__ ()
-{
- SBStream description;
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index a0b340a9cb7..b59a6002925 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -133,6 +133,7 @@ SBModule::GetDescription (SBStream &description)
{
if (m_opaque_sp)
{
+ description.ref();
m_opaque_sp->Dump (description.get());
}
else
@@ -140,12 +141,3 @@ SBModule::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBModule::__repr__ ()
-{
- SBStream description;
- description.ref();
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp
index d2c85ba9031..2d6e6b03a92 100644
--- a/lldb/source/API/SBProcess.cpp
+++ b/lldb/source/API/SBProcess.cpp
@@ -485,11 +485,3 @@ SBProcess::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBProcess::__repr__ ()
-{
- SBStream description;
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBSymbol.cpp b/lldb/source/API/SBSymbol.cpp
index 3c700e17035..017df4394ca 100644
--- a/lldb/source/API/SBSymbol.cpp
+++ b/lldb/source/API/SBSymbol.cpp
@@ -69,19 +69,12 @@ SBSymbol::GetDescription (SBStream &description)
{
if (m_opaque_ptr)
{
- m_opaque_ptr->GetDescription (description.get(), lldb::eDescriptionLevelFull, NULL);
+ description.ref();
+ m_opaque_ptr->GetDescription (description.get(),
+ lldb::eDescriptionLevelFull, NULL);
}
else
description.Printf ("No value");
return true;
}
-
-PyObject *
-SBSymbol::__repr__ ()
-{
- SBStream description;
- description.ref();
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBSymbolContext.cpp b/lldb/source/API/SBSymbolContext.cpp
index 4381994c70f..ecd7d6677ff 100644
--- a/lldb/source/API/SBSymbolContext.cpp
+++ b/lldb/source/API/SBSymbolContext.cpp
@@ -32,7 +32,12 @@ SBSymbolContext::SBSymbolContext (const SBSymbolContext& rhs) :
m_opaque_ap ()
{
if (rhs.IsValid())
- *m_opaque_ap = *rhs.m_opaque_ap;
+ {
+ if (m_opaque_ap.get())
+ *m_opaque_ap = *rhs.m_opaque_ap;
+ else
+ ref() = *rhs.m_opaque_ap;
+ }
}
SBSymbolContext::~SBSymbolContext ()
@@ -141,6 +146,14 @@ SBSymbolContext::operator*()
return *m_opaque_ap.get();
}
+lldb_private::SymbolContext&
+SBSymbolContext::ref()
+{
+ if (m_opaque_ap.get() == NULL)
+ m_opaque_ap.reset (new SymbolContext);
+ return *m_opaque_ap.get();
+}
+
lldb_private::SymbolContext *
SBSymbolContext::get() const
{
@@ -152,6 +165,7 @@ SBSymbolContext::GetDescription (SBStream &description)
{
if (m_opaque_ap.get())
{
+ description.ref();
m_opaque_ap->GetDescription (description.get(), lldb::eDescriptionLevelFull, NULL);
}
else
@@ -159,12 +173,3 @@ SBSymbolContext::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBSymbolContext::__repr__ ()
-{
- SBStream description;
- description.ref();
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index cc544db9088..f34b0142cb2 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -507,6 +507,7 @@ SBTarget::GetDescription (SBStream &description)
{
if (m_opaque_sp)
{
+ description.ref();
m_opaque_sp->Dump (description.get());
}
else
@@ -514,12 +515,3 @@ SBTarget::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBTarget::__repr__ ()
-{
- SBStream description;
- description.ref();
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp
index aa621fb13c0..8c74a34cdbe 100644
--- a/lldb/source/API/SBThread.cpp
+++ b/lldb/source/API/SBThread.cpp
@@ -428,11 +428,3 @@ SBThread::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBThread::__repr__ ()
-{
- SBStream description;
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp
index d34e94a1460..5c3e97381ad 100644
--- a/lldb/source/API/SBType.cpp
+++ b/lldb/source/API/SBType.cpp
@@ -185,14 +185,6 @@ SBType::GetDescription (SBStream &description)
return true;
}
-PyObject *
-SBType::__repr__ ()
-{
- SBStream description;
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
-
SBTypeMember::SBTypeMember () :
m_ast (NULL),
m_parent_type (NULL),
diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp
index e2fdffab592..4b437f4e1b5 100644
--- a/lldb/source/API/SBValue.cpp
+++ b/lldb/source/API/SBValue.cpp
@@ -293,11 +293,3 @@ SBValue::GetDescription (SBStream &description)
return true;
}
-
-PyObject *
-SBValue::__repr__ ()
-{
- SBStream description;
- GetDescription (description);
- return PyString_FromString (description.GetData());
-}
OpenPOWER on IntegriCloud