Explorar o código

+ override TObjSymbol.ToString to aid in debugging

Nikolay Nikolov hai 1 semana
pai
achega
7b5b41642d
Modificáronse 1 ficheiros con 15 adicións e 0 borrados
  1. 15 0
      compiler/ogbase.pas

+ 15 - 0
compiler/ogbase.pas

@@ -271,6 +271,7 @@ interface
 {$endif ARM}
 
        constructor create(AList:TFPHashObjectList;const AName:string);virtual;
+       function  ToString:ansistring;override;
        function  address:qword;
        procedure SetAddress(apass:byte;aobjsec:TObjSection;abind:TAsmsymbind;atyp:Tasmsymtype);
        function  ObjData: TObjData;
@@ -861,6 +862,20 @@ implementation
       end;
 
 
+    function TObjSymbol.ToString: ansistring;
+      var
+        objsectionstr: ansistring;
+      begin
+        if Assigned(objsection) then
+          objsectionstr:=objsection.ToString
+        else
+          objsectionstr:='nil';
+        WriteStr(Result,'(Name:',Name,';bind:',bind,';typ:',typ,';pass:',pass,
+          ';refs:',refs,';symidx:',symidx,';objsection:',objsectionstr,';offset:',
+          offset,';size:',size,')');
+      end;
+
+
     function TObjSymbol.address:qword;
       begin
         if assigned(objsection) then