summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lee <davelee.com@gmail.com>2024-02-14 13:13:23 -0800
committerGitHub <noreply@github.com>2024-02-14 13:13:23 -0800
commit1da4494184566d68f32206e3ac5a8b90bc05889d (patch)
tree378d6a556f4ee3ab8db8893c51ad3ac4b0b0e8e4
parentaab48c99c2234e348aa37657accfb6110c84c9b7 (diff)
[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.
-rw-r--r--lldb/source/Core/ValueObject.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index e80042826f7d..840b100c70dd 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -1312,6 +1312,8 @@ bool ValueObject::DumpPrintableRepresentation(
break;
}
+ // If the requested display style produced no output, try falling back to
+ // alternative presentations.
if (str.empty()) {
if (val_obj_display == eValueObjectRepresentationStyleValue)
str = GetSummaryAsCString();