summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2022-06-29 17:08:09 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2022-06-29 17:13:43 +0200
commit2cb56aeb16db8f3b10ee8760789eb2088912294c (patch)
treebd91d7997a28179b4741f04dce3936f1eb890b72
parentd2f22123ce130270cdf9acc83b1b9afd88605ec3 (diff)
downloadjustbuild-2cb56aeb16db8f3b10ee8760789eb2088912294c.tar.gz
Error reporting: also abbreviate the expression in the stack trace
... to the same limit as the values occuring in the stack.
-rw-r--r--share/man/just.1.org3
-rw-r--r--src/buildtool/build_engine/expression/evaluator.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/share/man/just.1.org b/share/man/just.1.org
index 14bd8183..7331f06b 100644
--- a/share/man/just.1.org
+++ b/share/man/just.1.org
@@ -341,7 +341,8 @@ well-defined graph file. See *just-graph-file(5)* for more details.
*--expression-log-limit* NUM\\
In error messages, truncate the entries in the enumeration of the active
- environment to the specified number of characters (default: 320).\\
+ environment, as well as the expression to be evaluated, to the specified
+ number of characters (default: 320).\\
Supported by: analyse|build|install
*-P*, *--print-to-stdout* LOGICAL_PATH\\
diff --git a/src/buildtool/build_engine/expression/evaluator.cpp b/src/buildtool/build_engine/expression/evaluator.cpp
index 0097bd27..af5d46ed 100644
--- a/src/buildtool/build_engine/expression/evaluator.cpp
+++ b/src/buildtool/build_engine/expression/evaluator.cpp
@@ -920,7 +920,7 @@ auto Evaluator::EvaluationError::WhileEvaluating(ExpressionPtr const& expr,
expr["type"]->IsString()) {
ss << expr["type"]->ToString() << "-expression ";
}
- ss << expr->ToString() << std::endl;
+ ss << expr->ToAbbrevString(Config().expression_log_limit) << std::endl;
ss << " environment " << std::endl;
ss << env.Enumerate(" - ", Config().expression_log_limit) << std::endl;
ss << ex.what();