summaryrefslogtreecommitdiff
path: root/compiler/dbgstabs.pas
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2011-08-16 20:27:54 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2011-08-16 20:27:54 +0000
commit4bb6dec3cc81f9cc01143d61ca3580e617c8853b (patch)
tree653c4972ade23fffaca39aaf15944770594363a7 /compiler/dbgstabs.pas
parent19d7a18d44510286ec4b1e0175bdbbe97fc4765d (diff)
downloadfpc-4bb6dec3cc81f9cc01143d61ca3580e617c8853b.tar.gz
+ tai_stab.create_ansistr
* write vmt info using create_ansistr, resolves #20003 * replaced move/getmem sequences in dbgstabs.pas by create_ansistr git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@18230 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/dbgstabs.pas')
-rw-r--r--compiler/dbgstabs.pas34
1 files changed, 8 insertions, 26 deletions
diff --git a/compiler/dbgstabs.pas b/compiler/dbgstabs.pas
index 57cac65b68..06d8694b90 100644
--- a/compiler/dbgstabs.pas
+++ b/compiler/dbgstabs.pas
@@ -499,7 +499,6 @@ implementation
stabchar : string[2];
symname : string[20];
st : ansistring;
- p : pchar;
begin
{ type prefix }
if def.typ in tagtypes then
@@ -528,9 +527,7 @@ implementation
unit and then the linenumber is invalid in the current sourcefile }
st:=st+def_stabstr_evaluate(def,'",${N_LSYM},0,0,0',[]);
{ add to list }
- getmem(p,length(st)+1);
- move(pchar(st)^,p^,length(st)+1);
- list.concat(Tai_stab.create(stab_stabs,p));
+ list.concat(Tai_stab.create_ansistr(stab_stabs,st));
end;
@@ -800,8 +797,8 @@ implementation
if (oo_has_vmt in def.objectoptions) and
assigned(def.owner) and
assigned(def.owner.name) then
- 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)));
+ list.concat(Tai_stab.create_ansistr(stab_stabs,ansistring('"vmt_')+GetSymTableName(def.owner)+tobjectdef(def).objname^+':S'+
+ def_stab_number(vmttype)+'",'+tostr(N_STSYM)+',0,0,'+ansistring(tobjectdef(def).vmt_mangledname)));
end;
@@ -832,7 +829,6 @@ implementation
var
st,
ss : ansistring;
- p: pchar;
elementdefstabnr: string;
begin
{ ugly hack: create a temporary subrange type if the lower bound of
@@ -851,9 +847,7 @@ implementation
st:=st+def_stabstr_evaluate(def.elementdef,'r'+elementdefstabnr+';$1;$2;',[tostr(longint(def.setbase)),tostr(longint(get_max_value(def.elementdef).svalue))]);
st:=st+'",'+tostr(N_LSYM)+',0,0,0';
{ add to list }
- getmem(p,length(st)+1);
- move(pchar(st)^,p^,length(st)+1);
- list.concat(Tai_stab.create(stab_stabs,p));
+ list.concat(Tai_stab.create_ansistr(stab_stabs,st));
end
else
elementdefstabnr:=def_stab_number(def.elementdef);
@@ -1023,7 +1017,6 @@ implementation
var
templist : TAsmList;
stabsendlabel : tasmlabel;
- p : pchar;
RType : Char;
Obj,Info : String;
hs : string;
@@ -1073,9 +1066,7 @@ implementation
ss:=ss+'.';
ss:=ss+def.mangledname;
end;
- getmem(p,length(ss)+1);
- move(pchar(ss)^,p^,length(ss)+1);
- templist.concat(Tai_stab.Create(stab_stabn,p));
+ templist.concat(Tai_stab.Create_ansistr(stab_stabn,ss));
// RBRAC
ss:=tostr(N_RBRAC)+',0,0,'+stabsendlabel.name;
if not(af_stabs_use_function_absolute_addresses in target_asm.flags) then
@@ -1085,9 +1076,7 @@ implementation
ss:=ss+'.';
ss:=ss+def.mangledname;
end;
- getmem(p,length(ss)+1);
- move(pchar(ss)^,p^,length(ss)+1);
- templist.concat(Tai_stab.Create(stab_stabn,p));
+ templist.concat(Tai_stab.Create_ansistr(stab_stabn,ss));
{ the stabsendlabel must come after all other stabs for this }
{ function }
@@ -1134,10 +1123,7 @@ implementation
assigned(tprocdef(def.owner.defowner).procsym) then
info := ','+GetSymName(def.procsym)+','+GetSymName(tprocdef(def.owner.defowner).procsym);
end;
- ss:='"'+ansistring(obj)+':'+RType+def_stab_number(def.returndef)+info+'",'+tostr(n_function)+',0,'+tostr(def.fileinfo.line)+','+ansistring(def.mangledname);
- getmem(p,length(ss)+1);
- move(pchar(ss)^,p^,length(ss)+1);
- templist.concat(Tai_stab.Create(stab_stabs,p));
+ templist.concat(Tai_stab.Create_ansistr(stab_stabs,'"'+ansistring(obj)+':'+RType+def_stab_number(def.returndef)+info+'",'+tostr(n_function)+',0,'+tostr(def.fileinfo.line)+','+ansistring(def.mangledname)));
current_asmdata.asmlists[al_procedures].insertlistbefore(def.procstarttai,templist);
@@ -1197,15 +1183,11 @@ implementation
procedure TDebugInfoStabs.write_sym_stabstr(list:TAsmList;sym:tsym;const ss:ansistring);
- var
- p : pchar;
begin
if ss='' then
exit;
{ add to list }
- getmem(p,length(ss)+1);
- move(pchar(ss)^,p^,length(ss)+1);
- list.concat(Tai_stab.create(stab_stabs,p));
+ list.concat(Tai_stab.create_ansistr(stab_stabs,ss));
end;