mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 17:47:56 +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;
|
||||
|
||||
|
||||
function ReplaceForbiddenChars(const s: string): string;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
@ -201,17 +198,6 @@ implementation
|
||||
#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 }
|
||||
{****************************************************************************}
|
||||
|
@ -315,6 +315,8 @@ unit cpubase;
|
||||
|
||||
function GetOffsetReg(const r : TRegister;ofs : shortint) : TRegister;
|
||||
|
||||
function ReplaceForbiddenChars(const s: string): string;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
@ -458,4 +460,15 @@ unit cpubase;
|
||||
result:=TRegister(longint(r)+ofs);
|
||||
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.
|
||||
|
@ -125,6 +125,10 @@ implementation
|
||||
result := Sym.Name
|
||||
else
|
||||
result := Sym.RealName;
|
||||
{$ifdef avr}
|
||||
if target_asm.id=as_gas then
|
||||
result:=ReplaceForbiddenChars(result);
|
||||
{$endif avr}
|
||||
end;
|
||||
|
||||
function GetSymTableName(SymTable : TSymTable) : string;
|
||||
@ -133,6 +137,10 @@ implementation
|
||||
result := SymTable.Name^
|
||||
else
|
||||
result := SymTable.RealName^;
|
||||
{$ifdef avr}
|
||||
if target_asm.id=as_gas then
|
||||
result:=ReplaceForbiddenChars(result);
|
||||
{$endif avr}
|
||||
end;
|
||||
|
||||
const
|
||||
|
Loading…
Reference in New Issue
Block a user