[wasm][debugger] Support calling get_Item passing decimal, float or double as parameter. - #90260
Conversation
|
Tagging subscribers to this area: @thaystg |
| else if (expected == ElementType.R8) | ||
| Write(expected, objValue["value"].Value<double>()); | ||
| else | ||
| Write(expected, objValue["value"].Value<int>()); |
There was a problem hiding this comment.
If we cast then we probably need all cases:
- ElementType.I2,
- ElementType.I4,
- ElementType.I8,
- ElementType.R4,
- ElementType.R8,
- ElementType.U2,
- ElementType.U4,
- ElementType.U8.
Or..let's test if adding tests with them won't throw here, maybe cast to int to all other cases is enough.
| ("f[shortString]", TBool(false)), | ||
| ("f[aFloat]", TNumber(1)), | ||
| ("f[aDouble]", TNumber(2)), | ||
| ("f[aDecimal]", TNumber(3)) // object |
There was a problem hiding this comment.
Tests corresponding to the comment in MonoSDBHelper.
| return false; | ||
| break; | ||
| default: | ||
| return true; |
There was a problem hiding this comment.
We're missing on this list:
- ElementType.U1,
- ElementType.Ptr,
- ElementType.I1,
- ElementType.ValueType,
- ElementType.Ptr,
- ElementType.Void,
|
|
||
| var signature = methodDef.Signature; | ||
| var sigReader = Assembly.asmMetadataReader.GetBlobReader(signature); | ||
| var decoder = new SignatureDecoder<ElementType, object>(_signatureTypeProvider, Assembly.asmMetadataReader, genericContext: null); |
There was a problem hiding this comment.
genericContext: null - 👍 for adding the param name!
get_Item passing decimal, float or double as parameter.
| return false; | ||
| break; | ||
| case ElementType.Char: | ||
| if (parameterType != "string" && parameterType != "symbol") |
There was a problem hiding this comment.
Does this also need a == "object" check?
| } | ||
| } | ||
|
|
||
| private static bool CheckParametersCompatibility(ElementType? typeCode, JObject value) |
| var parameterType = value["type"]?.Value<string>(); | ||
| var parameterClassName = value["className"]?.Value<string>(); | ||
|
|
||
| switch (typeCode.Value) |
There was a problem hiding this comment.
Do IIUC that we are checking if value can be passed as an argument to a method with parameter type typeCode?
| case ElementType.Object: | ||
| if (parameterType != "object") | ||
| return false; |
There was a problem hiding this comment.
Do IIUC that we are checking if value can be passed as an argument to a method with parameter type typeCode?
If so, then shouldn't param type == object accept anything?
There was a problem hiding this comment.
If a method is expecting an object, can we call it passing a integer? I don't think so.
| var parameterType = value["type"]?.Value<string>(); | ||
| var parameterClassName = value["className"]?.Value<string>(); |
There was a problem hiding this comment.
Should these instead be argumentType, and argumentClassName?
Co-authored-by: Ankit Jain <radical@gmail.com>
|
/azp run runtime-wasm-dbgtests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Fixes #76014