* Applied patch to preserve case in stabs info (-gp)

git-svn-id: trunk@6611 -
This commit is contained in:
michael 2007-02-23 10:42:20 +00:00
parent 8480294711
commit 42f610f710
3 changed files with 42 additions and 19 deletions

View File

@ -92,6 +92,22 @@ implementation
aasmbase,procinfo, aasmbase,procinfo,
finput,fmodule,ppu; finput,fmodule,ppu;
function GetSymName(Sym : TSymEntry) : string;
begin
if Not (cs_stabs_preservecase in current_settings.globalswitches) then
result := Sym.Name
else
result := Sym.RealName;
end;
function GetSymTableName(SymTable : TSymTable) : string;
begin
if Not (cs_stabs_preservecase in current_settings.globalswitches) then
result := SymTable.Name^
else
result := SymTable.RealName^;
end;
const const
memsizeinc = 512; memsizeinc = 512;
@ -298,7 +314,7 @@ implementation
else if s='sym_name' then else if s='sym_name' then
begin begin
if assigned(def.typesym) then if assigned(def.typesym) then
result:=Ttypesym(def.typesym).name; result:=GetSymName(Ttypesym(def.typesym));
end end
else if s='N_LSYM' then else if s='N_LSYM' then
result:=tostr(N_LSYM) result:=tostr(N_LSYM)
@ -335,7 +351,7 @@ implementation
{ open arrays made overflows !! } { open arrays made overflows !! }
if varsize>$fffffff then if varsize>$fffffff then
varsize:=$fffffff; varsize:=$fffffff;
newrec:=def_stabstr_evaluate(nil,'$1:$2,$3,$4;',[tfieldvarsym(p).name, newrec:=def_stabstr_evaluate(nil,'$1:$2,$3,$4;',[GetSymName(tfieldvarsym(p)),
spec+def_stab_number(tfieldvarsym(p).vardef), spec+def_stab_number(tfieldvarsym(p).vardef),
tostr(tfieldvarsym(p).fieldoffset*8),tostr(varsize*8)]); tostr(tfieldvarsym(p).fieldoffset*8),tostr(varsize*8)]);
if state^.stabsize+strlen(newrec)>=state^.staballoc-256 then if state^.stabsize+strlen(newrec)>=state^.staballoc-256 then
@ -408,8 +424,8 @@ implementation
there is no sym attached to data !!! } there is no sym attached to data !!! }
if assigned(Parasym.vardef.typesym) then if assigned(Parasym.vardef.typesym) then
begin begin
arglength := length(Parasym.vardef.typesym.name); arglength := length(GetSymName(Parasym.vardef.typesym));
argnames := argnames + tostr(arglength)+Parasym.vardef.typesym.name; argnames := argnames + tostr(arglength)+GetSymName(Parasym.vardef.typesym);
end end
else else
argnames:=argnames+'11unnamedtype'; argnames:=argnames+'11unnamedtype';
@ -423,7 +439,7 @@ implementation
sp:='1' sp:='1'
else else
sp:='2'; sp:='2';
newrec:=def_stabstr_evaluate(nil,'$1::$2=##$3;:$4;$5A$6;',[tsym(p).name,def_stab_number(pd), newrec:=def_stabstr_evaluate(nil,'$1::$2=##$3;:$4;$5A$6;',[GetSymName(tsym(p)),def_stab_number(pd),
def_stab_number(pd.returndef),argnames,sp, def_stab_number(pd.returndef),argnames,sp,
virtualind]); virtualind]);
{ get spare place for a string at the end } { get spare place for a string at the end }
@ -503,7 +519,7 @@ implementation
stl:=strlen(st); stl:=strlen(st);
while assigned(p) do while assigned(p) do
begin begin
s :=p.name+':'+tostr(p.value)+','; s :=GetSymName(p)+':'+tostr(p.value)+',';
{ place for the ending ';' also } { place for the ending ';' also }
if (stl+length(s)+1>=memsize) then if (stl+length(s)+1>=memsize) then
begin begin
@ -609,7 +625,7 @@ implementation
stabsstr : string; stabsstr : string;
p : pchar; p : pchar;
begin begin
obj := def.procsym.name; obj := GetSymName(def.procsym);
info := ''; info := '';
if (po_global in def.procoptions) then if (po_global in def.procoptions) then
RType := 'F' RType := 'F'
@ -618,12 +634,12 @@ implementation
if assigned(def.owner) then if assigned(def.owner) then
begin begin
if (def.owner.symtabletype = objecTSymtable) then if (def.owner.symtabletype = objecTSymtable) then
obj := def.owner.name^+'__'+def.procsym.name; obj := GetSymTableName(def.owner)+'__'+GetSymName(def.procsym);
if not(cs_gdb_valgrind in current_settings.globalswitches) and if not(cs_gdb_valgrind in current_settings.globalswitches) and
(def.owner.symtabletype=localsymtable) and (def.owner.symtabletype=localsymtable) and
assigned(def.owner.defowner) and assigned(def.owner.defowner) and
assigned(tprocdef(def.owner.defowner).procsym) then assigned(tprocdef(def.owner.defowner).procsym) then
info := ','+def.procsym.name+','+tprocdef(def.owner.defowner).procsym.name; info := ','+GetSymName(def.procsym)+','+GetSymName(tprocdef(def.owner.defowner).procsym);
end; end;
stabsstr:=def.mangledname; stabsstr:=def.mangledname;
getmem(p,length(stabsstr)+255); getmem(p,length(stabsstr)+255);
@ -909,7 +925,7 @@ implementation
if (oo_has_vmt in tobjectdef(def).objectoptions) and if (oo_has_vmt in tobjectdef(def).objectoptions) and
assigned(def.owner) and assigned(def.owner) and
assigned(def.owner.name) then assigned(def.owner.name) then
list.concat(Tai_stab.create(stab_stabs,strpnew('"vmt_'+def.owner.name^+tobjectdef(def).objname^+':S'+ list.concat(Tai_stab.create(stab_stabs,strpnew('"vmt_'+GetSymTableName(def.owner)+tobjectdef(def).objname^+':S'+
def_stab_number(vmttype)+'",'+tostr(N_STSYM)+',0,0,'+tobjectdef(def).vmt_mangledname))); def_stab_number(vmttype)+'",'+tostr(N_STSYM)+',0,0,'+tobjectdef(def).vmt_mangledname)));
end; end;
procdef : procdef :
@ -946,7 +962,7 @@ implementation
staticsymtable : staticsymtable :
list.concat(tai_comment.Create(strpnew('Defs - Begin Staticsymtable'))); list.concat(tai_comment.Create(strpnew('Defs - Begin Staticsymtable')));
globalsymtable : globalsymtable :
list.concat(tai_comment.Create(strpnew('Defs - Begin unit '+st.name^+' has index '+tostr(st.moduleid)))); list.concat(tai_comment.Create(strpnew('Defs - Begin unit '+GetSymTableName(st)+' has index '+tostr(st.moduleid))));
end; end;
old_writing_def_stabs:=writing_def_stabs; old_writing_def_stabs:=writing_def_stabs;
writing_def_stabs:=true; writing_def_stabs:=true;
@ -956,7 +972,7 @@ implementation
staticsymtable : staticsymtable :
list.concat(tai_comment.Create(strpnew('Defs - End Staticsymtable'))); list.concat(tai_comment.Create(strpnew('Defs - End Staticsymtable')));
globalsymtable : globalsymtable :
list.concat(tai_comment.Create(strpnew('Defs - End unit '+st.name^+' has index '+tostr(st.moduleid)))); list.concat(tai_comment.Create(strpnew('Defs - End unit '+GetSymTableName(st)+' has index '+tostr(st.moduleid))));
end; end;
end; end;
@ -992,7 +1008,7 @@ implementation
else else
hs:='X'; hs:='X';
templist.concat(Tai_stab.create(stab_stabs,strpnew( templist.concat(Tai_stab.create(stab_stabs,strpnew(
'"'+pd.procsym.name+':'+hs+def_stab_number(pd.returndef)+'",'+ '"'+GetSymName(pd.procsym)+':'+hs+def_stab_number(pd.returndef)+'",'+
tostr(N_tsym)+',0,0,'+tostr(tabstractnormalvarsym(pd.funcretsym).localloc.reference.offset)))); tostr(N_tsym)+',0,0,'+tostr(tabstractnormalvarsym(pd.funcretsym).localloc.reference.offset))));
if (m_result in current_settings.modeswitches) then if (m_result in current_settings.modeswitches) then
templist.concat(Tai_stab.create(stab_stabs,strpnew( templist.concat(Tai_stab.create(stab_stabs,strpnew(
@ -1071,11 +1087,11 @@ implementation
sym:=tsym(arg); sym:=tsym(arg);
result:=''; result:='';
if s='name' then if s='name' then
result:=sym.name result:=GetSymName(sym)
else if s='mangledname' then else if s='mangledname' then
result:=sym.mangledname result:=sym.mangledname
else if s='ownername' then else if s='ownername' then
result:=sym.owner.name^ result:=GetSymTableName(sym.owner)
else if s='line' then else if s='line' then
result:=tostr(sym.fileinfo.line) result:=tostr(sym.fileinfo.line)
else if s='N_LSYM' then else if s='N_LSYM' then
@ -1370,7 +1386,7 @@ implementation
staticsymtable : staticsymtable :
list.concat(tai_comment.Create(strpnew('Syms - Begin Staticsymtable'))); list.concat(tai_comment.Create(strpnew('Syms - Begin Staticsymtable')));
globalsymtable : globalsymtable :
list.concat(tai_comment.Create(strpnew('Syms - Begin unit '+st.name^+' has index '+tostr(st.moduleid)))); list.concat(tai_comment.Create(strpnew('Syms - Begin unit '+GetSymTableName(st)+' has index '+tostr(st.moduleid))));
end; end;
for i:=0 to st.SymList.Count-1 do for i:=0 to st.SymList.Count-1 do
begin begin
@ -1383,7 +1399,7 @@ implementation
staticsymtable : staticsymtable :
list.concat(tai_comment.Create(strpnew('Syms - End Staticsymtable'))); list.concat(tai_comment.Create(strpnew('Syms - End Staticsymtable')));
globalsymtable : globalsymtable :
list.concat(tai_comment.Create(strpnew('Syms - End unit '+st.name^+' has index '+tostr(st.moduleid)))); list.concat(tai_comment.Create(strpnew('Syms - End unit '+GetSymTableName(st)+' has index '+tostr(st.moduleid))));
end; end;
end; end;
@ -1409,7 +1425,7 @@ implementation
{ 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_debuginfo; current_module.flags:=current_module.flags or uf_has_debuginfo;
new_section(current_asmdata.asmlists[al_stabs],sec_data,current_module.localsymtable.name^,0); new_section(current_asmdata.asmlists[al_stabs],sec_data,GetSymTableName(current_module.localsymtable),0);
current_asmdata.asmlists[al_stabs].concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.localsymtable,''),AT_DATA,0)); current_asmdata.asmlists[al_stabs].concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.localsymtable,''),AT_DATA,0));
{ first write all global/local symbols. This will flag all required tdefs } { first write all global/local symbols. This will flag all required tdefs }

View File

@ -125,7 +125,7 @@ interface
cs_support_vectors, cs_support_vectors,
{ debuginfo } { debuginfo }
cs_use_heaptrc,cs_use_lineinfo, cs_use_heaptrc,cs_use_lineinfo,
cs_gdb_valgrind,cs_no_regalloc, cs_gdb_valgrind,cs_no_regalloc,cs_stabs_preservecase,
{ assembling } { assembling }
cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source, cs_asm_leave,cs_asm_extern,cs_asm_pipe,cs_asm_source,
cs_asm_regalloc,cs_asm_tempalloc,cs_asm_nodes, cs_asm_regalloc,cs_asm_tempalloc,cs_asm_nodes,

View File

@ -791,6 +791,13 @@ begin
else else
include(init_settings.globalswitches,cs_use_lineinfo); include(init_settings.globalswitches,cs_use_lineinfo);
end; end;
'p' :
begin
if UnsetBool(More, j) then
exclude(init_settings.globalswitches,cs_stabs_preservecase)
else
include(init_settings.globalswitches,cs_stabs_preservecase);
end;
's' : 's' :
begin begin
paratargetdbg:=dbg_stabs; paratargetdbg:=dbg_stabs;