Browse Source

+ support for .debug_loc and .debuc_loclist sections

florian 1 year ago
parent
commit
4867d48e99

+ 2 - 0
compiler/aasmbase.pas

@@ -126,6 +126,8 @@ interface
          sec_debug_abbrev,
          sec_debug_abbrev,
          sec_debug_aranges,
          sec_debug_aranges,
          sec_debug_ranges,
          sec_debug_ranges,
+         sec_debug_loc,
+         sec_debug_loclists,
          { Yury: "sec_fpc is intended for storing fpc specific data
          { Yury: "sec_fpc is intended for storing fpc specific data
                   which must be recognized and processed specially by linker.
                   which must be recognized and processed specially by linker.
                   Currently fpc version string, dummy links to stab sections
                   Currently fpc version string, dummy links to stab sections

+ 4 - 0
compiler/aasmdata.pas

@@ -66,6 +66,8 @@ interface
         al_dwarf_line,
         al_dwarf_line,
         al_dwarf_aranges,
         al_dwarf_aranges,
         al_dwarf_ranges,
         al_dwarf_ranges,
+        al_dwarf_loc,
+        al_dwarf_loclists,
         al_picdata,
         al_picdata,
         al_indirectpicdata,
         al_indirectpicdata,
         al_resourcestrings,
         al_resourcestrings,
@@ -132,6 +134,8 @@ interface
         'al_dwarf_line',
         'al_dwarf_line',
         'al_dwarf_aranges',
         'al_dwarf_aranges',
         'al_dwarf_ranges',
         'al_dwarf_ranges',
+        'al_dwarf_loc',
+        'al_dwarf_loclists',
         'al_picdata',
         'al_picdata',
         'al_indirectpicdata',
         'al_indirectpicdata',
         'al_resourcestrings',
         'al_resourcestrings',

+ 4 - 2
compiler/aggas.pas

@@ -239,7 +239,7 @@ implementation
           '.stabstr',
           '.stabstr',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.eh_frame',
           '.eh_frame',
-          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges',
+          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges','.debug_loc','.debug_loclists',
           '.fpc',
           '.fpc',
           '.toc',
           '.toc',
           '.init',
           '.init',
@@ -300,7 +300,7 @@ implementation
           '.stabstr',
           '.stabstr',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.eh_frame',
           '.eh_frame',
-          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges',
+          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges','.debug_loc','.debug_loclists',
           '.fpc',
           '.fpc',
           '.toc',
           '.toc',
           '.init',
           '.init',
@@ -2182,6 +2182,8 @@ implementation
          sec_debug_abbrev,
          sec_debug_abbrev,
          sec_debug_aranges,
          sec_debug_aranges,
          sec_debug_ranges,
          sec_debug_ranges,
+         sec_debug_loc,
+         sec_debug_loclists,
          { ELF resources (+ references to stabs debug information sections) }
          { ELF resources (+ references to stabs debug information sections) }
          sec_code (* sec_fpc *),
          sec_code (* sec_fpc *),
          { Table of contents section }
          { Table of contents section }

+ 2 - 0
compiler/ogbase.pas

@@ -1414,6 +1414,8 @@ implementation
           {debug_abbrev} [oso_Data,oso_debug],
           {debug_abbrev} [oso_Data,oso_debug],
           {debug_aranges} [oso_Data,oso_debug],
           {debug_aranges} [oso_Data,oso_debug],
           {debug_ranges} [oso_Data,oso_debug],
           {debug_ranges} [oso_Data,oso_debug],
+          {debug_loc} [oso_Data,oso_debug],
+          {debug_loclists} [oso_Data,oso_debug],
           {fpc} [oso_Data,oso_load,oso_write],
           {fpc} [oso_Data,oso_load,oso_write],
           {toc} [oso_Data,oso_load],
           {toc} [oso_Data,oso_load],
           {init} [oso_Data,oso_load,oso_executable],
           {init} [oso_Data,oso_load,oso_executable],

+ 1 - 1
compiler/ogcoff.pas

@@ -944,7 +944,7 @@ implementation
           '.stab','.stabstr',
           '.stab','.stabstr',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.eh_frame',
           '.eh_frame',
-          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges',
+          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges','.debug_loc','.debug_loclists',
           '.fpc',
           '.fpc',
           '',
           '',
           '.init',
           '.init',

+ 1 - 1
compiler/ogelf.pas

@@ -526,7 +526,7 @@ implementation
           '.stab','.stabstr',
           '.stab','.stabstr',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.eh_frame',
           '.eh_frame',
-          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges',
+          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges','.debug_loc','.debug_loclists',
           '.fpc',
           '.fpc',
           '.toc',
           '.toc',
           '.init',
           '.init',

+ 1 - 1
compiler/ogrel.pas

@@ -276,7 +276,7 @@ implementation
           '.stabstr',
           '.stabstr',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.eh_frame',
           '.eh_frame',
-          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges',
+          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges','.debug_loc','.debug_loclists',
           '.fpc',
           '.fpc',
           '.toc',
           '.toc',
           '.init',
           '.init',

+ 1 - 1
compiler/ogwasm.pas

@@ -832,7 +832,7 @@ implementation
           '.stabstr',
           '.stabstr',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.eh_frame',
           '.eh_frame',
-          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges',
+          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges','.debug_loc','.debug_loclists',
           '.fpc',
           '.fpc',
           '.toc',
           '.toc',
           '.init',
           '.init',

+ 3 - 1
compiler/omfbase.pas

@@ -46,7 +46,7 @@ interface
       'stabstr',
       'stabstr',
       'idata2','idata4','idata5','idata6','idata7','edata',
       'idata2','idata4','idata5','idata6','idata7','edata',
       'eh_frame',
       'eh_frame',
-      '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges',
+      '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges','.debug_loc','.debug_loclists',
       'fpc',
       'fpc',
       '',
       '',
       'init',
       'init',
@@ -2923,6 +2923,8 @@ implementation
         {debug_abbrev} 'DWARF',
         {debug_abbrev} 'DWARF',
         {debug_aranges} 'DWARF',
         {debug_aranges} 'DWARF',
         {debug_ranges} 'DWARF',
         {debug_ranges} 'DWARF',
+        {debug_loc} 'DWARF',
+        {debug_loclists} 'DWARF',
         {fpc} 'DATA',
         {fpc} 'DATA',
         {toc} 'DATA',
         {toc} 'DATA',
         {init} 'CODE',
         {init} 'CODE',

+ 2 - 0
compiler/powerpc/agppcmpw.pas

@@ -121,6 +121,8 @@ interface
         '',
         '',
         '',
         '',
         '',
         '',
+        '',
+        '',
         ''
         ''
       );
       );
 
 

