mirror of
https://github.com/NixOS/nix
synced 2025-06-27 16:51:15 +02:00
add DebugTrace for the current error
This commit is contained in:
parent
6801a423fc
commit
9760fa8661
5 changed files with 30 additions and 19 deletions
|
@ -38,21 +38,6 @@ namespace nix {
|
|||
|
||||
std::function<void(const Error & error, const Env & env, const Expr & expr)> debuggerHook;
|
||||
|
||||
class DebugTraceStacker {
|
||||
public:
|
||||
DebugTraceStacker(EvalState &evalState, DebugTrace t)
|
||||
:evalState(evalState), trace(t)
|
||||
{
|
||||
evalState.debugTraces.push_front(t);
|
||||
}
|
||||
~DebugTraceStacker() {
|
||||
// assert(evalState.debugTraces.front() == trace);
|
||||
evalState.debugTraces.pop_front();
|
||||
}
|
||||
EvalState &evalState;
|
||||
DebugTrace trace;
|
||||
};
|
||||
|
||||
static char * dupString(const char * s)
|
||||
{
|
||||
char * t;
|
||||
|
@ -701,7 +686,7 @@ void printStaticEnvBindings(const StaticEnv &se, int lvl)
|
|||
std::cout << std::endl;
|
||||
|
||||
if (se.up) {
|
||||
printStaticEnvBindings(*se.up, ++lvl);
|
||||
printStaticEnvBindings(*se.up, ++lvl);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue