mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 10:15:07 +08:00
This option provides a new way of terminating the probing by specifying a limit for the per-probe hit evaluation. When any probe reaches the limit, the session removes the V8 breakpoints and finishes with a `completed` terminal event rather than waiting for the target to exit or timeout. This would be useful when we provide a way to attach to and probe a running process in the future. Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com> PR-URL: https://github.com/nodejs/node/pull/63704 Refs: https://github.com/nodejs/node/issues/63646 Reviewed-By: Jan Martin <jan.krems@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
37 lines
856 B
JavaScript
37 lines
856 B
JavaScript
// This tests that a limited probe that is never reached is still reported as a missed probe.
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
common.skipIfInspectorDisabled();
|
|
|
|
const fixtures = require('../common/fixtures');
|
|
const { spawnSyncAndAssert } = require('../common/child_process');
|
|
const { assertProbeJson } = require('../common/debugger-probe');
|
|
|
|
const cwd = fixtures.path('debugger');
|
|
|
|
spawnSyncAndAssert(process.execPath, [
|
|
'inspect',
|
|
'--json',
|
|
'--probe', 'probe-miss.js:99',
|
|
'--expr', '42',
|
|
'--max-hit', '3',
|
|
'probe-miss.js',
|
|
], { cwd }, {
|
|
stdout(output) {
|
|
assertProbeJson(output, {
|
|
v: 2,
|
|
probes: [{
|
|
expr: '42',
|
|
target: { suffix: 'probe-miss.js', line: 99 },
|
|
maxHit: 3,
|
|
}],
|
|
results: [{
|
|
event: 'miss',
|
|
pending: [0],
|
|
}],
|
|
});
|
|
},
|
|
trim: true,
|
|
});
|