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

[wasm][debugger] Fix evaluate expression of mutidimensional array. #72964

Merged
merged 1 commit into from
Jul 28, 2022

Conversation

thaystg
Copy link
Member

@thaystg thaystg commented Jul 27, 2022

It was already working:

array[i]
array[i][j]

In this PR I'm implementing support to:
array[i,j]

Blazor Sample:

    private int currentCount = 0;
    int[][] jaggedArray = new int[][]
        {
            new int[] { 1, 3, 5, 7, 9 },
            new int[] { 0, 2, 4, 6 },
            new int[] { 11, 22 }
        };

    int[] array1D = new int[] { 1, 2, 3, 4, 5, 6 };
    int[,] array2D = new int[,] { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
    int[,] array2Da = new int[4, 2] { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
    string[,] array2Db = new string[3, 2] { { "one", "two" }, { "three", "four" },
                                        { "five", "six" } };

    int[,,] array3D = new int[,,] { { { 1, 2, 3 }, { 4, 5, 6 } },
                                 { { 7, 8, 9 }, { 10, 11, 12 } } };
    int[,,] array3Da = new int[2, 2, 3] { { { 1, 2, 3 }, { 4, 5, 6 } },
                                       { { 7, 8, 9 }, { 10, 11, 12 } } };

    private void IncrementCount()
    {
        currentCount++;
    }

image

Fixes #56021

@ghost
Copy link

ghost commented Jul 27, 2022

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

Issue Details

It was already working:

array[i]
array[i][j]

In this PR I'm implementing support to:
array[i,j]

Blazor Sample:

    private int currentCount = 0;
    int[][] jaggedArray = new int[][]
        {
            new int[] { 1, 3, 5, 7, 9 },
            new int[] { 0, 2, 4, 6 },
            new int[] { 11, 22 }
        };

    int[] array1D = new int[] { 1, 2, 3, 4, 5, 6 };
    int[,] array2D = new int[,] { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
    int[,] array2Da = new int[4, 2] { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } };
    string[,] array2Db = new string[3, 2] { { "one", "two" }, { "three", "four" },
                                        { "five", "six" } };

    int[,,] array3D = new int[,,] { { { 1, 2, 3 }, { 4, 5, 6 } },
                                 { { 7, 8, 9 }, { 10, 11, 12 } } };
    int[,,] array3Da = new int[2, 2, 3] { { { 1, 2, 3 }, { 4, 5, 6 } },
                                       { { 7, 8, 9 }, { 10, 11, 12 } } };

    private void IncrementCount()
    {
        currentCount++;
    }

image

Fixes #56021

Author: thaystg
Assignees: -
Labels:

area-Debugger-mono

Milestone: -

Copy link
Member

@ilonatommy ilonatommy left a comment

Choose a reason for hiding this comment

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

Works in VS both in watch and immediate window. Browser's watch if fine as well:
image

@thaystg thaystg merged commit d641668 into dotnet:main Jul 28, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 27, 2022
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.

[wasm] Cannot use array indexing expressions with VS immediate window
2 participants