[Oberon] PO2013 - Show Heap Blocks

Paul Reed paulreed at paddedcell.com
Wed Jun 24 18:15:03 CEST 2020


Hi Tomas,

> inspected from the outside, it looks good. It just doesn't like to be
> looked at from the inside?

Heisenbugs definitely don't like to be looked at.  :)

Of course if your output routines are using the heap and it's corrupted, 
you won't be able to trust the output.  But if the Out module outputs 
directly to RS232 for example, without allocating anything, it should 
make sense.

I suggest printing the addresses of the blocks you show the contents of 
and the first three words.  Note that NEW returns the address+8, hiding 
the tag and mark.  And if you find that a pointer you are about to 
follow is outside the range heapOrg - heapLim, don't follow it. :)

If you want, you can hook Kernel.New from your own trap handler, so that 
you can do any heap checking on every allocation - it shouldn't take 
long to track down what's causing the corruption.  But it may be enough 
to check after each command executed, for example.

> I deposit lists at free address 9FEF0H

Why is that free?  It's in the heap, isn't it?  The heap runs from 
stackOrg at 80000H to just below the video frame buffer at 0E7EF0H.

Cheers,
Paul


More information about the Oberon mailing list