Skip to content

Commit 1da4494

Browse files
authored
[lldb] Add comment on cross printing of summary/value (#81681)
Adds a comment to indicate intention of a piece of value printing code. I was initially surprised to see this code (distilled for emphasis): ```cpp if (str.empty()) { if (style == eValueObjectRepresentationStyleValue) str = GetSummaryAsCString(); else if (style == eValueObjectRepresentationStyleSummary) str = GetValueAsCString(); } ``` My first thought was "is this a bug?", but I realized it was likely intentional. This change adds a comment to indicate yes, this is intentional.
1 parent aab48c9 commit 1da4494

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lldb/source/Core/ValueObject.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,6 +1312,8 @@ bool ValueObject::DumpPrintableRepresentation(
13121312
break;
13131313
}
13141314

1315+
// If the requested display style produced no output, try falling back to
1316+
// alternative presentations.
13151317
if (str.empty()) {
13161318
if (val_obj_display == eValueObjectRepresentationStyleValue)
13171319
str = GetSummaryAsCString();

0 commit comments

Comments
 (0)