Browse Source

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

Nikolay Nikolov 1 week ago
parent
commit
0a088a319b
1 changed files with 15 additions and 0 deletions
  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
 ****************************************************************************}