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 info is incorrect for shadowed bindings #3704

Closed
tldrlol opened this issue Oct 7, 2017 · 10 comments
Closed

Debugger info is incorrect for shadowed bindings #3704

tldrlol opened this issue Oct 7, 2017 · 10 comments
Labels
Area-Debug stepping, debug points, stacks and more Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. Ready
Milestone

Comments

@tldrlol
Copy link

tldrlol commented Oct 7, 2017

Repro steps

On a windows 10, fresh VS2017 install

[<EntryPoint>]
let main _ =
  let x = 42
  let x = 7
  printfn "%d" x // breaking on this line, watch and tooltip say x=42
  0

illustrated

Expected behavior

Tooltip will display x value of shadowing binding.

Actual behavior

Tooltip displays x value of shadowed binding.

@realvictorprm
Copy link
Contributor

realvictorprm commented Oct 7, 2017 via email

@drvink
Copy link
Contributor

drvink commented Oct 7, 2017

Adding refs: possibly same bug as #3141, possibly fixed in #3561

And some pretty pictures, just in case it's not the same bug:

vs2015:

vs2015-debug

vs2017.3:

vs2017-debug

@vasily-kirichenko
Copy link
Contributor

Rider has similar (but not the same on .NET Core projects) issues, I created a bug report https://youtrack.jetbrains.com/issue/RIDER-10227

/cc @auduchinok

@vasily-kirichenko
Copy link
Contributor

.NET Core 2.0 in Ionide:

1

@dsyme dsyme added Area-Debug stepping, debug points, stacks and more Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. labels Oct 13, 2017
@dsyme
Copy link
Contributor

dsyme commented Oct 13, 2017

@cartermp I presume we need our own debug engine for this in VS. Unless we restrict the range of the first local. Perhaps we could reverse the order we emit locals or the like, though I don't think there's any perfect solution

@cartermp cartermp added this to the 16.0 milestone Aug 29, 2018
@BentTranberg
Copy link

Stumbled on this right now. Note that the types doesn't have to be equal for this problem to arise, and in my case it was an argument to the function that was shadowed with a local.

@cartermp cartermp modified the milestones: 16.0, 16.1 Feb 21, 2019
@vasily-kirichenko
Copy link
Contributor

Still an issue in 2019 RC.4

1

@cartermp cartermp modified the milestones: 16.1, 16.2 Apr 23, 2019
@cartermp cartermp modified the milestones: 16.2, Backlog Apr 30, 2019
@2BitSalute
Copy link

I just encountered this in VS Code with Core debugger. Wasted at least an hour thinking that the API I was calling wasn't modifying the value.

@JordanMarr
Copy link

I chased my tail for a bit on this one last night (VS v16.9.0).

@dsyme dsyme changed the title Debugger tooltip/watch shows wrong info in conjunction with shadowed bindings Debugger info is incorrect for shadowed bindings Aug 23, 2021
@dsyme dsyme added the Ready label Aug 23, 2021
@dsyme
Copy link
Contributor

dsyme commented Aug 25, 2021

Fixed and in main

@dsyme dsyme closed this as completed Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Debug stepping, debug points, stacks and more Bug Impact-Medium (Internal MS Team use only) Describes an issue with moderate impact on existing code. Ready
Projects
None yet
Development

No branches or pull requests

9 participants