浏览代码

+ patch by J. Gareth Moreton: New label debugging feature, resolves #38980

git-svn-id: trunk@49494 -
florian 4 年之前
父节点
当前提交
464730dc44
共有 1 个文件被更改,包括 9 次插入5 次删除
  1. 9 5
      compiler/aggas.pas

+ 9 - 5
compiler/aggas.pas

@@ -1323,13 +1323,17 @@ implementation
              begin
              begin
                if (tai_label(hp).labsym.is_used) then
                if (tai_label(hp).labsym.is_used) then
                 begin
                 begin
-                  if (tai_label(hp).labsym.bind=AB_PRIVATE_EXTERN) then
-                    begin
-                      writer.AsmWrite(#9'.private_extern ');
-                      writer.AsmWriteln(tai_label(hp).labsym.name);
-                    end;
+{$ifdef DEBUG_LABEL}
+                  writer.AsmWrite(asminfo^.comment);
+                  writer.AsmWriteLn('References = ' + tostr(tai_label(hp).labsym.getrefs));
+{$endif DEBUG_LABEL}
                   if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then
                   if tai_label(hp).labsym.bind in [AB_GLOBAL,AB_PRIVATE_EXTERN] then
                    begin
                    begin
+                     if (tai_label(hp).labsym.bind=AB_PRIVATE_EXTERN) then
+                       begin
+                         writer.AsmWrite(#9'.private_extern ');
+                         writer.AsmWriteln(tai_label(hp).labsym.name);
+                       end;
 {$ifdef arm}
 {$ifdef arm}
                      { do no change arm mode accidently, .globl seems to reset the mode }
                      { do no change arm mode accidently, .globl seems to reset the mode }
                      if GenerateThumbCode or GenerateThumb2Code then
                      if GenerateThumbCode or GenerateThumb2Code then