-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[release/8.0-staging][mono][debugger] Fix decode_value_compute_size #97568
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 Detailsnull
|
| for (int i = 0; i < arraySize; i++) | ||
| { | ||
| inlineArray.Add(await sdbAgent.ValueCreator.CreateFixedArrayElement(cmdReader, elementType, $"{i}", token)); | ||
| } |
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.
nit: this could probably be a method that takes in the type details, and the array size to return inlineArray, avoiding the multiple the awaits too.
| } | ||
| else | ||
| { | ||
| cmdReader.BaseStream.Position-=sizeof(byte); |
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.
| cmdReader.BaseStream.Position-=sizeof(byte); | |
| cmdReader.BaseStream.Position -= sizeof(byte); |
| subtype: length.Rank == 1 ? "array" : null); | ||
| } | ||
|
|
||
| public async Task<JObject> CreateFixedArrayElement(MonoBinaryReader retDebuggerCmdReader, ElementType etype, string name, CancellationToken token) |
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.
This seems very similar to ReadAsVariableValue. Maybe the core of that method can be extracted (to skip the reading from the retDebuggerCmdReader) - and that method can be used by ReadAsVariableValue and CreateFixedArrayElement.
| ElementType etype = (ElementType)cmdReader.ReadByte(); | ||
| if (etype == (ElementType)ValueTypeId.FixedArray && writableFields.Count() == 1) | ||
| { | ||
| ElementType elementType = (ElementType)cmdReader.ReadByte(); |
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.
Which test type has this case?
jeffschwMSFT
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.
approved. we will take for consideration in 8.0.x
Backport of #97418 to release/8.0-staging
/cc @thaystg
Customer Impact
dotnet/android#8653
Avoid assertion on runtime while debugging.
Fix debugger experience when it's trying to evaluate an expression that has a value type with an object inside it like this:
Regression
This was introduced in this PR: #76332
Testing
Manually tested.
Also added a test case.
Risk
Medium risk, only reading the debugger buffer correctly.