[Lldb-commits] [lldb] r135295 - in /lldb/trunk: include/lldb/API/SBBreakpoint.h include/lldb/API/SBCompileUnit.h include/lldb/API/SBValue.h scripts/Python/modify-python-lldb.py
Johnny Chen
johnny.chen at apple.com
Fri Jul 15 13:46:19 PDT 2011
Author: johnny
Date: Fri Jul 15 15:46:19 2011
New Revision: 135295
URL: http://llvm.org/viewvc/llvm-project?rev=135295&view=rev
Log:
Add some more docstrings for SBCompileUnit and SBBreakpoint, plus incorporate the doxgen doc block of
SBValue::GetChildAtIndex(uint32_t idx,
lldb::DynamicValueType use_dynamic,
bool can_create_synthetic);
into the SBValue docstrings.
Modified:
lldb/trunk/include/lldb/API/SBBreakpoint.h
lldb/trunk/include/lldb/API/SBCompileUnit.h
lldb/trunk/include/lldb/API/SBValue.h
lldb/trunk/scripts/Python/modify-python-lldb.py
Modified: lldb/trunk/include/lldb/API/SBBreakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBBreakpoint.h?rev=135295&r1=135294&r2=135295&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBBreakpoint.h (original)
+++ lldb/trunk/include/lldb/API/SBBreakpoint.h Fri Jul 15 15:46:19 2011
@@ -71,6 +71,12 @@
process.Continue()
+SBBreakpoint supports breakpoint location iteration. For example,
+
+ for bl in breakpoint:
+ print 'breakpoint location load addr: %s' % hex(bl.GetLoadAddress())
+ print 'breakpoint location condition: %s' % hex(bl.GetCondition())
+
"
) SBBreakpoint;
#endif
Modified: lldb/trunk/include/lldb/API/SBCompileUnit.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBCompileUnit.h?rev=135295&r1=135294&r2=135295&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBCompileUnit.h (original)
+++ lldb/trunk/include/lldb/API/SBCompileUnit.h Fri Jul 15 15:46:19 2011
@@ -17,7 +17,32 @@
#ifdef SWIG
%feature("docstring",
- "Represents a compilation unit, or compiled source file."
+"Represents a compilation unit, or compiled source file.
+
+SBCompileUnit supports line entry iteration. For example,
+
+ for lineEntry in compileUnit:
+ print 'line entry: %s:%d' % (str(lineEntry.GetFileSpec()),
+ lineEntry.GetLine())
+ print 'start addr: %s' % str(lineEntry.GetStartAddress())
+ print 'end addr: %s' % str(lineEntry.GetEndAddress())
+
+produces:
+
+line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:20
+start addr: a.out[0x100000d98]
+end addr: a.out[0x100000da3]
+line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:21
+start addr: a.out[0x100000da3]
+end addr: a.out[0x100000da9]
+line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:22
+start addr: a.out[0x100000da9]
+end addr: a.out[0x100000db6]
+line entry: /Volumes/data/lldb/svn/trunk/test/python_api/symbol-context/main.c:23
+start addr: a.out[0x100000db6]
+end addr: a.out[0x100000dbc]
+...
+"
) SBCompileUnit;
#endif
class SBCompileUnit
Modified: lldb/trunk/include/lldb/API/SBValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBValue.h?rev=135295&r1=135294&r2=135295&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBValue.h (original)
+++ lldb/trunk/include/lldb/API/SBValue.h Fri Jul 15 15:46:19 2011
@@ -150,6 +150,9 @@
lldb::SBValue
GetChildAtIndex (uint32_t idx);
+#ifdef SWIG
+ %feature("docstring", "
+#endif
//------------------------------------------------------------------
/// Get a child value by index from a value.
///
@@ -167,20 +170,20 @@
/// points to a simple type, the child at index zero
/// is the only child value available, unless \a synthetic_allowed
/// is \b true, in which case the pointer will be used as an array
- /// and can create "synthetic" child values using positive or
+ /// and can create 'synthetic' child values using positive or
/// negative indexes. If the pointer points to an aggregate type
/// (an array, class, union, struct), then the pointee is
/// transparently skipped and any children are going to be the indexes
/// of the child values within the aggregate type. For example if
- /// we have a "Point" type and we have a SBValue that contains a
- /// pointer to a "Point" type, then the child at index zero will be
- /// the "x" member, and the child at index 1 will be the "y" member
- /// (the child at index zero won't be a "Point" instance).
+ /// we have a 'Point' type and we have a SBValue that contains a
+ /// pointer to a 'Point' type, then the child at index zero will be
+ /// the 'x' member, and the child at index 1 will be the 'y' member
+ /// (the child at index zero won't be a 'Point' instance).
///
/// Arrays have a preset number of children that can be accessed by
/// index and will returns invalid child values for indexes that are
/// out of bounds unless the \a synthetic_allowed is \b true. In this
- /// case the array can create "synthetic" child values for indexes
+ /// case the array can create 'synthetic' child values for indexes
/// that aren't in the array bounds using positive or negative
/// indexes.
///
@@ -200,6 +203,9 @@
/// @return
/// A new SBValue object that represents the child member value.
//------------------------------------------------------------------
+#ifdef SWIG
+ ") GetChildAtIndex;
+#endif
lldb::SBValue
GetChildAtIndex (uint32_t idx,
lldb::DynamicValueType use_dynamic,
Modified: lldb/trunk/scripts/Python/modify-python-lldb.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/modify-python-lldb.py?rev=135295&r1=135294&r2=135295&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/modify-python-lldb.py (original)
+++ lldb/trunk/scripts/Python/modify-python-lldb.py Fri Jul 15 15:46:19 2011
@@ -223,7 +223,7 @@
# Adding support for eq and ne for the matched SB class.
state |= DEFINING_EQUALITY
- elif (state & DEFINING_ITERATOR) or (state & DEFINING_EQUALITY):
+ if (state & DEFINING_ITERATOR) or (state & DEFINING_EQUALITY):
match = init_pattern.search(line)
if match:
# We found the beginning of the __init__ method definition.
@@ -244,15 +244,16 @@
# Next state will be NORMAL.
state = NORMAL
- elif (state & CLEANUP_DOCSTRING):
+ if (state & CLEANUP_DOCSTRING):
# Cleanse the lldb.py of the autodoc'ed residues.
if c_ifdef_swig in line or c_endif_swig in line:
continue
# As well as the comment marker line and trailing blank line.
if c_comment_marker in line or line == trailing_blank_line:
continue
- # Also remove the '\a ' substrings.
+ # Also remove the '\a ' and '\b 'substrings.
line = line.replace('\a ', '')
+ line = line.replace('\b ', '')
# And the leading '///' substring.
doxygen_comment_match = doxygen_comment_start.match(line)
if doxygen_comment_match:
More information about the lldb-commits
mailing list