-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[mono][debugger] Fix watch of local variable values #57771
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
Conversation
|
Tagging subscribers to this area: @thaystg Issue DetailsFixes dotnet/android#6161 In this case the index that come from debugger-libs is 0 but the correct index after reading pdb info is 1. That is why it was showing wrong variable value. The index that comes from icordbg is already the correct one read from pdb we don't need to "fix" it on runtime side.
|
|
is it only the 0 index that is off? |
|
No, if you have more than one local variable all of them will be wrong: It doesn't happen in all methods. I have tested in a lot of cases and couldn't reproduce, but today I found a code attached https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1366070/ and could reproduce. The code sample with variable |
|
|
|
so debugger libs is sending the 0-index index into the number of locals and icordbg is sending the index in the debug info? Is it ever off by anything other than 1? |
|
Here is where we read the correct index from pdb:
In some methods the variable 0 has index 0. And I don't know the reason. |
|
This PR is probably breaking webassembly that also sends the correct index. |
Not a static vs instance, thing, I guess? |
Fixing using protocol version.
lewing
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
Just for my understanding, this is a difference between debugger-libs+debugger-agent, and icordbg+debugger-agent? And wasm uses the latter, and what uses the former? Please correct me, if I have that wrong! |
In the older protocol we referenced the locals differently (always 0 indexed). That changed with icordbg support to match the index from the debug info but it wasn't noticed as a breaking change. This just makes that change explicit by marking it as a protocol change and handling the old behavior when appropriate. |
|
/backport to release/6.0-rc1 |
|
Started backporting to release/6.0-rc1: https://github.com/dotnet/runtime/actions/runs/1148746102 |
Fixes dotnet/android#6161
This was a side-effect of icordbg support implementation.
In this case the index that come from debugger-libs is 0 but the correct index after reading pdb info is 1. That is why it was showing wrong variable value.
The index that comes from icordbg is already the correct one read from pdb we don't need to "fix" it on runtime side.