Commit d84e331
[wasm][debugger] Detect exception/error when calling runtime_invoke (#49498)
* Related to #49206.
When we call runtime_invoke on wasm the exception always returns NULL and the error returns OK.
This was a problem because we were trying to get value of this new static property in DateTime type:
private static ReadOnlySpan<byte> DaysInMonth365 => new byte[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
As we don't know that we were getting an exception, the value that returns to the test was wrong.
The goal of this PR is detect that we got an exception when running runtime_invoke and return the expected value to debugger.
This is a temporary solution, I think the final solution is to fix runtime_invoke to return exception correctly on WASM.
We also need to support it: https://github.com/dotnet/runtime/blob/b3411852caa6a3de8ab9fa27f7860c76ef43e384/src/mono/mono/metadata/object.c#L6298
* Fix compilation error
* Update src/mono/mono/mini/mini-wasm-debugger.c
Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>
* Adding comment as suggested by @lambdageek
Co-authored-by: Aleksey Kliger (λgeek) <[email protected]>1 parent fe8bc17 commit d84e331
File tree
3 files changed
+41
-5
lines changed- src/mono
- mono/mini
- wasm/debugger
- DebuggerTestSuite
- tests/debugger-test
3 files changed
+41
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
83 | 84 | | |
84 | 85 | | |
85 | 86 | | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| |||
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
317 | | - | |
| 319 | + | |
318 | 320 | | |
319 | 321 | | |
320 | 322 | | |
| |||
552 | 554 | | |
553 | 555 | | |
554 | 556 | | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
555 | 560 | | |
556 | 561 | | |
557 | 562 | | |
| |||
807 | 812 | | |
808 | 813 | | |
809 | 814 | | |
810 | | - | |
| 815 | + | |
811 | 816 | | |
812 | 817 | | |
813 | 818 | | |
| |||
1190 | 1195 | | |
1191 | 1196 | | |
1192 | 1197 | | |
1193 | | - | |
| 1198 | + | |
1194 | 1199 | | |
1195 | | - | |
| 1200 | + | |
1196 | 1201 | | |
1197 | | - | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
1198 | 1212 | | |
1199 | 1213 | | |
1200 | 1214 | | |
1201 | 1215 | | |
1202 | 1216 | | |
1203 | 1217 | | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
1204 | 1228 | | |
1205 | 1229 | | |
1206 | 1230 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
468 | 479 | | |
469 | 480 | | |
470 | 481 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
0 commit comments