1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02:00

back to ref<EvalState> in NixRepl

This commit is contained in:
Ben Burdette 2022-05-25 10:21:20 -06:00
parent 91b7d5373a
commit b4c24a29c6
4 changed files with 82 additions and 83 deletions

View file

@ -836,7 +836,7 @@ void EvalState::runDebugRepl(const Error * error, const Env & env, const Expr &
auto se = getStaticEnv(expr);
if (se) {
auto vm = mapStaticEnvBindings(symbols, *se.get(), env);
(debugRepl)(*this, *vm);
(debugRepl)(ref<EvalState>(shared_from_this()), *vm);
}
}

View file

@ -13,7 +13,6 @@
#include <unordered_map>
#include <mutex>
namespace nix {
@ -88,7 +87,7 @@ struct DebugTrace {
void debugError(Error * e, Env & env, Expr & expr);
class EvalState
class EvalState : public std::enable_shared_from_this<EvalState>
{
public:
SymbolTable symbols;
@ -127,7 +126,7 @@ public:
RootValue vImportedDrvToDerivation = nullptr;
/* Debugger */
void (* debugRepl)(EvalState & es, const ValMap & extraEnv);
void (* debugRepl)(ref<EvalState> es, const ValMap & extraEnv);
bool debugStop;
bool debugQuit;
std::list<DebugTrace> debugTraces;