Node:Examining, Next:Forgetting words, Previous:Programming Tools, Up:Programming Tools
The following words inspect the stack non-destructively:
Display the number of items on the data stack, followed by a list of the items; TOS is the right-most item.
.s-- tools ``dot-s''
Display the number of items on the floating-point stack, followed by a list of the items; TOS is the right-most item.
f.s-- gforth ``f-dot-s''
There is a word
.r but it does not display the return stack!
It is used for formatted numeric output (see Simple numeric output).
+n is the number of values that were on the data stack before +n itself was placed on the stack.
depth-- +n core ``depth''
+n is the current number of (floating-point) values on the floating-point stack.
fdepth-- +n float ``f-depth''
remove and discard all/any items from the data stack.
clearstack... -- gforth ``clear-stack''
The following words inspect memory.
Display the contents of address a-addr in the current number base.
?a-addr -- tools ``question''
Display u lines of memory starting at address addr. Each line displays the contents of 16 bytes. When Gforth is running under an operating system you may get
dumpaddr u -- tools ``dump''
Invalid memory addresserrors if you attempt to access arbitrary locations.
see allows to inspect code:
Locate name using the current search order. Display the definition of name. Since this is achieved by decompiling the definition, the formatting is mechanised and some source information (comments, interpreted sequences within definitions etc.) is lost.
see"<spaces>name" -- tools ``see''
Decompile the definition represented by xt.
xt-seext -- gforth ``xt-see''
a simple decompiler that's closer to
simple-see"name" -- gforth ``simple-see''
simple-see-rangeaddr1 addr2 -- gforth ``simple-see-range''