瀏覽代碼

+ introduced TWasmObjSection.IsDebug

Nikolay Nikolov 3 年之前
父節點
當前提交
a9698b6f6e
共有 1 個文件被更改,包括 10 次插入1 次删除
  1. 10 1
      compiler/ogwasm.pas

+ 10 - 1
compiler/ogwasm.pas

@@ -87,6 +87,7 @@ interface
         FileSectionOfs: qword;
         function IsCode: Boolean;
         function IsData: Boolean;
+        function IsDebug: Boolean;
       end;
 
       { TWasmObjData }
@@ -389,7 +390,15 @@ implementation
 
     function TWasmObjSection.IsData: Boolean;
       begin
-        result:=not IsCode;
+        result:=not (IsCode or IsDebug);
+      end;
+
+    function TWasmObjSection.IsDebug: Boolean;
+      const
+        DebugPrefix = '.debug';
+      begin
+        result:=(Length(Name)>=Length(DebugPrefix)) and
+          (Copy(Name,1,Length(DebugPrefix))=DebugPrefix);
       end;
 
 {****************************************************************************