fixed debuginfo for variables in staticsymtable

This commit is contained in:
peter 2004-11-04 17:09:54 +00:00
parent 63db7dd8c2
commit f4a7c3d444
4 changed files with 46 additions and 20 deletions

View File

@ -1795,6 +1795,9 @@ implementation
{ insert cut for smartlinking or alignment } { insert cut for smartlinking or alignment }
maybe_new_object_file(curconstSegment); maybe_new_object_file(curconstSegment);
new_section(curconstSegment,sec_rodata,lower(sym.mangledname),const_align(l)); new_section(curconstSegment,sec_rodata,lower(sym.mangledname),const_align(l));
{$ifdef GDB}
sym.concatstabto(curconstSegment);
{$endif GDB}
if (sym.owner.symtabletype=globalsymtable) or if (sym.owner.symtabletype=globalsymtable) or
maybe_smartlink_symbol or maybe_smartlink_symbol or
(assigned(current_procinfo) and (assigned(current_procinfo) and
@ -1820,6 +1823,9 @@ implementation
varalign:=var_align(l); varalign:=var_align(l);
maybe_new_object_file(bssSegment); maybe_new_object_file(bssSegment);
new_section(bssSegment,sec_bss,lower(sym.mangledname),varalign); new_section(bssSegment,sec_bss,lower(sym.mangledname),varalign);
{$ifdef GDB}
sym.concatstabto(bssSegment);
{$endif GDB}
if (sym.owner.symtabletype=globalsymtable) or if (sym.owner.symtabletype=globalsymtable) or
maybe_smartlink_symbol or maybe_smartlink_symbol or
DLLSource or DLLSource or
@ -1931,11 +1937,7 @@ implementation
if not(cs_create_pic in aktmoduleswitches) and if not(cs_create_pic in aktmoduleswitches) and
not(vo_is_dll_var in varoptions) and not(vo_is_dll_var in varoptions) and
not(vo_is_thread_var in varoptions) then not(vo_is_thread_var in varoptions) then
{$ifndef macos}
reference_reset_symbol(localloc.reference,objectlibrary.newasmsymbol(mangledname,AB_EXTERNAL,AT_NONE),0);
{$else}
reference_reset_symbol(localloc.reference,objectlibrary.newasmsymbol(mangledname,AB_EXTERNAL,AT_DATA),0); reference_reset_symbol(localloc.reference,objectlibrary.newasmsymbol(mangledname,AB_EXTERNAL,AT_DATA),0);
{$endif macos}
end; end;
else else
internalerror(200410103); internalerror(200410103);
@ -2207,7 +2209,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.234 2004-10-31 21:45:03 peter Revision 1.235 2004-11-04 17:09:54 peter
fixed debuginfo for variables in staticsymtable
Revision 1.234 2004/10/31 21:45:03 peter
* generic tlocation * generic tlocation
* move tlocation to cgutils * move tlocation to cgutils

View File

@ -625,14 +625,17 @@ implementation
end end
else else
debugList.concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.localsymtable,''),AT_DATA,0)); debugList.concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.localsymtable,''),AT_DATA,0));
{ first write all global/local symbols to a temp list. This will flag { first write all global/local symbols again to a temp list. This will flag
all required tdefs. Afterwards this list will be added } all required tdefs. After that the temp list can be removed since the debuginfo is already
written to the stabs when the variables/consts were written }
{$warning Hack to get all needed types}
vardebuglist:=taasmoutput.create; vardebuglist:=taasmoutput.create;
new_section(vardebuglist,sec_data,'',0); new_section(vardebuglist,sec_data,'',0);
if assigned(current_module.globalsymtable) then if assigned(current_module.globalsymtable) then
tglobalsymtable(current_module.globalsymtable).concatstabto(vardebuglist); tglobalsymtable(current_module.globalsymtable).concatstabto(vardebuglist);
if assigned(current_module.localsymtable) then if assigned(current_module.localsymtable) then
tstaticsymtable(current_module.localsymtable).concatstabto(vardebuglist); tstaticsymtable(current_module.localsymtable).concatstabto(vardebuglist);
vardebuglist.free;
{ reset unit type info flag } { reset unit type info flag }
reset_unit_type_info; reset_unit_type_info;
{ write used types from the used units } { write used types from the used units }
@ -642,10 +645,6 @@ implementation
tglobalsymtable(current_module.globalsymtable).concattypestabto(debuglist); tglobalsymtable(current_module.globalsymtable).concattypestabto(debuglist);
if assigned(current_module.localsymtable) then if assigned(current_module.localsymtable) then
tstaticsymtable(current_module.localsymtable).concattypestabto(debuglist); tstaticsymtable(current_module.localsymtable).concattypestabto(debuglist);
{ now all defs have a type in the debuglist, we now can add the vardebuglist since
all references to defs can be solved }
debuglist.concatlist(vardebuglist);
vardebuglist.free;
{ include files } { include files }
if (cs_gdb_dbx in aktglobalswitches) then if (cs_gdb_dbx in aktglobalswitches) then
begin begin
@ -1512,7 +1511,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.169 2004-10-31 15:29:39 olle Revision 1.170 2004-11-04 17:09:54 peter
fixed debuginfo for variables in staticsymtable
Revision 1.169 2004/10/31 15:29:39 olle
+ All sections get names in macos + All sections get names in macos
Revision 1.168 2004/10/26 15:11:01 peter Revision 1.168 2004/10/26 15:11:01 peter

