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.

llvm-svn: 135295
This commit is contained in:
Johnny Chen 2011-07-15 20:46:19 +00:00
parent b72bd53f7d
commit 135f63fb30
4 changed files with 48 additions and 10 deletions

View File

@ -71,6 +71,12 @@ TestBreakpointIgnoreCount.py),
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

View File

@ -17,7 +17,32 @@ namespace lldb {
#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

View File

@ -150,6 +150,9 @@ public:
lldb::SBValue
GetChildAtIndex (uint32_t idx);
#ifdef SWIG
%feature("docstring", "
#endif
//------------------------------------------------------------------
/// Get a child value by index from a value.
///
@ -167,20 +170,20 @@ public:
/// 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 @@ public:
/// @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,

View File

@ -223,7 +223,7 @@ for line in content.splitlines():
# 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 @@ for line in content.splitlines():
# 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: