mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 18:30:18 +02:00
* move ReplaceForbiddenChars to cpubase of avr so it can be used in dbgstabs as well
* tried to fix dbgstabs so that it doesn't emit illegal chars using ReplaceForbiddenChars, however, dbgstabs accesses symbol names quite often, so this failed git-svn-id: trunk@18972 -
This commit is contained in:
parent
7bceba2392
commit
f1f0cb033a
@ -94,9 +94,6 @@ interface
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function ReplaceForbiddenChars(const s: string): string;
|
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
@ -201,17 +198,6 @@ implementation
|
|||||||
#9'.rva'#9,#9'.secrel32'#9,#9'.quad'#9,#9'.long'#9,#9'.short'#9
|
#9'.rva'#9,#9'.secrel32'#9,#9'.quad'#9,#9'.long'#9,#9'.short'#9
|
||||||
);
|
);
|
||||||
|
|
||||||
function ReplaceForbiddenChars(const s: string): string;
|
|
||||||
var
|
|
||||||
i : longint;
|
|
||||||
begin
|
|
||||||
Result:=s;
|
|
||||||
for i:=1 to Length(Result) do
|
|
||||||
if Result[i]='$' then
|
|
||||||
Result[i]:='s';
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{****************************************************************************}
|
{****************************************************************************}
|
||||||
{ GNU Assembler writer }
|
{ GNU Assembler writer }
|
||||||
{****************************************************************************}
|
{****************************************************************************}
|
||||||
|
@ -315,6 +315,8 @@ unit cpubase;
|
|||||||
|
|
||||||
function GetOffsetReg(const r : TRegister;ofs : shortint) : TRegister;
|
function GetOffsetReg(const r : TRegister;ofs : shortint) : TRegister;
|
||||||
|
|
||||||
|
function ReplaceForbiddenChars(const s: string): string;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
@ -458,4 +460,15 @@ unit cpubase;
|
|||||||
result:=TRegister(longint(r)+ofs);
|
result:=TRegister(longint(r)+ofs);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function ReplaceForbiddenChars(const s: string): string;
|
||||||
|
var
|
||||||
|
i : longint;
|
||||||
|
begin
|
||||||
|
Result:=s;
|
||||||
|
for i:=1 to Length(Result) do
|
||||||
|
if Result[i]='$' then
|
||||||
|
Result[i]:='s';
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -125,6 +125,10 @@ implementation
|
|||||||
result := Sym.Name
|
result := Sym.Name
|
||||||
else
|
else
|
||||||
result := Sym.RealName;
|
result := Sym.RealName;
|
||||||
|
{$ifdef avr}
|
||||||
|
if target_asm.id=as_gas then
|
||||||
|
result:=ReplaceForbiddenChars(result);
|
||||||
|
{$endif avr}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetSymTableName(SymTable : TSymTable) : string;
|
function GetSymTableName(SymTable : TSymTable) : string;
|
||||||
@ -133,6 +137,10 @@ implementation
|
|||||||
result := SymTable.Name^
|
result := SymTable.Name^
|
||||||
else
|
else
|
||||||
result := SymTable.RealName^;
|
result := SymTable.RealName^;
|
||||||
|
{$ifdef avr}
|
||||||
|
if target_asm.id=as_gas then
|
||||||
|
result:=ReplaceForbiddenChars(result);
|
||||||
|
{$endif avr}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
|
Loading…
Reference in New Issue
Block a user