Explorar el Código

+ override TWasmObjRelocation.ToString, to dump the extra fields in the descendant

Nikolay Nikolov hace 1 semana
padre
commit
0a088a319b
Se han modificado 1 ficheros con 15 adiciones y 0 borrados
  1. 15 0
      compiler/ogwasm.pas

+ 15 - 0
compiler/ogwasm.pas

@@ -106,6 +106,7 @@ interface
         constructor CreateTypeIndex(ADataOffset:TObjSectionOfs; ATypeIndex: Integer);
         constructor CreateFuncType(ADataOffset:TObjSectionOfs; AFuncType: TWasmFuncType);
         destructor Destroy;override;
+        function ToString:ansistring;override;
       end;
 
       { TWasmObjSymbolExtraData }
@@ -737,6 +738,20 @@ implementation
         inherited Destroy;
       end;
 
+    function TWasmObjRelocation.ToString: ansistring;
+      var
+        FuncTypeStr: ansistring;
+      begin
+        if Assigned(FuncType) then
+          FuncTypeStr:=FuncType.ToString
+        else
+          FuncTypeStr:='nil';
+        WriteStr(Result,'('+inherited+';TypeIndex:'+tostr(TypeIndex)+
+          ';Addend:'+tostr(Addend)+';FuncType:'+FuncTypeStr+
+          ';ExeTypeIndex:'+tostr(ExeTypeIndex)+
+          ';IsFunctionOffsetI32:',IsFunctionOffsetI32,')');
+      end;
+
 {****************************************************************************
                                TWasmObjSymbol
 ****************************************************************************}