You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LocalVariables integration - debugger no longer works when enabled #13414
Process is paused, and can step into/over/resume the execution
Actual Result
Process appears to pause for a millisecond and then immediately resumed.
I believe this is because the LocalVariablesAsync integration will resume all breakpoints immediately.
This does not appear to be documented anywhere. Is this expected behaviour?
I'm hoping with the digging I've done to root cause these it shouldn't require a high effort repro example -- but if it's needed I can create one (it'll just take me some time that I don't immediately have).
explore whether we can avoid adding or enabling the integration when another inspector session is attached to the process.
I think the main issue is that this would only work when using --inspect-brk, where the inspector is already attached when the integration is started.
When the Chrome debugger is attached, it auto sends some commands which we might be able to detect from the responses that are sent to all connected clients.
It's likely possible, I just can't find a specific debugger event for new debug connections. We'd have to watch for responses that indicate a new connection has been made and these are specific responses to what the debugger sends on connection. This can vary slightly depending on how the debugger is configured.
We could check process.execArgv for --inspect which would cover a lot of cases. It's still possible to enable the debugger via thge inspector api but I suspect this is rarely used for manual debugging.
disable the integration outright at startup if it sees the --inspect flag?
Yep, that would be the easiest solution.
There is a Debugger.detached event but unfortunately nothing for attached. When a new debugger connects we see repeated Debugger.scriptParsed events so we could also use those.
Activity
bruno-dasilva commentedon Aug 18, 2024
I'm hoping with the digging I've done to root cause these it shouldn't require a high effort repro example -- but if it's needed I can create one (it'll just take me some time that I don't immediately have).
Lms24 commentedon Aug 19, 2024
Hey @bruno-dasilva thanks for writing in!
We'll look into your issue next week as this week is Hackweek at Sentry (see #13421).
lforst commentedon Aug 26, 2024
@bruno-dasilva your assumption is correct in that the integration immediately continues execution when a breakpoint is hit.
includeLocalVariablessentry-docs#11138)timfish commentedon Aug 27, 2024
I think the main issue is that this would only work when using
--inspect-brk, where the inspector is already attached when the integration is started.When the Chrome debugger is attached, it auto sends some commands which we might be able to detect from the responses that are sent to all connected clients.
lforst commentedon Aug 27, 2024
I wonder if we could listen for new sessions to connect in any way and then dynamically disable the integration. 🤔
timfish commentedon Aug 27, 2024
It's likely possible, I just can't find a specific debugger event for new debug connections. We'd have to watch for responses that indicate a new connection has been made and these are specific responses to what the debugger sends on connection. This can vary slightly depending on how the debugger is configured.
1 remaining item
timfish commentedon Aug 27, 2024
We could check
process.execArgvfor--inspectwhich would cover a lot of cases. It's still possible to enable the debugger via thgeinspectorapi but I suspect this is rarely used for manual debugging.bruno-dasilva commentedon Aug 27, 2024
You mean disable the integration outright at startup if it sees the
--inspectflag?timfish commentedon Aug 27, 2024
Yep, that would be the easiest solution.
There is a
Debugger.detachedevent but unfortunately nothing for attached. When a new debugger connects we see repeatedDebugger.scriptParsedevents so we could also use those.github-actions commentedon Dec 13, 2024
A PR closing this issue has just been released 🚀
This issue was referenced by PR #14643, which was included in the 8.45.0 release.