浏览代码

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

Nikolay Nikolov 1 周之前
父节点
当前提交
0a088a319b
共有 1 个文件被更改,包括 15 次插入0 次删除
  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
 ****************************************************************************}