MCPcopy Create free account
hub / github.com/GNOME/gjs / breakpointCommand

Function breakpointCommand

modules/script/_bootstrap/debugger.js:772–791  ·  view source on GitHub ↗
(where)

Source from the content-addressed store, hash-verified

770}
771
772function breakpointCommand(where) {
773 // Only handles line numbers of the current file
774 // TODO: make it handle function names and other files
775 const line = Number(where);
776 const possibleOffsets = findBreakpointOffsets(line, focusedFrame.script);
777
778 if (possibleOffsets.length === 0) {
779 print(`Unable to break at line ${where}`);
780 return;
781 }
782
783 possibleOffsets.forEach(({script, offsets}) => {
784 offsets.forEach(offset => {
785 const bp = new BreakpointHandler(breakpoints.length, script, offset);
786 script.setBreakpoint(offset, bp);
787 breakpoints.push(bp);
788 print(bp);
789 });
790 });
791}
792breakpointCommand.summary = 'Set breakpoint at the specified location.';
793breakpointCommand.helpText = `USAGE
794 break <line_num>

Callers

nothing calls this directly

Calls 1

findBreakpointOffsetsFunction · 0.85

Tested by

no test coverage detected