浏览代码

Merged revisions 10608,10619 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r10608 | peter | 2008-04-06 14:47:05 +0200 (Sun, 06 Apr 2008) | 2 lines

* reorder code after r10602 so it is more clear

........
r10619 | jonas | 2008-04-09 10:03:55 +0200 (Wed, 09 Apr 2008) | 5 lines

* use global label to refer enum subrange type for setdefs
on systems without tf_dwarf_only_local_labels to avoid
potential problems when using the set type in a separate
unit

........

git-svn-id: branches/fixes_2_2@10622 -

Jonas Maebe 17 年之前
父节点
当前提交
0b895a5473
共有 2 个文件被更改,包括 17 次插入13 次删除
  1. 4 1
      compiler/dbgdwarf.pas
  2. 13 12
      compiler/dbgstabs.pas

+ 4 - 1
compiler/dbgdwarf.pas

@@ -2768,7 +2768,10 @@ implementation
                 if (def.elementdef.typ=enumdef) then
                   begin
                     { gdb 6.7 - 6.8 is broken for regular enum sets }
-                    current_asmdata.getaddrlabel(lab);
+                    if not(tf_dwarf_only_local_labels in target_info.flags) then
+                      current_asmdata.getdatalabel(lab)
+                    else
+                      current_asmdata.getaddrlabel(lab);
                     append_labelentry_ref(DW_AT_type,lab);
                     finish_entry;
                     current_asmdata.asmlists[al_dwarf_info].concat(tai_symbol.create(lab,0));

+ 13 - 12
compiler/dbgstabs.pas

@@ -479,22 +479,23 @@ implementation
           stabchar := 'Tt'
         else
           stabchar := 't';
-        { Type names for types defined in the current unit are already written in
-          the typesym }
-        if (def.owner.symtabletype=globalsymtable) and
-           not(def.owner.iscurrentunit) then
-          symname:='${sym_name}'
-        else
-          symname:='';
-        { Here we maybe generate a type, so we have to use numberstring }
+        { in case of writing the class record structure, we always have to
+          use the class name (so it refers both to the struct and the
+          pointer to the struct), otherwise gdb crashes (see tests/webtbs/tw9766.pp) }
         if is_class(def) and
            tobjectdef(def).writing_class_record_dbginfo then
-          { in case of writing the class record structure, we always have to
-            use the class name (so it refers both to the struct and the
-            pointer to the struct), otherwise gdb crashes (see tests/webtbs/tw9766.pp) }
           st:=def_stabstr_evaluate(def,'"{$sym_name}:$1$2=',[stabchar,def_stab_classnumber(tobjectdef(def))])
         else
-          st:=def_stabstr_evaluate(def,'"'+symname+':$1$2=',[stabchar,def_stab_number(def)]);
+          begin
+            { Type names for types defined in the current unit are already written in
+              the typesym }
+            if (def.owner.symtabletype=globalsymtable) and
+               not(def.owner.iscurrentunit) then
+              symname:='${sym_name}'
+            else
+              symname:='';
+            st:=def_stabstr_evaluate(def,'"'+symname+':$1$2=',[stabchar,def_stab_number(def)]);
+          end;
         st:=st+ss;
         { line info is set to 0 for all defs, because the def can be in an other
           unit and then the linenumber is invalid in the current sourcefile }