Skip to content
This repository has been archived by the owner on Oct 2, 2021. It is now read-only.

Breakpoints sometimes don't get hit #536

Open
eamodio opened this issue Nov 5, 2019 · 3 comments
Open

Breakpoints sometimes don't get hit #536

eamodio opened this issue Nov 5, 2019 · 3 comments
Assignees

Comments

@eamodio
Copy link

eamodio commented Nov 5, 2019

I was doing a lot of debugging the other night and I kept running into issue where I'd set a breakpoint (and it would show in the UI as red), but the debugger wouldn't stop at that point. And if I reset (clear/add) the BP, then it would get hit. This happened quite a few times, but unfortunately I don't have any logs or anything to provide here. I was debugging both vscode itself and an extension and I saw the behavior in both.

@roblourens
Copy link
Member

Would be helpful if you can get a log. You can set "trace": true and run with that all the time. Then when you see the bug, share the log and tell me what you were doing.

@eamodio
Copy link
Author

eamodio commented Nov 27, 2019

I haven't see this same behavior in a while, but related behavior is setting BP that seemingly get set, but are apparently set in the completely wrong sourcemap location.

Here is my log: vscode-node-debug2.zip

2019-11-27, 22:17:23.449 UTC
[22:17:23.450 UTC] OS: win32 x64
[22:17:23.450 UTC] Adapter node: v12.4.0 x64
[22:17:23.450 UTC] vscode-chrome-debug-core: 6.8.5
[22:17:23.450 UTC] node-debug2: 1.41.0
...
[22:17:45.443 UTC] → To target: "{\"id\":66,\"method\":\"Debugger.setBreakpointByUrl\",\"params\":{\"urlRegex\":\"file:\\\\/\\\\/\\\\/[Cc]:\\\\/Users\\\\/Eric\\\\/\\\\.vscode-insiders\\\\/extensions\\\\/eamodio\\\\.toggle-excluded-files-1\\\\.7\\\\.0\\\\/dist\\\\/extension\\\\.js\",\"lineNumber\":0,\"columnNumber\":11667}}"
[22:17:45.443 UTC] ← From target: {"id":63,"result":{"locations":[{"scriptId":"276","lineNumber":0,"columnNumber":11667,"type":"call"}]}}
[22:17:45.443 UTC] ← From target: {"id":64,"result":{"locations":[]}}
[22:17:45.443 UTC] SourceMaps.setBP: Mapped c:\Users\Eric\.vscode-insiders\extensions\eamodio.toggle-excluded-files-1.7.0\dist\extension.js:1:11668 to c:\Users\Eric\code\eamodio\vscode-gitlens\src\system\promise.ts:27
[22:17:45.443 UTC] To client: {"seq":0,"type":"response","request_seq":19,"command":"breakpointLocations","success":true,"body":{"breakpoints":[{"line":27,"column":4}]}}
[22:17:45.443 UTC] To client: {"seq":0,"type":"response","request_seq":20,"command":"breakpointLocations","success":true,"body":{"breakpoints":[]}}
[22:17:45.443 UTC] To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/breakpointLocations","data":{"Versions.DebugAdapterCore":"6.8.5","Versions.DebugAdapter":"1.41.0","Versions.Target.Version":"v12.4.0","successful":"true","timeTakenInMilliseconds":"38.507599","requestType":"request"}}}
[22:17:45.443 UTC] To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/breakpointLocations","data":{"Versions.DebugAdapterCore":"6.8.5","Versions.DebugAdapter":"1.41.0","Versions.Target.Version":"v12.4.0","successful":"true","timeTakenInMilliseconds":"37.4453","requestType":"request"}}}
[22:17:45.473 UTC] ← From target: {"id":65,"result":{"breakpointId":"2:0:11667:file:\\/\\/\\/[Cc]:\\/Users\\/Eric\\/\\.vscode-insiders\\/extensions\\/eamodio\\.toggle-excluded-files-1\\.7\\.0\\/dist\\/extension\\.js","locations":[{"scriptId":"276","lineNumber":0,"columnNumber":11667}]}}
[22:17:45.474 UTC] ← From target: {"error":{"code":-32000,"message":"Breakpoint at specified location already exists."},"id":66}
[22:17:45.474 UTC] SourceMaps.setBP: Mapped c:\Users\Eric\.vscode-insiders\extensions\eamodio.toggle-excluded-files-1.7.0\dist\extension.js:1:11668 to c:\Users\Eric\code\eamodio\vscode-gitlens\src\system\promise.ts:27
[22:17:45.474 UTC] SourceMaps.setBP: Mapped c:\Users\Eric\.vscode-insiders\extensions\eamodio.toggle-excluded-files-1.7.0\dist\extension.js:1:11668 to c:\Users\Eric\code\eamodio\vscode-gitlens\src\system\promise.ts:27
[22:17:45.474 UTC] To client: {"seq":0,"type":"response","request_seq":18,"command":"setBreakpoints","success":true,"body":{"breakpoints":[{"id":1002,"verified":true,"line":27,"column":4},{"id":1004,"verified":true,"line":27,"column":4}]}}
[22:17:45.474 UTC] To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/setBreakpoints","data":{"Versions.DebugAdapterCore":"6.8.5","Versions.DebugAdapter":"1.41.0","Versions.Target.Version":"v12.4.0","successful":"true","timeTakenInMilliseconds":"84.505301","requestType":"request"}}}
[22:17:45.507 UTC] From client: breakpointLocations({"source":{"name":"promise.ts","path":"c:\\Users\\Eric\\code\\eamodio\\vscode-gitlens\\src\\system\\promise.ts"},"line":27})
[22:17:45.507 UTC] SourceMaps.setBP: Mapped c:\Users\Eric\code\eamodio\vscode-gitlens\src\system\promise.ts to c:\Users\Eric\.vscode-insiders\extensions\eamodio.toggle-excluded-files-1.7.0\dist\extension.js
[22:17:45.507 UTC] SourceMaps.setBP: Mapped c:\Users\Eric\code\eamodio\vscode-gitlens\src\system\promise.ts:27:1 to c:\Users\Eric\.vscode-insiders\extensions\eamodio.toggle-excluded-files-1.7.0\dist\extension.js:1:11667
[22:17:45.507 UTC] SourceMaps.setBP: Mapped c:\Users\Eric\code\eamodio\vscode-gitlens\src\system\promise.ts to c:\Users\Eric\.vscode-insiders\extensions\eamodio.toggle-excluded-files-1.7.0\dist\extension.js
[22:17:45.507 UTC] SourceMaps.setBP: Mapped c:\Users\Eric\code\eamodio\vscode-gitlens\src\system\promise.ts:28:1 to c:\Users\Eric\.vscode-insiders\extensions\eamodio.toggle-excluded-files-1.7.0\dist\extension.js:1:11676
[22:17:45.508 UTC] Paths.setBP: Resolved c:\Users\Eric\.vscode-insiders\extensions\eamodio.toggle-excluded-files-1.7.0\dist\extension.js to file:///c:/Users/Eric/.vscode-insiders/extensions/eamodio.toggle-excluded-files-1.7.0/dist/extension.js
[22:17:45.508 UTC] → To target: "{\"id\":67,\"method\":\"Debugger.getPossibleBreakpoints\",\"params\":{\"start\":{\"scriptId\":\"276\",\"lineNumber\":0,\"columnNumber\":11666},\"end\":{\"scriptId\":\"276\",\"lineNumber\":0,\"columnNumber\":11675},\"restrictToFunction\":false}}"
[22:17:45.508 UTC] ← From target: {"id":67,"result":{"locations":[{"scriptId":"276","lineNumber":0,"columnNumber":11667,"type":"call"}]}}
[22:17:45.508 UTC] SourceMaps.setBP: Mapped c:\Users\Eric\.vscode-insiders\extensions\eamodio.toggle-excluded-files-1.7.0\dist\extension.js:1:11668 to c:\Users\Eric\code\eamodio\vscode-gitlens\src\system\promise.ts:27
[22:17:45.508 UTC] To client: {"seq":0,"type":"response","request_seq":21,"command":"breakpointLocations","success":true,"body":{"breakpoints":[{"line":27,"column":4}]}}
[22:17:45.508 UTC] To client: {"seq":0,"type":"event","event":"output","body":{"category":"telemetry","output":"ClientRequest/breakpointLocations","data":{"Versions.DebugAdapterCore":"6.8.5","Versions.DebugAdapter":"1.41.0","Versions.Target.Version":"v12.4.0","successful":"true","timeTakenInMilliseconds":"0.994499","requestType":"request"}}}

In there you can see that it mapped from one of my other extensions to gitlens:

[22:17:45.508 UTC] SourceMaps.setBP: Mapped c:\Users\Eric\.vscode-insiders\extensions\eamodio.toggle-excluded-files-1.7.0\dist\extension.js:1:11668 to c:\Users\Eric\code\eamodio\vscode-gitlens\src\system\promise.ts:27

@roblourens
Copy link
Member

Yeah, we don't have the concept of multiple "projects" with sourcemaps resolved independently, so this can happen, especially with webpack paths that lose context. But connor used a different strategy in vscode-pwa and it should actually be fixed there though!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants