1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 04:21:16 +02:00

debugRepl ftn pointer

This commit is contained in:
Ben Burdette 2022-05-20 10:33:50 -06:00
parent 0600df86b8
commit 884d591787
4 changed files with 41 additions and 10 deletions

View file

@ -120,7 +120,34 @@ ref<EvalState> EvalCommand::getEvalState()
;
evalState->debugMode = startReplOnEvalErrors;
// TODO move this somewhere else. Its only here to get the evalState ptr!
if (startReplOnEvalErrors) {
evalState->debugRepl = &runRepl;
};
// // debuggerHook = [evalState{ref<EvalState>(evalState)}](const Error * error, const Env & env, const Expr & expr) {
// debuggerHook = [](EvalState & evalState, const Error * error, const Env & env, const Expr & expr) {
// auto dts =
// error && expr.getPos()
// ? std::make_unique<DebugTraceStacker>(
// evalState,
// DebugTrace {
// .pos = error->info().errPos ? *error->info().errPos : evalState.positions[expr.getPos()],
// .expr = expr,
// .env = env,
// .hint = error->info().msg,
// .isError = true
// })
// : nullptr;
// if (error)
// printError("%s\n\n" ANSI_BOLD "Starting REPL to allow you to inspect the current state of the evaluator.\n" ANSI_NORMAL, error->what());
// auto se = evalState.getStaticEnv(expr);
// if (se) {
// auto vm = mapStaticEnvBindings(evalState.symbols, *se.get(), env);
// runRepl(evalState, *vm);
// }
// if (startReplOnEvalErrors)
// // debuggerHook = [evalState{ref<EvalState>(evalState)}](const Error * error, const Env & env, const Expr & expr) {