mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
print value in break
This commit is contained in:
parent
412d58f0bb
commit
3ddf864e1b
2 changed files with 7 additions and 2 deletions
|
@ -712,12 +712,13 @@ static RegisterPrimOp primop_genericClosure(RegisterPrimOp::Info {
|
|||
|
||||
static RegisterPrimOp primop_break({
|
||||
.name = "break",
|
||||
.args = {},
|
||||
.args = {"v"},
|
||||
.doc = R"(
|
||||
In debug mode, pause Nix expression evaluation and enter the repl.
|
||||
)",
|
||||
.fun = [](EvalState & state, const Pos & pos, Value * * args, Value & v)
|
||||
{
|
||||
std::cout << "primop_break, value: " << *args[0] << std::endl;
|
||||
// PathSet context;
|
||||
// string s = state.coerceToString(pos, *args[0], context);
|
||||
if (debuggerHook && !state.debugTraces.empty())
|
||||
|
@ -728,6 +729,9 @@ static RegisterPrimOp primop_break({
|
|||
// const Env &env;
|
||||
// hintformat hint;
|
||||
debuggerHook(nullptr, dt.env, dt.expr);
|
||||
|
||||
// returning the value we were passed.
|
||||
v = *args[0];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue