Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger does not step into correct function #127345

Closed
bpasero opened this issue Jun 28, 2021 · 10 comments
Closed

Debugger does not step into correct function #127345

bpasero opened this issue Jun 28, 2021 · 10 comments
Assignees
Labels
chromium Issues and items related to Chromium debug Debug viewlet, configurations, breakpoints, adapter issues papercut 🩸 A particularly annoying issue impacting someone on the team upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@bpasero
Copy link
Member

bpasero commented Jun 28, 2021

Steps:

  • run from main
  • open src/vs/workbench/services/editor/test/browser/editorService.test.ts
  • add a breakpoint into here
  • right click "Debug Test" in here
  • step into await openEditor(untypedEditor)

=> 🐛 you end up in a weird place

recording

@bpasero bpasero added debug Debug viewlet, configurations, breakpoints, adapter issues papercut 🩸 A particularly annoying issue impacting someone on the team labels Jun 28, 2021
@bpasero bpasero added the important Issue identified as high-priority label Jun 29, 2021
@bpasero
Copy link
Member Author

bpasero commented Jun 29, 2021

Since this makes me stop wanting to use debug in VSCode, marking as important selfhosting blocker.

@bpasero
Copy link
Member Author

bpasero commented Jun 29, 2021

I think this may reproduce in devtools too, so lowering severity.

@connor4312
Copy link
Member

connor4312 commented Jul 6, 2021

I can reproduce this consistently as well. It seems to be a "vanilla" behavior of the version of V8 in Electron. I don't think this is feasible to correct for in the debugger, we'd need to do source analysis and manually set a breakpoint where the function exists (and that will fail if TS doesn't know where the function is declared).

However, I don't reproduce it when running the test in real (modern) Chrome. With the introduction of test run configurations in #127096 (comment), I'll have an option to run unit tests in browser to avoid this issue.

cc @deepak1556 fyi. You can close this if you don't plan to take any action here (other than pulling in Electron updates)

@connor4312 connor4312 assigned deepak1556 and unassigned connor4312 Jul 6, 2021
@deepak1556
Copy link
Collaborator

@connor4312 which version of chrome did you test with ? Also what are the minimal steps to test this on the web, I can bisect the chrome CL that fixed it and if its minimal will backport to our current version.

@connor4312
Copy link
Member

I tested with Chrome 91, by:

  1. Modify line 149 in test/unit/browser/index.js to read const browser = await playwright[browserType].launch({ headless: !Boolean(argv.debug), devtools: Boolean(argv.debug) }); (open the devtools)
  2. Add a debugger; statement before the openEditor line so you pause there
  3. yarn test-browser --browser chromium --run .\out\vs\workbench\services\editor\test\browser\editorGroupsService.test.ts --debug
  4. Try to step into the openEditor line that Ben showed

@deepak1556
Copy link
Collaborator

@connor4312 the issue does not repro in chromium 89 (current runtime of vscode insiders), can you confirm if my steps are correct recording.gif.zip

You can download version 89 from https://commondatastorage.googleapis.com/chromium-browser-snapshots/Mac/843806/chrome-mac.zip

@connor4312
Copy link
Member

connor4312 commented Jul 9, 2021

Okay, sorry, it actually works with stepping, just not breakpoints. Updated instructions:

  1. Add a debugger; statement before the openEditor line so you pause there
  2. yarn test-browser --browser chromium --run .\out\vs\workbench\services\editor\test\browser\editorGroupsService.test.ts --debug
  3. After you hit the debugger, add a breakpoint on the next line
  4. Continue
  5. Step in
  6. Land in the wrong place

The bad news is that, with these fixed instructions, I can also reproduce it on modern Chrome 🙁

@connor4312
Copy link
Member

I opened a bug for this here: https://bugs.chromium.org/p/chromium/issues/detail?id=1227841

@deepak1556
Copy link
Collaborator

Great, thanks!

@connor4312 connor4312 added upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream labels Jul 9, 2021
@deepak1556 deepak1556 added the chromium Issues and items related to Chromium label Jul 12, 2021
@piyushsoni
Copy link

Just FYI, the Chromium bug has been closed as they want a reproducible test case inside Chromium and not in VS Code.

@deepak1556 deepak1556 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
chromium Issues and items related to Chromium debug Debug viewlet, configurations, breakpoints, adapter issues papercut 🩸 A particularly annoying issue impacting someone on the team upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

4 participants