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
2 changes: 2 additions & 0 deletions lldb/source/Commands/CommandObjectDWIMPrint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ void CommandObjectDWIMPrint::DoExecute(StringRef command,
return;
}
}
m_interpreter.PrintWarningsIfNecessary(result.GetOutputStream(),
m_cmd_name);
result.SetStatus(eReturnStatusSuccessFinishResult);
};

Expand Down
3 changes: 3 additions & 0 deletions lldb/source/Commands/CommandObjectExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
Expand Down
67 changes: 67 additions & 0 deletions lldb/test/Shell/Settings/TestChildCountTruncation.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Test that we warn the user about truncated output
# when target.max-children-count wasn't explicitly set.

# RUN: split-file %s %t
# RUN: %clang_host -g -gdwarf %t/main.cpp -o %t.out
# RUN: %lldb -x -b -s %t/dwim-commands.input %t.out -o exit 2>&1 \
# RUN: | FileCheck %s --check-prefix=DWIM
#
# RUN: %lldb -x -b -s %t/expr-commands.input %t.out -o exit 2>&1 \
# RUN: | FileCheck %s --check-prefix=EXPR
#
# RUN: %lldb -x -b -s %t/frame-var-commands.input %t.out -o exit 2>&1 \
# RUN: | FileCheck %s --check-prefix=VAR
#
# RUN: %lldb -x -b -s %t/with-setting-commands.input %t.out -o exit 2>&1 \
# RUN: | FileCheck %s --check-prefix=SETTING

#--- main.cpp

int main() {
int arr[512] = { 3 };
__builtin_debugtrap();
}

#--- dwim-commands.input

run
dwim-print arr
frame variable arr

DWIM: (lldb) dwim-print arr
DWIM: *** Some of the displayed variables have more members
DWIM-SAME: use the --show-all-children option to dwim-print
DWIM: (lldb) frame variable arr
DWIM-NOT: *** Some of the displayed variables have more members

#--- expr-commands.input

run
expression arr
frame variable arr

EXPR: (lldb) expression arr
EXPR: *** Some of the displayed variables have more members
EXPR-SAME: use the --show-all-children option to expression
EXPR: (lldb) frame variable arr
EXPR-NOT: *** Some of the displayed variables have more members

#--- frame-var-commands.input

run
frame variable arr

VAR: (lldb) frame variable arr
VAR: *** Some of the displayed variables have more members
VAR-SAME: use the --show-all-children option to frame variable
VAR: (lldb) frame variable arr
VAR-NOT: *** Some of the displayed variables have more members

#--- with-setting-commands.input

run
settings set target.max-children-count 1
frame variable arr

SETTING: (lldb) frame variable arr
SETTING-NOT: *** Some of the displayed variables have more members
Loading