Browse Source

compiler: generate STABS debug info for Variant type

git-svn-id: trunk@14326 -
paul 15 years ago
parent
commit
ae52b19820
1 changed files with 7 additions and 1 deletions
  1. 7 1
      compiler/dbgstabs.pas

+ 7 - 1
compiler/dbgstabs.pas

@@ -60,6 +60,7 @@ interface
         writing_def_stabs  : boolean;
         writing_def_stabs  : boolean;
         global_stab_number : word;
         global_stab_number : word;
         defnumberlist      : TFPObjectList;
         defnumberlist      : TFPObjectList;
+        vardatadef: trecorddef;
         { tsym writing }
         { tsym writing }
         function  sym_var_value(const s:string;arg:pointer):string;
         function  sym_var_value(const s:string;arg:pointer):string;
         function  sym_stabstr_evaluate(sym:tsym;const s:string;const vars:array of string):ansistring;
         function  sym_stabstr_evaluate(sym:tsym;const s:string;const vars:array of string):ansistring;
@@ -138,6 +139,7 @@ implementation
 
 
       tagtypes = [
       tagtypes = [
         recorddef,
         recorddef,
+        variantdef,
         enumdef,
         enumdef,
         stringdef,
         stringdef,
         filedef,
         filedef,
@@ -784,7 +786,9 @@ implementation
       var
       var
         ss : ansistring;
         ss : ansistring;
       begin
       begin
-        ss:=def_stabstr_evaluate(def,'${numberstring};',[]);
+        ss:='s'+tostr(vardatadef.size);
+        vardatadef.symtable.SymList.ForEachCall(@field_add_stabstr,@ss);
+        ss[length(ss)]:=';';
         write_def_stabstr(list,def,ss);
         write_def_stabstr(list,def,ss);
       end;
       end;
 
 
@@ -1487,6 +1491,8 @@ implementation
         stabsvarlist:=TAsmList.create;
         stabsvarlist:=TAsmList.create;
         stabstypelist:=TAsmList.create;
         stabstypelist:=TAsmList.create;
 
 
+        vardatadef:=trecorddef(search_system_type('TVARDATA').typedef);
+
         { include symbol that will be referenced from the main to be sure to
         { include symbol that will be referenced from the main to be sure to
           include this debuginfo .o file }
           include this debuginfo .o file }
         current_module.flags:=current_module.flags or uf_has_stabs_debuginfo;
         current_module.flags:=current_module.flags or uf_has_stabs_debuginfo;