1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

refactor: Extract EvalState::{runDebugRepl,canDebug}

This commit is contained in:
Robert Hensing 2024-05-01 23:02:43 +02:00
parent da82d67022
commit c07500e14d
4 changed files with 37 additions and 15 deletions

View file

@ -276,6 +276,18 @@ public:
return std::shared_ptr<const StaticEnv>();;
}
/** Whether a debug repl can be started. If `false`, `runDebugRepl(error)` will return without starting a repl. */
bool canDebug();
/** Use front of `debugTraces`; see `runDebugRepl(error,env,expr)` */
void runDebugRepl(const Error * error);
/**
* Run a debug repl with the given error, environment and expression.
* @param error The error to debug, may be nullptr.
* @param env The environment to debug, matching the expression.
* @param expr The expression to debug, matching the environment.
*/
void runDebugRepl(const Error * error, const Env & env, const Expr & expr);
template<class T, typename... Args>