mirror of
https://github.com/NixOS/nix
synced 2025-06-28 17:51:15 +02:00
first whack at passing evalState as an arg to debuggerHook.
This commit is contained in:
parent
86ba0a702c
commit
667074b586
9 changed files with 15 additions and 14 deletions
|
@ -119,13 +119,14 @@ ref<EvalState> EvalCommand::getEvalState()
|
|||
#endif
|
||||
;
|
||||
if (startReplOnEvalErrors)
|
||||
debuggerHook = [evalState{ref<EvalState>(evalState)}](const Error * error, const Env & env, const Expr & expr) {
|
||||
// debuggerHook = [evalState{ref<EvalState>(evalState)}](const Error * error, const Env & env, const Expr & expr) {
|
||||
debuggerHook = [](const EvalState & evalState, const Error * error, const Env & env, const Expr & expr) {
|
||||
auto dts =
|
||||
error && expr.getPos()
|
||||
? std::make_unique<DebugTraceStacker>(
|
||||
*evalState,
|
||||
evalState,
|
||||
DebugTrace {
|
||||
.pos = error->info().errPos ? *error->info().errPos : evalState->positions[expr.getPos()],
|
||||
.pos = error->info().errPos ? *error->info().errPos : evalState.positions[expr.getPos()],
|
||||
.expr = expr,
|
||||
.env = env,
|
||||
.hint = error->info().msg,
|
||||
|
@ -137,8 +138,8 @@ ref<EvalState> EvalCommand::getEvalState()
|
|||
printError("%s\n\n" ANSI_BOLD "Starting REPL to allow you to inspect the current state of the evaluator.\n" ANSI_NORMAL, error->what());
|
||||
|
||||
if (expr.staticEnv) {
|
||||
auto vm = mapStaticEnvBindings(evalState->symbols, *expr.staticEnv.get(), env);
|
||||
runRepl(evalState, *vm);
|
||||
auto vm = mapStaticEnvBindings(evalState.symbols, *expr.staticEnv.get(), env);
|
||||
runRepl(*const_cast<EvalState*>(&evalState), *vm);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ void printClosureDiff(
|
|||
|
||||
|
||||
void runRepl(
|
||||
ref<EvalState> evalState,
|
||||
EvalState & evalState,
|
||||
const ValMap & extraEnv);
|
||||
|
||||
}
|
||||
|
|
|
@ -1011,7 +1011,7 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m
|
|||
}
|
||||
|
||||
void runRepl(
|
||||
ref<EvalState> evalState,
|
||||
EvalState& evalState,
|
||||
const ValMap & extraEnv)
|
||||
{
|
||||
auto repl = std::make_unique<NixRepl>(evalState);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue