aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.hh
diff options
context:
space:
mode:
authorBen Burdette <bburdette@protonmail.com>2022-05-19 11:07:18 -0600
committerBen Burdette <bburdette@protonmail.com>2022-05-19 11:07:18 -0600
commitf9cdb6af8dea863b325210d59a1f2e865a06010e (patch)
tree540b9dbdd53fbeb79320f846c92706d234b2e422 /src/libexpr/eval.hh
parent667074b5867ffe40e3f1c59bd8e4ebf259f86aaa (diff)
parent357fb84dbaad0b056704915c6a43764cda63ee7f (diff)
Merge branch 'debug-exploratory-PR' into debuggerHook-eval-arg
Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r--src/libexpr/eval.hh12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 26717a6f8..5227c7ce1 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -25,7 +25,7 @@ enum RepairFlag : bool;
typedef void (* PrimOpFun) (EvalState & state, const PosIdx pos, Value * * args, Value & v);
-void printEnvBindings(const SymbolTable & st, const Expr & expr, const Env & env);
+void printEnvBindings(const EvalState &es, const Expr & expr, const Env & env);
void printEnvBindings(const SymbolTable & st, const StaticEnv & se, const Env & env, int lvl = 0);
struct PrimOp
@@ -130,6 +130,16 @@ public:
bool debugStop;
bool debugQuit;
std::list<DebugTrace> debugTraces;
+ std::map<const Expr*, const std::shared_ptr<const StaticEnv> > exprEnvs;
+ const std::shared_ptr<const StaticEnv> getStaticEnv(const Expr &expr) const
+ {
+ auto i = exprEnvs.find(&expr);
+ if (i != exprEnvs.end())
+ return i->second;
+ else
+ return std::shared_ptr<const StaticEnv>();;
+ }
+
template<class E>
[[gnu::noinline, gnu::noreturn]]