+ also debug print structured try..catch and try..delegate blocks

This commit is contained in:
Nikolay Nikolov 2023-10-05 20:37:55 +03:00
parent 84f0b94549
commit 3a85a5a9cf

View File

@ -1716,8 +1716,32 @@ implementation
WriteTree(tai_wasmstruc_if(hp).else_asmlist);
writer.AsmWriteLn('.err } endif');
end
else if hp is tai_wasmstruc_try then
begin
writer.AsmWriteLn('.err try {');
WriteTree(tai_wasmstruc_try(hp).try_asmlist);
if hp is tai_wasmstruc_try_catch then
with tai_wasmstruc_try_catch(hp) do
begin
for i:=low(catch_list) to high(catch_list) do
begin
writer.AsmWriteLn('.err catch');
WriteTree(catch_list[i].asmlist);
end;
if assigned(catch_all_asmlist) then
begin
writer.AsmWriteLn('.err catch_all');
WriteTree(catch_all_asmlist);
end;
writer.AsmWriteLn('.err } end try');
end
else if hp is tai_wasmstruc_try_delegate then
writer.AsmWriteLn('.err } delegate')
else
writer.AsmWriteLn('.err unknown try structured instruction: ' + hp.ClassType.ClassName);
end
else
writer.AsmWriteLn('.err structured instruction: ' + taicpu_wasm_structured_instruction(hp).ClassType.ClassName);
writer.AsmWriteLn('.err structured instruction: ' + hp.ClassType.ClassName);
end;
{$endif WASM}