Skip to content

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

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions