* fix stabs for globals

This commit is contained in:
peter 2004-05-02 17:26:19 +00:00
parent 0768cc1cd6
commit 2b1fee21f1
2 changed files with 47 additions and 61 deletions

View File

@ -1785,18 +1785,6 @@ implementation
if (cs_create_smart in aktmoduleswitches) then if (cs_create_smart in aktmoduleswitches) then
curconstSegment.concat(Tai_cut.Create); curconstSegment.concat(Tai_cut.Create);
curconstSegment.concat(Tai_align.create(const_align(l))); curconstSegment.concat(Tai_align.create(const_align(l)));
{$ifdef GDB}
if cs_debuginfo in aktmoduleswitches then
begin
if not sym.isstabwritten then
begin
stabstr:=sym.stabstring;
if stabstr<>nil then
curconstsegment.concat(Tai_stabs.create(stabstr));
sym.isstabwritten:=true;
end;
end;
{$endif GDB}
if (sym.owner.symtabletype=globalsymtable) or if (sym.owner.symtabletype=globalsymtable) or
(cs_create_smart in aktmoduleswitches) or (cs_create_smart in aktmoduleswitches) or
(assigned(current_procinfo) and (assigned(current_procinfo) and
@ -1829,18 +1817,6 @@ implementation
if (cs_create_smart in aktmoduleswitches) then if (cs_create_smart in aktmoduleswitches) then
bssSegment.concat(Tai_cut.Create); bssSegment.concat(Tai_cut.Create);
bssSegment.concat(Tai_align.create(varalign)); bssSegment.concat(Tai_align.create(varalign));
{$ifdef GDB}
if cs_debuginfo in aktmoduleswitches then
begin
if not sym.isstabwritten then
begin
stabstr:=sym.stabstring;
if stabstr<>nil then
bsssegment.concat(Tai_stabs.create(stabstr));
sym.isstabwritten:=true;
end;
end;
{$endif GDB}
if (sym.owner.symtabletype=globalsymtable) or if (sym.owner.symtabletype=globalsymtable) or
(cs_create_smart in aktmoduleswitches) or (cs_create_smart in aktmoduleswitches) or
DLLSource or DLLSource or
@ -2146,7 +2122,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.197 2004-03-29 14:43:47 peter Revision 1.198 2004-05-02 17:26:19 peter
* fix stabs for globals
Revision 1.197 2004/03/29 14:43:47 peter
* cleaner temp get/unget for exceptions * cleaner temp get/unget for exceptions
Revision 1.196 2004/03/03 22:02:52 peter Revision 1.196 2004/03/03 22:02:52 peter

View File

@ -642,41 +642,45 @@ implementation
end; end;
end; end;
begin var
if not (cs_debuginfo in aktmoduleswitches) then vardebuglist : taasmoutput;
exit; begin
{ reset unit type info flag } if not (cs_debuginfo in aktmoduleswitches) then
reset_unit_type_info; exit;
{ write used types from the used units } { first write all global/local symbols to a temp list. This will flag
write_used_unit_type_info(current_module); all required tdefs. Afterwards this list will be added }
{ first write the types from this unit } vardebuglist:=taasmoutput.create;
if assigned(current_module.globalsymtable) then if assigned(current_module.globalsymtable) then
begin tglobalsymtable(current_module.globalsymtable).concatstabto(vardebuglist);
{ all types } if assigned(current_module.localsymtable) then
tglobalsymtable(current_module.globalsymtable).concattypestabto(debuglist); tstaticsymtable(current_module.localsymtable).concatstabto(vardebuglist);
{ and all local symbols} { reset unit type info flag }
tglobalsymtable(current_module.globalsymtable).concatstabto(debuglist); reset_unit_type_info;
end; { write used types from the used units }
if assigned(current_module.localsymtable) then write_used_unit_type_info(current_module);
begin { last write the types from this unit }
{ all types } if assigned(current_module.globalsymtable) then
tstaticsymtable(current_module.localsymtable).concattypestabto(debuglist); tglobalsymtable(current_module.globalsymtable).concattypestabto(debuglist);
{ and all local symbols} if assigned(current_module.localsymtable) then
tstaticsymtable(current_module.localsymtable).concatstabto(debuglist); tstaticsymtable(current_module.localsymtable).concattypestabto(debuglist);
end; { now all defs have a type in the debuglist, we now can add the vardebuglist since
if (cs_gdb_dbx in aktglobalswitches) then all references to defs can be solved }
begin debuglist.concatlist(vardebuglist);
debugList.concat(tai_comment.Create(strpnew('EINCL of global '+ vardebuglist.free;
tglobalsymtable(current_module.globalsymtable).name^+' has index '+ { include files }
tostr(tglobalsymtable(current_module.globalsymtable).unitid)))); if (cs_gdb_dbx in aktglobalswitches) then
debugList.concat(Tai_stabs.Create(strpnew('"'+ begin
tglobalsymtable(current_module.globalsymtable).name^+'",'+ debugList.concat(tai_comment.Create(strpnew('EINCL of global '+
tostr(N_EINCL)+',0,0,0'))); tglobalsymtable(current_module.globalsymtable).name^+' has index '+
tglobalsymtable(current_module.globalsymtable).dbx_count_ok:={true}false; tostr(tglobalsymtable(current_module.globalsymtable).unitid))));
dbx_counter:=tglobalsymtable(current_module.globalsymtable).prev_dbx_counter; debugList.concat(Tai_stabs.Create(strpnew('"'+
do_count_dbx:=false; tglobalsymtable(current_module.globalsymtable).name^+'",'+
end; tostr(N_EINCL)+',0,0,0')));
end; tglobalsymtable(current_module.globalsymtable).dbx_count_ok:={true}false;
dbx_counter:=tglobalsymtable(current_module.globalsymtable).prev_dbx_counter;
do_count_dbx:=false;
end;
end;
{$EndIf GDB} {$EndIf GDB}
@ -1454,7 +1458,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.148 2004-03-24 20:24:25 hajny Revision 1.149 2004-05-02 17:26:19 peter
* fix stabs for globals
Revision 1.148 2004/03/24 20:24:25 hajny
* OS/2 heap management modified to be able to grow heap as needed * OS/2 heap management modified to be able to grow heap as needed
Revision 1.147 2004/03/18 11:43:57 olle Revision 1.147 2004/03/18 11:43:57 olle