Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2006-01

StackBottom

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Vincent Snijders

Hi,

If I run the following program on windows xp, it shows me that the StackBottom is located at $2FE80. I thought that the stack was always contained in complete pages and therefore the StackBottom should be at a 4k boundary. Is that correct?

Assuming this, the correct value for the StackBottom should be $30000. Then StackBottom should be initialized as

StackBottom := (Sptr - StackLength + $FFF) AND $FFFFF000;

(at program start Sptr doesn't point to the exact top of the stack).

I stumbled on this issue, because for backtrace some values at the top of the stack were not considered valid frame pointers.

Vincent

==================

program Project1;
{$mode objfpc}{$H+}

uses
Classes

   { add your units here };
begin
   writeln(HexStr(PtrUInt(StackBottom),SizeOf(Pointer)*2));
   readln;
end.

Reply by email