diff options
Diffstat (limited to 'src/libcmd')
-rw-r--r-- | src/libcmd/command.cc | 2 | ||||
-rw-r--r-- | src/libcmd/repl.cc | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libcmd/command.cc b/src/libcmd/command.cc index 3e789adba..56d529461 100644 --- a/src/libcmd/command.cc +++ b/src/libcmd/command.cc @@ -125,7 +125,7 @@ ref<EvalState> EvalCommand::getEvalState() std::unique_ptr<DebugTraceStacker>( new DebugTraceStacker( *evalState, - DebugTrace + DebugTrace {.pos = (error->info().errPos ? *error->info().errPos : evalState->positions[expr.getPos()]), .expr = expr, .env = env, diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index 40299e910..b94831064 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -276,10 +276,10 @@ void NixRepl::mainLoop(const std::vector<std::string> & files) printMsg(lvlError, e.msg()); } } catch (EvalError & e) { - // in debugger mode, an EvalError should trigger another repl session. + // in debugger mode, an EvalError should trigger another repl session. // when that session returns the exception will land here. No need to show it again; // show the error for this repl session instead. - if (debuggerHook && !this->state->debugTraces.empty()) + if (debuggerHook && !this->state->debugTraces.empty()) showDebugTrace(std::cout, this->state->positions, this->state->debugTraces.front()); else printMsg(lvlError, e.msg()); @@ -511,7 +511,7 @@ bool NixRepl::processLine(std::string line) if (arg == "stack") { int idx = 0; for (auto iter = this->state->debugTraces.begin(); - iter != this->state->debugTraces.end(); + iter != this->state->debugTraces.end(); ++iter, ++idx) { std::cout << "\n" << ANSI_BLUE << idx << ANSI_NORMAL << ": "; showDebugTrace(std::cout, this->state->positions, *iter); @@ -519,7 +519,7 @@ bool NixRepl::processLine(std::string line) } else if (arg == "env") { int idx = 0; for (auto iter = this->state->debugTraces.begin(); - iter != this->state->debugTraces.end(); + iter != this->state->debugTraces.end(); ++iter, ++idx) { if (idx == this->debugTraceIndex) { @@ -539,7 +539,7 @@ bool NixRepl::processLine(std::string line) int idx = 0; for (auto iter = this->state->debugTraces.begin(); - iter != this->state->debugTraces.end(); + iter != this->state->debugTraces.end(); ++iter, ++idx) { if (idx == this->debugTraceIndex) { |