+ 4 - 0
compiler/x86/agx86int.pas

@@ -152,6 +152,8 @@ implementation
         '',
         '',
         '',
         '',
         '',
         '',
+        '',
+        '',
         ''
         ''
       );
       );
 
 
@@ -206,6 +208,8 @@ implementation
         '',
         '',
         '',
         '',
         '',
         '',
+        '',
+        '',
         ''
         ''
       );
       );
 
 

+ 1 - 1
compiler/x86/agx86nsm.pas

@@ -539,7 +539,7 @@ interface
           '.stabstr',
           '.stabstr',
           '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
           '.idata2','.idata4','.idata5','.idata6','.idata7','.edata',
           '.eh_frame',
           '.eh_frame',
-          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges',
+          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges','.debug_loc','.debug_loclists',
           '.fpc',
           '.fpc',
           '',
           '',
           '.init',
           '.init',

+ 1 - 1
compiler/z80/agsdasz80.pas

@@ -231,7 +231,7 @@ unit agsdasz80;
           '.stabstr',
           '.stabstr',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.eh_frame',
           '.eh_frame',
-          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges',
+          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges','.debug_loc','.debug_loclists',
           '.fpc',
           '.fpc',
           '.toc',
           '.toc',
           '.init',
           '.init',

+ 1 - 1
compiler/z80/agz80vasm.pas

@@ -247,7 +247,7 @@ unit agz80vasm;
           '.stabstr',
           '.stabstr',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.idata$2','.idata$4','.idata$5','.idata$6','.idata$7','.edata',
           '.eh_frame',
           '.eh_frame',
-          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges',
+          '.debug_frame','.debug_info','.debug_line','.debug_abbrev','.debug_aranges','.debug_ranges','.debug_loc','.debug_loclists',
           '.fpc',
           '.fpc',
           '.toc',
           '.toc',
           '.init',
           '.init',