summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
Diffstat (limited to 'lldb')
-rw-r--r--lldb/include/lldb/API/SBBreakpointLocation.h2
-rw-r--r--lldb/scripts/Python/python-extensions.swig2
-rw-r--r--lldb/source/API/SBBreakpointLocation.cpp4
-rw-r--r--lldb/test/lldbutil.py17
-rw-r--r--lldb/test/python_api/target/TestTargetAPI.py5
5 files changed, 22 insertions, 8 deletions
diff --git a/lldb/include/lldb/API/SBBreakpointLocation.h b/lldb/include/lldb/API/SBBreakpointLocation.h
index 652b7c5eed5..66b57a8a682 100644
--- a/lldb/include/lldb/API/SBBreakpointLocation.h
+++ b/lldb/include/lldb/API/SBBreakpointLocation.h
@@ -82,7 +82,7 @@ public:
IsResolved ();
bool
- GetDescription (DescriptionLevel level, lldb::SBStream &description);
+ GetDescription (lldb::SBStream &description, DescriptionLevel level);
SBBreakpoint
GetBreakpoint ();
diff --git a/lldb/scripts/Python/python-extensions.swig b/lldb/scripts/Python/python-extensions.swig
index f52fa918145..8943561b5be 100644
--- a/lldb/scripts/Python/python-extensions.swig
+++ b/lldb/scripts/Python/python-extensions.swig
@@ -23,7 +23,7 @@
%extend lldb::SBBreakpointLocation {
PyObject *lldb::SBBreakpointLocation::__repr__ (){
lldb::SBStream description;
- $self->GetDescription (lldb::eDescriptionLevelFull, description);
+ $self->GetDescription (description, lldb::eDescriptionLevelFull);
return PyString_FromString (description.GetData());
}
}
diff --git a/lldb/source/API/SBBreakpointLocation.cpp b/lldb/source/API/SBBreakpointLocation.cpp
index 1e7738ced7b..9ab952261a6 100644
--- a/lldb/source/API/SBBreakpointLocation.cpp
+++ b/lldb/source/API/SBBreakpointLocation.cpp
@@ -40,7 +40,7 @@ SBBreakpointLocation::SBBreakpointLocation (const lldb::BreakpointLocationSP &br
if (log)
{
SBStream sstr;
- GetDescription (lldb::eDescriptionLevelBrief, sstr);
+ GetDescription (sstr, lldb::eDescriptionLevelBrief);
log->Printf ("SBBreakpointLocation::SBBreakpointLocaiton (const lldb::BreakpointLocationsSP &break_loc_sp"
"=%p) => this.sp = %p (%s)", break_loc_sp.get(), m_opaque_sp.get(), sstr.GetData());
}
@@ -263,7 +263,7 @@ SBBreakpointLocation::SetLocation (const lldb::BreakpointLocationSP &break_loc_s
}
bool
-SBBreakpointLocation::GetDescription (DescriptionLevel level, SBStream &description)
+SBBreakpointLocation::GetDescription (SBStream &description, DescriptionLevel level)
{
if (m_opaque_sp)
{
diff --git a/lldb/test/lldbutil.py b/lldb/test/lldbutil.py
index 9cc4370e604..89c9d8f3bc8 100644
--- a/lldb/test/lldbutil.py
+++ b/lldb/test/lldbutil.py
@@ -171,11 +171,22 @@ def get_stopped_thread(process, reason):
# ==============================================================
# Get the description of an lldb object or None if not available
# ==============================================================
-def get_description(lldb_obj, option=None):
- """Calls lldb_obj.GetDescription() and returns a string, or None."""
- method = getattr(lldb_obj, 'GetDescription')
+def get_description(obj, option=None):
+ """Calls lldb_obj.GetDescription() and returns a string, or None.
+
+ For SBTarget and SBBreakpointLocation lldb objects, an extra option can be
+ passed in to describe the detailed level of description desired:
+ o lldb.eDescriptionLevelBrief
+ o lldb.eDescriptionLevelFull
+ o lldb.eDescriptionLevelVerbose
+ """
+ method = getattr(obj, 'GetDescription')
if not method:
return None
+ if isinstance(obj, lldb.SBTarget) or isinstance(obj, lldb.SBBreakpointLocation):
+ if option is None:
+ option = lldb.eDescriptionLevelBrief
+
stream = lldb.SBStream()
if option is None:
success = method(stream)
diff --git a/lldb/test/python_api/target/TestTargetAPI.py b/lldb/test/python_api/target/TestTargetAPI.py
index a112de5de28..e72d2e70daa 100644
--- a/lldb/test/python_api/target/TestTargetAPI.py
+++ b/lldb/test/python_api/target/TestTargetAPI.py
@@ -67,7 +67,10 @@ class TargetAPITestCase(TestBase):
self.assertTrue(target.IsValid(), VALID_TARGET)
from lldbutil import get_description
- desc = get_description(target, option=lldb.eDescriptionLevelBrief)
+
+ # get_description() allows no option to mean lldb.eDescriptionLevelBrief.
+ desc = get_description(target)
+ #desc = get_description(target, option=lldb.eDescriptionLevelBrief)
if not desc:
self.fail("SBTarget.GetDescription() failed")
self.expect(desc, exe=False,
OpenPOWER on IntegriCloud