Преглед изворни кода

* fixed placement of "size" stab for Darwin

git-svn-id: trunk@8878 -
Jonas Maebe пре 18 година
родитељ
комит
35cb2b9c2b
1 измењених фајлова са 12 додато и 12 уклоњено
  1. 12 12
      compiler/dbgstabs.pas

+ 12 - 12
compiler/dbgstabs.pas

@@ -1084,6 +1084,18 @@ implementation
             move(p^,p1^,strlen(p)+1);
             templist.concat(Tai_stab.Create(stab_stabn,p1));
             freemem(p,2*mangled_length+50);
+
+            { Add a "size" stab as described in the last paragraph of 2.5 at  }
+            { http://sourceware.org/gdb/current/onlinedocs/stabs_2.html#SEC12 }
+            { This works at least on Darwin (and is needed on Darwin to get   }
+            { correct smartlinking of stabs), but I don't know which binutils }
+            { version is required on other platforms                          }
+            { This stab must come after all other stabs for the procedure,    }
+            { including the LBRAC/RBRAC ones                                  }
+            if (target_info.system in systems_darwin) then
+              templist.concat(Tai_stab.create(stab_stabs,
+                strpnew('"",'+tostr(N_FUNCTION)+',0,0,'+stabsendlabel.name+'-'+pd.mangledname)));
+
             current_asmdata.asmlists[al_procedures].insertlistafter(pd.procendtai,templist);
 
             { "The stab representing a procedure is located immediately
@@ -1111,18 +1123,6 @@ implementation
                (pd.localst.symtabletype=localsymtable) then
               write_symtable_syms(templist,pd.localst);
 
-            { Add a "size" stab as described in the last paragraph of 2.5 at  }
-            { http://sourceware.org/gdb/current/onlinedocs/stabs_2.html#SEC12 }
-            { This works at least on Darwin (and is needed on Darwin to get   }
-            { correct smartlinking of stabs), but I don't know which binutils }
-            { version is required on other platforms                          }
-            if (target_info.system in systems_darwin) then
-              templist.concat(Tai_stab.create(stab_stabs,
-                strpnew('"",'+tostr(N_FUNCTION)+',0,0,'+stabsendlabel.name+'-'+pd.mangledname)));
-
-            { after the endtai, because the ".size" must come before it }
-            current_asmdata.asmlists[al_procedures].insertlistafter(pd.procendtai,templist);
-
             templist.free;
           end;
       end;