aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectExpression.cpp
diff options
context:
space:
mode:
authorMichael Buch <michaelbuch12@gmail.com>2025-07-16 21:47:13 +0100
committerGitHub <noreply@github.com>2025-07-16 21:47:13 +0100
commit8c28f4920dfda2e3d91c58e8eb5b568dd396fa2d (patch)
treeab84569b0417e8b3595a59526cd7b878363b3d78 /lldb/source/Commands/CommandObjectExpression.cpp
parent6824bcfdb4c8315a990f4b5ce2cb9f528281a823 (diff)
downloadllvm-8c28f4920dfda2e3d91c58e8eb5b568dd396fa2d.zip
llvm-8c28f4920dfda2e3d91c58e8eb5b568dd396fa2d.tar.gz
llvm-8c28f4920dfda2e3d91c58e8eb5b568dd396fa2d.tar.bz2
[lldb] Print children-count warning for dwim-print and expr (#149088)
When dumping variables, LLDB will print a one-time warning about truncating children (when the children count exceeds the default `target.max-children-count`). But we only do this for `frame variable`. So if we use `dwim-print` or `expression`, the output gets truncated but we don't print a warning. But because we store the fact that we truncated some output on the `CommandInterpreter`, we fire the warning next time we use `frame variable`. E.g.,: ``` (lldb) p arr (int[1000]) { [0] = -5 [1] = 0 [2] = 0 <-- snipped --> [253] = 0 [254] = 0 [255] = 0 ... } (lldb) v someLocal (int) someLocal = 10 *** Some of the displayed variables have more members than the debugger will show by default. To show all of them, you can either use the --show-all-children option to frame variable or raise the limit by changing the target.max-children-count setting. ``` This patch prints the warning for `dwim-print` and `expression`. I only added a test for the `target.max-children-count` for now because it seems the `target.max-children-depth` warning is broken (I can't get it to fire).
Diffstat (limited to 'lldb/source/Commands/CommandObjectExpression.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectExpression.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index a95dea6..c5b9167 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -470,6 +470,9 @@ bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr,
return false;
}
+ m_interpreter.PrintWarningsIfNecessary(result.GetOutputStream(),
+ m_cmd_name);
+
if (suppress_result)
if (auto result_var_sp =
target.GetPersistentVariable(result_valobj_sp->GetName())) {