Skip to content

[wasm][debugger] Fix OnFrameCall for methods on variable values  #65707

Closed

Description

@ilonatommy

Reproduction code:

	private void IncrementCount()
	{
		string str= "ab-cd";
                int num = 12;
	}

Evaluate in watch:
str -> "ab-cd" [OK]
str.ToString() -> [FAIL]
num -> 12 [OK]
num.ToString() -> [FAIL]

Source of the problem:
Exception is thrown here:

DotnetObjectId.TryParse(rootObject?["objectId"]?.Value<string>(), out DotnetObjectId objectId);

because we are not setting any ID for variable values here:
public async Task<JObject> CreateJObjectForVariableValue(MonoBinaryReader retDebuggerCmdReader, string name, bool isOwn, int typeIdFromAttribute, bool forDebuggerDisplayAttribute, CancellationToken token)

so the rootObject looks e.g. like this:

{{
  "type": "string",
  "value": "ab-cd",
  "description": "ab-cd"
}}

We need the variable ID to get the type of evaluated variable and see what methods it has to choose right method ID.

Activity

  1. ghost added
    untriaged
    on Feb 22, 2022
  2. self-assigned this
    on Feb 22, 2022
  3. added
    arch-wasm
    and removed
    untriaged
    on Feb 22, 2022
  4. changed the title [-][wasm][debugger] Fix OnFrameCall for methods on local variables [/-] [+][wasm][debugger] Fix OnFrameCall for methods on variable values [/+] on Feb 22, 2022
  5. radical commented on Feb 23, 2022

    @radical
    Member

    Some other cases where evaluation fails:

    1. int_arr.Length
    2. myList + "Asd" which returns
    {
      "type": "object",
      "description": "System.Collections.Generic.List<int>",
      "className": "System.Collections.Generic.List<int>",
      "subtype": "null"
    }Asd
    
    • note the Asd at the end too.
  6. ghost added
    in-pr
    on Mar 15, 2022
  7. ghost removed
    in-pr
    on May 13, 2022
  8. ghost locked as resolved and limited conversation to collaborators on Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

arch-wasmarea-Debugger-mono

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions