Przeglądaj źródła

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

Nikolay Nikolov 1 rok temu
rodzic
commit
3a85a5a9cf
1 zmienionych plików z 25 dodań i 1 usunięć
  1. 25 1
      compiler/aggas.pas

+ 25 - 1
compiler/aggas.pas

@@ -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}