Skip to content

[mono] [debugger] Fix string[][]#122935

Merged
thaystg merged 1 commit intomainfrom
dev/thays/fix_2649950_2633466
Jan 7, 2026
Merged

[mono] [debugger] Fix string[][]#122935
thaystg merged 1 commit intomainfrom
dev/thays/fix_2649950_2633466

Conversation

@thaystg
Copy link
Member

@thaystg thaystg commented Jan 6, 2026

Fix inspect obj.TestProperty

public class TestObject
{
    public string[][] TestProperty { get; set; } = [[], ["hi"]];
}
static void Main()
{
        TestObject obj = new TestObject();
        Console.WriteLine("hi"); // BP here
}

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @thaystg, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

@thaystg thaystg changed the title Fix string[][] using icordebug [mono] [debugger] Fix string[][] Jan 6, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an issue with debugging jagged arrays (specifically string[][]) when using the ICorDebug protocol. The fix adds support for properly returning type information for single-dimensional arrays (SZARRAY) containing arrays as elements.

Key changes:

  • Increments the debugger protocol minor version from 66 to 67 to track this enhancement
  • Adds logic to return element class type information for SZARRAY types when using ICorDebug with protocol version 2.67+

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/mono/mono/component/debugger-protocol.h Bumps protocol minor version to 67 to track the new SZARRAY handling capability
src/mono/mono/component/debugger-agent.c Adds conditional logic to buffer element class type ID for SZARRAY types when using ICorDebug

@thaystg
Copy link
Member Author

thaystg commented Jan 7, 2026

/ba-g known failures.

@thaystg thaystg merged commit 03e9110 into main Jan 7, 2026
71 of 76 checks passed
@thaystg
Copy link
Member Author

thaystg commented Jan 7, 2026

/backport to release/10.0

@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

Started backporting to release/10.0 (link to workflow run)

@jkotas jkotas deleted the dev/thays/fix_2649950_2633466 branch January 24, 2026 03:53
steveisok pushed a commit that referenced this pull request Jan 29, 2026
Backport of #122935 to release/10.0

/cc @thaystg

## Customer Impact

- [X] Customer reported
- [X] Found internally

This fix resolves an issue when debugging on mobile or wasm where
incorrect type parameters are returned while inspecting a
multidimensional array.

See also https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2633466

## Regression

- [ ] Yes
- [X] No

## Testing
Manually ran through VS before and after

## Risk
Low

**IMPORTANT**: If this backport is for a servicing release, please
verify that:

- For .NET 8 and .NET 9: The PR target branch is `release/X.0-staging`,
not `release/X.0`.
- For .NET 10+: The PR target branch is `release/X.0` (no `-staging`
suffix).

## Package authoring no longer needed in .NET 9

**IMPORTANT**: Starting with .NET 9, you no longer need to edit a NuGet
package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older
versions.

Co-authored-by: Thays Grazia <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants