aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorBen Burdette <bburdette@protonmail.com>2022-05-16 09:20:51 -0600
committerBen Burdette <bburdette@protonmail.com>2022-05-16 09:20:51 -0600
commit667074b5867ffe40e3f1c59bd8e4ebf259f86aaa (patch)
tree6ae4400c5496b74532dd3b1b0fd72a40f6f5e97f /src/libexpr
parent86ba0a702c63b4a8ff79a07f9303318feb330642 (diff)
first whack at passing evalState as an arg to debuggerHook.
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval.cc2
-rw-r--r--src/libexpr/eval.hh4
-rw-r--r--src/libexpr/nixexpr.cc2
-rw-r--r--src/libexpr/nixexpr.hh2
-rw-r--r--src/libexpr/primops.cc2
5 files changed, 6 insertions, 6 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index d9ea92cc0..3c998f7b6 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -1044,7 +1044,7 @@ DebugTraceStacker::DebugTraceStacker(EvalState & evalState, DebugTrace t)
{
evalState.debugTraces.push_front(trace);
if (evalState.debugStop && debuggerHook)
- debuggerHook(nullptr, trace.env, trace.expr);
+ debuggerHook(evalState, nullptr, trace.env, trace.expr);
}
void Value::mkString(std::string_view s)
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index f274278be..26717a6f8 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -136,7 +136,7 @@ public:
void debugThrow(const E &error, const Env & env, const Expr & expr) const
{
if (debuggerHook)
- debuggerHook(&error, env, expr);
+ debuggerHook(*this, &error, env, expr);
throw error;
}
@@ -150,7 +150,7 @@ public:
// DebugTrace stack.
if (debuggerHook && !debugTraces.empty()) {
const DebugTrace & last = debugTraces.front();
- debuggerHook(&e, last.env, last.expr);
+ debuggerHook(*this, &e, last.env, last.expr);
}
throw e;
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index 213cf93fa..a7b7b8aad 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -10,7 +10,7 @@ namespace nix {
/* Launch the nix debugger */
-std::function<void(const Error * error, const Env & env, const Expr & expr)> debuggerHook;
+std::function<void(const EvalState & evalState,const Error * error, const Env & env, const Expr & expr)> debuggerHook;
/* Displaying abstract syntax trees. */
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index c4a509f31..856676033 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -22,7 +22,7 @@ MakeError(UndefinedVarError, Error);
MakeError(MissingArgumentError, EvalError);
MakeError(RestrictedPathError, Error);
-extern std::function<void(const Error * error, const Env & env, const Expr & expr)> debuggerHook;
+extern std::function<void(const EvalState & evalState, const Error * error, const Env & env, const Expr & expr)> debuggerHook;
/* Position objects. */
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index ff5ae8809..e56e6314b 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -765,7 +765,7 @@ static RegisterPrimOp primop_break({
});
auto & dt = state.debugTraces.front();
- debuggerHook(&error, dt.env, dt.expr);
+ debuggerHook(state, &error, dt.env, dt.expr);
if (state.debugQuit) {
// If the user elects to quit the repl, throw an exception.