aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd/repl.cc
diff options
context:
space:
mode:
authorBen Burdette <bburdette@protonmail.com>2022-05-22 21:45:24 -0600
committerBen Burdette <bburdette@protonmail.com>2022-05-22 21:45:24 -0600
commit13d02af0799f5d2f7a53825936d587e22edcacb6 (patch)
tree171eafe55521519d5b821aa7bec083cd2d1aa4ed /src/libcmd/repl.cc
parent7ccb2700c0401c553631e07aeb49e08f976274a3 (diff)
remove redundant 'debugMode' flag
Diffstat (limited to 'src/libcmd/repl.cc')
-rw-r--r--src/libcmd/repl.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc
index d335a56cd..940a287c7 100644
--- a/src/libcmd/repl.cc
+++ b/src/libcmd/repl.cc
@@ -280,7 +280,7 @@ void NixRepl::mainLoop(const std::vector<std::string> & files)
// 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 (state.debugMode && !state.debugTraces.empty())
+ if (state.debugRepl && !state.debugTraces.empty())
showDebugTrace(std::cout, state.positions, state.debugTraces.front());
else
printMsg(lvlError, e.msg());
@@ -493,7 +493,7 @@ bool NixRepl::processLine(std::string line)
<< " :log <expr> Show logs for a derivation\n"
<< " :te [bool] Enable, disable or toggle showing traces for errors\n"
;
- if (state.debugMode) {
+ if (state.debugRepl) {
std::cout
<< "\n"
<< " Debug mode commands\n"
@@ -508,14 +508,14 @@ bool NixRepl::processLine(std::string line)
}
- else if (state.debugMode && (command == ":bt" || command == ":backtrace")) {
+ else if (state.debugRepl && (command == ":bt" || command == ":backtrace")) {
for (const auto & [idx, i] : enumerate(state.debugTraces)) {
std::cout << "\n" << ANSI_BLUE << idx << ANSI_NORMAL << ": ";
showDebugTrace(std::cout, state.positions, i);
}
}
- else if (state.debugMode && (command == ":env")) {
+ else if (state.debugRepl && (command == ":env")) {
for (const auto & [idx, i] : enumerate(state.debugTraces)) {
if (idx == debugTraceIndex) {
printEnvBindings(state, i.expr, i.env);
@@ -524,7 +524,7 @@ bool NixRepl::processLine(std::string line)
}
}
- else if (state.debugMode && (command == ":st")) {
+ else if (state.debugRepl && (command == ":st")) {
try {
// change the DebugTrace index.
debugTraceIndex = stoi(arg);
@@ -542,13 +542,13 @@ bool NixRepl::processLine(std::string line)
}
}
- else if (state.debugMode && (command == ":s" || command == ":step")) {
+ else if (state.debugRepl && (command == ":s" || command == ":step")) {
// set flag to stop at next DebugTrace; exit repl.
state.debugStop = true;
return false;
}
- else if (state.debugMode && (command == ":c" || command == ":continue")) {
+ else if (state.debugRepl && (command == ":c" || command == ":continue")) {
// set flag to run to next breakpoint or end of program; exit repl.
state.debugStop = false;
return false;