* fixed stabs debug info for webtbs/tw9766 again

git-svn-id: trunk@10602 -
This commit is contained in:
Jonas Maebe 2008-04-05 12:29:07 +00:00
parent 51f5fd5eb7
commit 39fa81d40e
2 changed files with 8 additions and 2 deletions

View File

@ -226,6 +226,9 @@ implementation
{ to avoid infinite loops } { to avoid infinite loops }
def.dbg_state := dbg_state_writing; def.dbg_state := dbg_state_writing;
beforeappenddef(list,def); beforeappenddef(list,def);
{ queued defs have to be written later }
if (def.dbg_state=dbg_state_queued) then
exit;
case def.typ of case def.typ of
stringdef : stringdef :
appenddef_string(list,tstringdef(def)); appenddef_string(list,tstringdef(def));
@ -394,7 +397,7 @@ implementation
for i:=0 to st.DefList.Count-1 do for i:=0 to st.DefList.Count-1 do
begin begin
def:=tdef(st.DefList[i]); def:=tdef(st.DefList[i]);
if (def.dbg_state=dbg_state_used) then if (def.dbg_state in [dbg_state_used,dbg_state_queued]) then
appenddef(list,def); appenddef(list,def);
end; end;
case st.symtabletype of case st.symtabletype of

View File

@ -489,7 +489,10 @@ implementation
{ Here we maybe generate a type, so we have to use numberstring } { Here we maybe generate a type, so we have to use numberstring }
if is_class(def) and if is_class(def) and
tobjectdef(def).writing_class_record_dbginfo then tobjectdef(def).writing_class_record_dbginfo then
st:=def_stabstr_evaluate(def,'"'+symname+':$1$2=',[stabchar,def_stab_classnumber(tobjectdef(def))]) { 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 else
st:=def_stabstr_evaluate(def,'"'+symname+':$1$2=',[stabchar,def_stab_number(def)]); st:=def_stabstr_evaluate(def,'"'+symname+':$1$2=',[stabchar,def_stab_number(def)]);
st:=st+ss; st:=st+ss;