Browse Source

+ introduced LINE_RANGE constant in the DWARF debug info generation unit

Nikolay Nikolov 10 months ago
parent
commit
4914a5a31f
1 changed files with 4 additions and 2 deletions
  1. 4 2
      compiler/dbgdwarf.pas

+ 4 - 2
compiler/dbgdwarf.pas

@@ -283,6 +283,7 @@ implementation
 
     const
       LINE_BASE   = 1;
+      LINE_RANGE  = 255;
       OPCODE_BASE = 13;
 
     const
@@ -3095,7 +3096,7 @@ implementation
 
         { line_range }
         { only line increase, no adress }
-        linelist.concat(tai_const.create_8bit(255));
+        linelist.concat(tai_const.create_8bit(LINE_RANGE));
 
         { opcode_base }
         linelist.concat(tai_const.create_8bit(OPCODE_BASE));
@@ -3675,7 +3676,8 @@ implementation
 
                     { set line }
                     diffline := currfileinfo.line - prevline;
-                    if (diffline >= LINE_BASE) and (OPCODE_BASE + diffline - LINE_BASE <= 255) then
+                    if (diffline >= LINE_BASE) and (diffline <= (LINE_BASE + LINE_RANGE - 1)) and
+                       (OPCODE_BASE + diffline - LINE_BASE <= 255) then
                       begin
                         { use special opcode, this also adds a row }
                         asmline.concat(tai_const.create_8bit(OPCODE_BASE + diffline - LINE_BASE));