Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lldb/packages/Python/lldbsuite/test/lldbutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1464,8 +1464,8 @@ def format(self, value, buffer=None):
return output.getvalue()


class RecursiveDecentFormatter(BasicFormatter):
"""The recursive decent formatter prints the value and the decendents.
class RecursiveDescentFormatter(BasicFormatter):
"""The recursive descent formatter prints the value and the descendents.

The constructor takes two keyword args: indent_level, which defaults to 0,
and indent_child, which defaults to 2. The current indentation level is
Expand All @@ -1482,15 +1482,14 @@ def format(self, value, buffer=None):
output = io.StringIO()
else:
output = buffer

BasicFormatter.format(self, value, buffer=output, indent=self.lindent)
new_indent = self.lindent + self.cindent
for child in value:
if child.GetSummary() is not None:
BasicFormatter.format(self, child, buffer=output, indent=new_indent)
else:
if child.GetNumChildren() > 0:
rdf = RecursiveDecentFormatter(indent_level=new_indent)
rdf = RecursiveDescentFormatter(indent_level=new_indent)
rdf.format(child, buffer=output)
else:
BasicFormatter.format(self, child, buffer=output, indent=new_indent)
Expand Down
2 changes: 1 addition & 1 deletion lldb/test/API/python_api/value/TestValueAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def test(self):

fmt = lldbutil.BasicFormatter()
cvf = lldbutil.ChildVisitingFormatter(indent_child=2)
rdf = lldbutil.RecursiveDecentFormatter(indent_child=2)
rdf = lldbutil.RecursiveDescentFormatter(indent_child=2)
if self.TraceOn():
print(fmt.format(days_of_week))
print(cvf.format(days_of_week))
Expand Down
7 changes: 3 additions & 4 deletions lldb/utils/lui/lldbutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,8 +1040,8 @@ def format(self, value, buffer=None):
return output.getvalue()


class RecursiveDecentFormatter(BasicFormatter):
"""The recursive decent formatter prints the value and the decendents.
class RecursiveDescentFormatter(BasicFormatter):
"""The recursive descent formatter prints the value and the descendents.

The constructor takes two keyword args: indent_level, which defaults to 0,
and indent_child, which defaults to 2. The current indentation level is
Expand All @@ -1058,15 +1058,14 @@ def format(self, value, buffer=None):
output = io.StringIO()
else:
output = buffer

BasicFormatter.format(self, value, buffer=output, indent=self.lindent)
new_indent = self.lindent + self.cindent
for child in value:
if child.GetSummary() is not None:
BasicFormatter.format(self, child, buffer=output, indent=new_indent)
else:
if child.GetNumChildren() > 0:
rdf = RecursiveDecentFormatter(indent_level=new_indent)
rdf = RecursiveDescentFormatter(indent_level=new_indent)
rdf.format(child, buffer=output)
else:
BasicFormatter.format(self, child, buffer=output, indent=new_indent)
Expand Down
Loading