Browse Source

+ write some debug info to the console in the wasm obj writer

Nikolay Nikolov 3 years ago
parent
commit
429454c8f4
1 changed files with 11 additions and 0 deletions
  1. 11 0
      compiler/ogwasm.pas

+ 11 - 0
compiler/ogwasm.pas

@@ -230,9 +230,20 @@ implementation
 ****************************************************************************}
 
     function TWasmObjOutput.writeData(Data:TObjData):boolean;
+      var
+        i: Integer;
+        objsec: TObjSection;
       begin
         Writer.write(WasmModuleMagic,SizeOf(WasmModuleMagic));
         Writer.write(WasmVersion,SizeOf(WasmVersion));
+
+        Writeln('ObjSectionList:');
+        for i:=0 to Data.ObjSectionList.Count-1 do
+          begin
+            objsec:=TObjSection(Data.ObjSectionList[i]);
+            Writeln(objsec.Name, ' Size=', objsec.Size, ' MemPos=', objsec.MemPos, ' Data.Size=', objsec.Data.size, ' DataPos=', objsec.DataPos);
+          end;
+
         result:=true;
       end;