Re: [fpc-pascal] Validate heap/stack addresses

2009-12-01 Thread Anthony Walter
Oh and for querying stack pointers, there should be an OS function somewhere to give you the base stack pointer address and available stack size, though I don't know the names of functions off the top of my head. ___ fpc-pascal maillist - fpc-pascal@lis

Re: [fpc-pascal] Validate heap/stack addresses

2009-12-01 Thread Anthony Walter
On Tue, Dec 1, 2009 at 11:58 AM, Bruce Bauman wrote: > I’m trying to port/debug some ugly Pascal code. > > Is there a way I can tell if an arbitrary address is within the heap or > stack? Without hooking/replacing the memory manager, I don't believe you can handle memory tracking this information

Re: [fpc-pascal] Validate heap/stack addresses

2009-12-01 Thread Jonas Maebe
On 01 Dec 2009, at 17:58, Bruce Bauman wrote: > Is there a way I can tell if an arbitrary address is within the heap or > stack? > > I want to do something like: > > Assert(ValidHeapAddress(a)) That is not possible without installing your own memory manager that tracks all allocations. Also k

[fpc-pascal] Validate heap/stack addresses

2009-12-01 Thread Bruce Bauman
I'm trying to port/debug some ugly Pascal code. Is there a way I can tell if an arbitrary address is within the heap or stack? I want to do something like: Assert(ValidHeapAddress(a)) Assert(ValidStackAddress(a)) to catch potential errors in the code. I'm guessing any address b