mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 14:06:16 +02:00
Add documentation, rename to debugger-on-trace
This commit is contained in:
parent
4440eb54e7
commit
b111fba8cd
3 changed files with 17 additions and 4 deletions
|
@ -1,9 +1,9 @@
|
||||||
---
|
---
|
||||||
synopsis: Enter the `--debugger` when `builtins.trace` is called if `builtins-trace-debugger` is set
|
synopsis: Enter the `--debugger` when `builtins.trace` is called if `debugger-on-trace` is set
|
||||||
prs: 9914
|
prs: 9914
|
||||||
---
|
---
|
||||||
|
|
||||||
If the `builtins-trace-debugger` option is set and `--debugger` is given,
|
If the `debugger-on-trace` option is set and `--debugger` is given,
|
||||||
`builtins.trace` calls will behave similarly to `builtins.break` and will enter
|
`builtins.trace` calls will behave similarly to `builtins.break` and will enter
|
||||||
the debug REPL. This is useful for determining where warnings are being emitted
|
the debug REPL. This is useful for determining where warnings are being emitted
|
||||||
from.
|
from.
|
||||||
|
|
|
@ -128,8 +128,15 @@ struct EvalSettings : Config
|
||||||
Setting<unsigned int> maxCallDepth{this, 10000, "max-call-depth",
|
Setting<unsigned int> maxCallDepth{this, 10000, "max-call-depth",
|
||||||
"The maximum function call depth to allow before erroring."};
|
"The maximum function call depth to allow before erroring."};
|
||||||
|
|
||||||
Setting<bool> builtinsTraceDebugger{this, false, "builtins-trace-debugger",
|
Setting<bool> builtinsTraceDebugger{this, false, "debugger-on-trace",
|
||||||
"Whether to enter the debugger on `builtins.trace` calls."};
|
R"(
|
||||||
|
If set to true and the `--debugger` flag is given,
|
||||||
|
[`builtins.trace`](@docroot@/language/builtins.md#builtins-trace) will
|
||||||
|
enter the debugger like
|
||||||
|
[`builtins.break`](@docroot@/language/builtins.md#builtins-break).
|
||||||
|
|
||||||
|
This is useful for debugging warnings in third-party Nix code.
|
||||||
|
)"};
|
||||||
};
|
};
|
||||||
|
|
||||||
extern EvalSettings evalSettings;
|
extern EvalSettings evalSettings;
|
||||||
|
|
|
@ -1010,6 +1010,12 @@ static RegisterPrimOp primop_trace({
|
||||||
Evaluate *e1* and print its abstract syntax representation on
|
Evaluate *e1* and print its abstract syntax representation on
|
||||||
standard error. Then return *e2*. This function is useful for
|
standard error. Then return *e2*. This function is useful for
|
||||||
debugging.
|
debugging.
|
||||||
|
|
||||||
|
If the
|
||||||
|
[`debugger-on-trace`](@docroot@/command-ref/conf-file.md#conf-debugger-on-trace)
|
||||||
|
option is set to `true` and the `--debugger` flag is given, the
|
||||||
|
interactive debugger will be started when `trace` is called (like
|
||||||
|
[`break`](@docroot@/language/builtins.md#builtins-break)).
|
||||||
)",
|
)",
|
||||||
.fun = prim_trace,
|
.fun = prim_trace,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue