trepan-ni
Version:
Trepan debugger for Node Inspect (and based on node inspect debugger)
43 lines (32 loc) • 1.19 kB
JavaScript
// Copyright 2018 Rocky Bernstein
'use strict';
/*========================================
Debugger 'setBreakPoint' command.
==========================================*/
exports.Init = function(intf, repl) {
intf.defineCommand('setBreakpoint', repl, {
paused: false,
help: `set a breakpoint
Usage: **setBreakpoint** [*script*, [*line*, [*condition*, [*silent*]]])
**setBreakpoint** *function*()
You can set a breakpoint by either line number of function name.
When setting by a line number, the script name can be omitted and then
it is taken to be the current file loaded.
When setting by a function name, you must enclose the function quotes.
In order to give a condition on which to stop at, you must use the
Javascript function notation and enclose the condition in quotes.
Examples:
--------
break 10
break "gcd.js" 10
break "gcd()"
break('gcd.js', 10, "a > b")
See also:
---------
breakpoints, clear, delete
`,
aliases: ['sb', 'breakpoint', 'break', 'b'],
run: intf.setBreakpoint,
});
};