Uh oh!
There was an error while loading. Please reload this page.
[mono][debugger] Fix watch of local variable values - #57771
Conversation
ghost
commented
Aug 19, 2021
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.
|
lewing
commented
Aug 19, 2021
is it only the 0 index that is off? |
thaystg
commented
Aug 19, 2021
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 |
lambdageek
commented
Aug 19, 2021
|
Uh oh!
There was an error while loading. Please reload this page.
thaystg
commented
Aug 19, 2021
|
lewing
commented
Aug 19, 2021
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? |
thaystg
commented
Aug 19, 2021
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. |
radical
commented
Aug 19, 2021
Not a static vs instance, thing, I guess? |
Fixing using protocol version.
Uh oh!
There was an error while loading. Please reload this page.
radical
commented
Aug 19, 2021
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. |
thaystg
commented
Aug 19, 2021
/backport to release/6.0-rc1 |
Started backporting to release/6.0-rc1: https://github.com/dotnet/runtime/actions/runs/1148746102 |
Fixesdotnet/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.