Browse Source

* don't create debugging entries for generic typesyms, since they
refer to typedefs which aren't written out either
* fixed longstring debuginfo and fixed overflow/range errors with
in creating it on 64 bit systems

git-svn-id: trunk@6821 -

Jonas Maebe 18 years ago
parent
commit
95ef3145fc
1 changed files with 16 additions and 8 deletions
  1. 16 8
      compiler/dbgdwarf.pas

+ 16 - 8
compiler/dbgdwarf.pas

@@ -1322,13 +1322,14 @@ implementation
 
     procedure TDebugInfoDwarf.appenddef_string(def:tstringdef);
 
-      procedure addnormalstringdef(const name: shortstring; lendef: tdef; maxlen: cardinal);
+      procedure addnormalstringdef(const name: shortstring; lendef: tdef; maxlen: aword);
         var
-          slen : aint;
+          { maxlen can be > high(int64) }
+          slen : aword;
           arr : tasmlabel;
         begin
           { fix length of openshortstring }
-          slen:=def.len;
+          slen:=aword(def.len);
           if slen=0 then
             slen:=maxlen;
 
@@ -1390,7 +1391,11 @@ implementation
             end;
           st_longstring:
             begin
-              addnormalstringdef('LongString',u32inttype,$ffffffff);
+{$ifdef cpu64bit}
+              addnormalstringdef('LongString',u64inttype,qword(-1));
+{$else cpu64bit}
+              addnormalstringdef('LongString',u32inttype,cardinal(-1));
+{$endif cpu64bit}
            end;
          st_ansistring:
            begin
@@ -1945,10 +1950,13 @@ implementation
 
       procedure TDebugInfoDwarf.appendsym_type(sym: ttypesym);
         begin
-          append_entry(DW_TAG_typedef,false,[
-            DW_AT_name,DW_FORM_string,symname(sym)+#0
-          ]);
-          append_labelentry_ref(DW_AT_type,def_dwarf_lab(sym.typedef));
+          if not(df_generic in sym.typedef.defoptions) then
+            begin
+              append_entry(DW_TAG_typedef,false,[
+                DW_AT_name,DW_FORM_string,symname(sym)+#0
+              ]);
+              append_labelentry_ref(DW_AT_type,def_dwarf_lab(sym.typedef));
+            end;
           finish_entry;
 
           (* Moved fom append sym, do we need this (MWE)