aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/nixexpr.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-04 08:54:52 +0100
committereldritch horrors <pennae@lix.systems>2024-03-04 08:54:52 +0100
commit542a19104e5a8146284f50aae9740ca2ada5ed1e (patch)
tree5db755d8f4f7dd8b56ea4b23a025060e61c630fe /src/libexpr/nixexpr.cc
parentcd654451c91088a1be8179e96865cf2aa0ea7624 (diff)
Merge pull request #9918 from 9999years/debugger-locals-for-let-expressions
Expose locals from `let` expressions to the debugger (cherry picked from commit acef4f17a2daab4ccdf656bdf229792db2f779e4) Change-Id: Ib3623254f67ac762f4e7230d625e9f87dff38a84
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r--src/libexpr/nixexpr.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index edab297f2..b34112be1 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -470,9 +470,6 @@ void ExprCall::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> &
void ExprLet::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> & env)
{
- if (es.debugRepl)
- es.exprEnvs.insert(std::make_pair(this, env));
-
auto newEnv = std::make_shared<StaticEnv>(nullptr, env.get(), attrs->attrs.size());
Displacement displ = 0;
@@ -484,6 +481,9 @@ void ExprLet::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> &
for (auto & i : attrs->attrs)
i.second.e->bindVars(es, i.second.inherited ? env : newEnv);
+ if (es.debugRepl)
+ es.exprEnvs.insert(std::make_pair(this, newEnv));
+
body->bindVars(es, newEnv);
}
@@ -508,9 +508,6 @@ void ExprWith::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> &
break;
}
- if (es.debugRepl)
- es.exprEnvs.insert(std::make_pair(this, env));
-
attrs->bindVars(es, env);
auto newEnv = std::make_shared<StaticEnv>(this, env.get());
body->bindVars(es, newEnv);