Open roblourens opened 4 years ago
copying @RafaelGSS who might be interested as well, as he is doing some research / work on this area.
I couldn't reproduce it on node v8.17.0
as well. However, in v16 using ^node:
in the ignore list looks working as expected. I know that this issue is old but, can you validate it? @roblourens
A different problem in v16, it stops on a line which it says is in the ignore list, and it should not stop there
Yes, same behavior here, however, I feel that it's expected? cc: @nodejs/inspector
Why would it be expected to step into an ignored file? It's been a long time since I worked on this stuff but I'm pretty sure I just expect it to step through the ignored stuff into the next line of user code
I'm saying it because in the newer versions we see that message as you showed above.
For instance, if you add a debugger in a file that is inside ignore-list
:
// example-blackbox.js
module.exports = {
doSomethingAsync: async () => {
debugger
console.log('Async done')
}
}
const { doSomethingAsync } = require('./example-blackbox')
async function main() {
await doSomethingAsync()
console.log('Done!')
}
main()
node inspect index.js
debug> Debugger.setBlackboxPatterns({ patterns: ['example-blackbox.js'] })
and the code is not reachable (as expected). So it might be an expected thing. Although, the step into
entering in an ignored script still looks like your example.
Have a script like
node --inspect-brk test.js
^(?!file:\/\/\/).*
. This should blackbox any script that does not start withfile:///
, and should blackbox all internal node scripts while allowing user scripts to be debuggedconsole.log
statementconsole.log
should be blackboxed and execution should continue to the next lineI am not sure whether this is node-specific but I wasn't able to come up with a repro in Chrome. It worked at least in Node 8.
If I set up other scenarios of stepping into node code with this blackbox pattern set, sometimes it works and sometimes I see other wrong behavior - it pauses in
internal/per_context/primordials.js
even though that script is marked as "This script is blackboxewd in debugger"