Преглед на файлове

* finish the lineinfo table with a DW_LNE_set_address of the last
instruction of the function, like in the example in the dwarf2
specifications appendix 3 and as done by gcc (expected by Apple's
dsymutil)

git-svn-id: trunk@9425 -

Jonas Maebe преди 17 години
родител
ревизия
f50d9cb9cb
променени са 1 файла, в които са добавени 13 реда и са изтрити 1 реда
  1. 13 1
      compiler/dbgdwarf.pas

+ 13 - 1
compiler/dbgdwarf.pas

@@ -2497,7 +2497,7 @@ implementation
         lastfileinfo : tfileposinfo;
         currfuncname : pshortstring;
         currsectype  : TAsmSectiontype;
-        hp : tai;
+        hp, hpend : tai;
         infile : tinputfile;
         prevcolumn,
         diffline,
@@ -2620,9 +2620,21 @@ implementation
                 lastfileinfo:=currfileinfo;
               end;
 
+            hpend:=hp;
             hp:=tai(hp.next);
           end;
 
+        if assigned(hpend) then
+          begin
+           { set address for end (see appendix 3 of dwarf 2 specs) }
+            current_asmdata.getlabel(currlabel, alt_dbgline);
+            list.insertafter(tai_label.create(currlabel), hpend);
+            asmline.concat(tai_const.create_8bit(DW_LNS_extended_op));
+            asmline.concat(tai_const.create_uleb128bit(1+sizeof(aint)));
+            asmline.concat(tai_const.create_8bit(DW_LNE_set_address));
+            asmline.concat(tai_const.create_sym(currlabel));
+          end;
+
         { end sequence }
         asmline.concat(tai_const.Create_8bit(DW_LNS_extended_op));
         asmline.concat(tai_const.Create_8bit(1));