I'm in the midst of writing some routines to debug pasm code, and one of 
the things I dearly want is a "stack dump" routine.  I can *almost* code 
this in pasm, except I'm missing one last component: a way to tell the 
depth of the stack without causing the runtime to bail.

Any of the following would help:

1. a rotate_up() that doesn't take an argument, instead the WHOLE stack 
rotates.  I could push a sentinel on the stack before rotating and stop 
when I get back to it.

2. an opcode that will tell me the stack depth, (like a mod to entrytype to 
let me know I've underflowed or something.)

3. A mod to rotate_up or entrytype that lets me start indexing from the 
*bottom* of the stack.  Again, I could use a sentinel to know when to quit.

4. some way of harmlessly catching the internal error "Stack Depth Wrong"

I'd like this stack dump to be unobtrusive, so I can continue processing 
after taking a snapshot of things.  Suggestions?

[I'm not subscribed to p6i, cc me if you can otherwise I'll catch it in 
archives.  Thanks.]

Reply via email to