View File

@ -4219,12 +4219,12 @@ implementation
asmList.concat(Tai_stabs.Create(stabstring)); asmList.concat(Tai_stabs.Create(stabstring));
if not(po_external in procoptions) then if not(po_external in procoptions) then
begin begin
tstoredsymtable(parast).concatstabto(asmlist); tparasymtable(parast).concatstabto(asmlist);
{ local type defs and vars should not be written { local type defs and vars should not be written
inside the main proc stab } inside the main proc stab }
if assigned(localst) and if assigned(localst) and
(localst.symtablelevel>main_program_level) then (localst.symtabletype=localsymtable) then
tstoredsymtable(localst).concatstabto(asmlist); tlocalsymtable(localst).concatstabto(asmlist);
end; end;
stab_state:=stab_state_written; stab_state:=stab_state_written;
end; end;
@ -6218,7 +6218,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.264 2004-11-03 09:46:34 florian Revision 1.265 2004-11-04 17:09:54 peter
fixed debuginfo for variables in staticsymtable
Revision 1.264 2004/11/03 09:46:34 florian
* fixed writing of para locations for procedures with explicit locations for parameters * fixed writing of para locations for procedures with explicit locations for parameters
Revision 1.263 2004/11/01 23:30:11 peter Revision 1.263 2004/11/01 23:30:11 peter

View File

@ -36,7 +36,7 @@ interface
ppu, ppu,
cclasses,symnot, cclasses,symnot,
{ aasm } { aasm }
aasmbase, aasmbase,aasmtai,
cpuinfo,cpubase,cgbase,cgutils,parabase cpuinfo,cpubase,cgbase,cgutils,parabase
; ;
@ -52,6 +52,7 @@ interface
{$ifdef GDB} {$ifdef GDB}
function get_var_value(const s:string):string; function get_var_value(const s:string):string;
function stabstr_evaluate(const s:string;vars:array of string):Pchar; function stabstr_evaluate(const s:string;vars:array of string):Pchar;
procedure concatstabto(asmlist : taasmoutput);
{$endif GDB} {$endif GDB}
function mangledname : string; function mangledname : string;
procedure generate_mangledname;virtual;abstract; procedure generate_mangledname;virtual;abstract;
@ -305,7 +306,6 @@ interface
implementation implementation
uses uses
// strings,
{ global } { global }
verbose, verbose,
{ target } { target }
@ -315,7 +315,9 @@ implementation
{ tree } { tree }
node, node,
{ aasm } { aasm }
// aasmcpu, {$ifdef gdb}
gdb,
{$endif gdb}
{ codegen } { codegen }
paramgr,cresstr, paramgr,cresstr,
procinfo procinfo
@ -393,8 +395,19 @@ implementation
begin begin
stabstr_evaluate:=string_evaluate(s,@get_var_value,vars); stabstr_evaluate:=string_evaluate(s,@get_var_value,vars);
end; end;
procedure tstoredsym.concatstabto(asmlist : taasmoutput);
var
stabstr : Pchar;
begin
stabstr:=stabstring;
if stabstr<>nil then
asmlist.concat(Tai_stabs.create(stabstr));
end;
{$endif GDB} {$endif GDB}
function tstoredsym.mangledname : string; function tstoredsym.mangledname : string;
begin begin
@ -2251,7 +2264,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.189 2004-10-31 21:45:03 peter Revision 1.190 2004-11-04 17:09:54 peter
fixed debuginfo for variables in staticsymtable
Revision 1.189 2004/10/31 21:45:03 peter
* generic tlocation * generic tlocation
* move tlocation to cgutils * move tlocation to cgutils