mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
refactor: Extract EvalState::{runDebugRepl,canDebug}
This commit is contained in:
parent
da82d67022
commit
c07500e14d
4 changed files with 37 additions and 15 deletions
|
@ -785,6 +785,24 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
bool EvalState::canDebug()
|
||||
{
|
||||
return debugRepl && !debugTraces.empty();
|
||||
}
|
||||
|
||||
void EvalState::runDebugRepl(const Error * error)
|
||||
{
|
||||
if (!canDebug())
|
||||
return;
|
||||
|
||||
assert(!debugTraces.empty());
|
||||
const DebugTrace & last = debugTraces.front();
|
||||
const Env & env = last.env;
|
||||
const Expr & expr = last.expr;
|
||||
|
||||
runDebugRepl(error, env, expr);
|
||||
}
|
||||
|
||||
void EvalState::runDebugRepl(const Error * error, const Env & env, const Expr & expr)
|
||||
{
|
||||
// Make sure we have a debugger to run and we're not already in a debugger.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue