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

add env to DebugTrace

This commit is contained in:
Ben Burdette 2022-01-07 16:37:44 -07:00
parent 84aeb74377
commit c51b527c28
3 changed files with 12 additions and 4 deletions

View file

@ -77,6 +77,7 @@ std::shared_ptr<RegexCache> makeRegexCache();
struct DebugTrace {
std::optional<ErrPos> pos;
const Expr &expr;
const Env &env;
hintformat hint;
};
@ -203,7 +204,7 @@ public:
trivial (i.e. doesn't require arbitrary computation). */
void evalFile(const Path & path, Value & v, bool mustBeTrivial = false);
/* Like `cacheFile`, but with an already parsed expression. */
/* Like `evalFile`, but with an already parsed expression. */
void cacheFile(
const Path & path,
const Path & resolvedPath,
@ -416,6 +417,9 @@ class DebugTraceStacker {
DebugTraceStacker(EvalState &evalState, DebugTrace t)
:evalState(evalState), trace(t)
{
// evalState.debuggerHook(const Error & error, const Env & env, const Expr & expr);
evalState.debugTraces.push_front(t);
}
~DebugTraceStacker()