mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 11:26:33 +02:00
atari: implemented stacktop for working stacktraces, implemented stacksize dependent stackmargin, and a system specific backtracestr. however, offs display still doesn't work properly, due to a linker issue (reported)
git-svn-id: trunk@49203 -
This commit is contained in:
parent
1e527e7a1e
commit
8f61df817a
@ -24,7 +24,7 @@ implementation
|
|||||||
var
|
var
|
||||||
procdesc: PPD; public name '__base';
|
procdesc: PPD; public name '__base';
|
||||||
tpasize: longint;
|
tpasize: longint;
|
||||||
stacktop: pointer;
|
stacktop: pointer; public name '__stktop';
|
||||||
stklen: longint; external name '__stklen';
|
stklen: longint; external name '__stklen';
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,3 +42,22 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
stackpointer_on_entry: pointer; external name '__stktop';
|
||||||
|
|
||||||
|
function StackTop: Pointer;
|
||||||
|
begin
|
||||||
|
StackTop:=stackpointer_on_entry;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
basepage: PPD; external name '__base';
|
||||||
|
|
||||||
|
function SysBackTraceStr (Addr: CodePointer): ShortString;
|
||||||
|
begin
|
||||||
|
if (addr<basepage^.p_tbase) or (addr>pointer(basepage^.p_tbase+basepage^.p_tlen)) then
|
||||||
|
SysBackTraceStr:=' Addr $'+hexstr(addr)
|
||||||
|
else
|
||||||
|
SysBackTraceStr:=' Offs $'+hexstr(pointer(addr-basepage^.p_tbase));
|
||||||
|
end;
|
||||||
|
@ -76,6 +76,9 @@ var
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
{$define FPC_SYSTEM_HAS_STACKTOP}
|
||||||
|
{$define FPC_SYSTEM_HAS_BACKTRACESTR}
|
||||||
|
|
||||||
{$if defined(FPUSOFT)}
|
{$if defined(FPUSOFT)}
|
||||||
|
|
||||||
{$define fpc_softfpu_implementation}
|
{$define fpc_softfpu_implementation}
|
||||||
@ -104,8 +107,6 @@ var
|
|||||||
{$endif FPC_ATARI_USE_TINYHEAP}
|
{$endif FPC_ATARI_USE_TINYHEAP}
|
||||||
{$i syspara.inc}
|
{$i syspara.inc}
|
||||||
|
|
||||||
var
|
|
||||||
basepage: PPD; external name '__base';
|
|
||||||
|
|
||||||
|
|
||||||
function GetProcessID:SizeUInt;
|
function GetProcessID:SizeUInt;
|
||||||
@ -160,6 +161,8 @@ end;
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
StackLength := CheckInitialStkLen (InitialStkLen);
|
StackLength := CheckInitialStkLen (InitialStkLen);
|
||||||
|
StackBottom := StackTop - StackLength;
|
||||||
|
StackMargin := min(align(StackLength div 20,2),STACK_MARGIN_MAX);
|
||||||
{ Initialize ExitProc }
|
{ Initialize ExitProc }
|
||||||
ExitProc:=Nil;
|
ExitProc:=Nil;
|
||||||
{$ifndef FPC_ATARI_USE_TINYHEAP}
|
{$ifndef FPC_ATARI_USE_TINYHEAP}
|
||||||
|
Loading…
Reference in New Issue
Block a user