Skip to content

VSCode doesn't stepin into debug function but is left outside #1788

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

Closed
PrzemyslawKlys opened this issue Mar 13, 2019 · 10 comments
Closed

VSCode doesn't stepin into debug function but is left outside #1788

PrzemyslawKlys opened this issue Mar 13, 2019 · 10 comments

Comments

@PrzemyslawKlys
Copy link
Contributor

System Details

System Details Output

### VSCode version: 1.32.1 05f146c7a8f7f78e80261aa3b2a2e642586f9eb3 x64

### VSCode extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]


### PSES version: 1.11.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.17763.316
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

Since some time (most likely on an upgrade of VSCode to the last version) I'm having a hard time debugging multi-file modules. You set a breakpoint in a function in 1 file, run the debug in the .ps1 somewhere else and breakpoint stops correctly but you are shown it stopped on the function executing it, not the breakpoint part. The data is also incorrect at that stage (or hidden) and you have to try and find it.

I am not sure if it has been reported before, I saw this on twitter a few days ago and confirmed with at least 1 other person experiencing this.

And to be honest it doesn't always happen. It happens randomly.

I'll try to catch it with some screenshots next time it happens

@ChuckHeatherly
Copy link

ChuckHeatherly commented Mar 13, 2019

Can you look at this VS code issue and see if it's the same one? I'm not sure if it's the right one because other issues are mentioned in the comments but it's the first one I found when it was happening to me last month. I'm using VS Code on Linux btw.
microsoft/vscode#68277

@PrzemyslawKlys
Copy link
Contributor Author

Looks like it. Usually, for me, it looks like this. It hit a breakpoint on line 120 but it's showing function which called it first. Like call stack moved up.

image

This screenshot was prepared by me where I moved call stack manually but often I would get that in an automated, repeated way.

@ChuckHeatherly
Copy link

For me, the breakpoint is in a different file than the one that I launch (I include the other file using the dot operator). So I have to chase down the other file in the call stack window, usually by clicking the top entry.

@PrzemyslawKlys
Copy link
Contributor Author

That's what I have. I have Example file called .ps1 which calls module which is built from multiple .ps1 files that I'm debugging. But the thing is it works now for me. So it's a bit random.

@TylerLeonhardt
Copy link
Member

Are these files that it's suppose to jump to outside of your workspace?

@ChuckHeatherly
Copy link

No, all my files are in the same workspace.

@PrzemyslawKlys
Copy link
Contributor Author

No, in my case it's 1 workspace.

Import-Module .\PSWriteHTML.psd1 -Force
$Processes = Get-Process | Select -First 5

To get it to work I'm using Import-Module as above.

@rkeithhill
Copy link
Contributor

@PrzemyslawKlys If it happens again, be sure to attach your log files and let us know the name of the file you were having issues stepping into.

@PrzemyslawKlys
Copy link
Contributor Author

image
1552854938-403f744b-cd4a-4128-9744-a29c9ae8fa7d1552854936220.zip

Sorry for very large picture.

@rkeithhill
Copy link
Contributor

Duplicate of #1750 This has been fixed (due in the next release) and a workaround is discussed in that issue.

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

No branches or pull requests

5 participants