[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
1.1 Inspecting | ||
1.2 Single stepping |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
ANS Forth defines some "Programming Tools", words to inspect the stack, memory, compiled code and what words are defined.
displays the stacks. There are two stacks: integer and floating point.
12345 HEX 67890 ok .S 424080 [00067890] 12345 [00003039] ok
the first line shows the topmost item.
HEX 123456.78E90 ok DECIMAL 123456.78E90 ok .S 291 [00000123] 1.234568E+95 1164414608 [45678E90] ok
Confusing example? Remember that floating point input only works when the number base is decimal. The first number looks like a floating point number but is a good hex double integer too. Number base is hex. Thus it is accepted as hex number. Second try with decimal inputs the floating point number.
D. 1250999897744 ok .S <stack empty> 1.234568E+95 ok
Displays the integer at address addr, equivalent to ‘ .’, thus sensitive to ‘BASE’.
Displays u bytes of memory starting at address addr. You can easily cause a segmentation fault or something like that by accessing memory that doesn’t belong to the pfe-process.
decompiles the following word trying to display a reasonable indented source text. If you define your own control structures or use extended control-flow patterns, the indentation may be suboptimal.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
pfe includes a simple debugging and profiling facility: You can single step though a definition after saying ‘DEBUG definition’. Next time the ‘definition’ gets executed the single stepper takes control.
When this happens you see the top stack items displayed in one line. The topmost stack item is the first in line, the second and following stack items are displayed throughout the end of the line. This line is empty if the stack is empty when the word in question executes.
On the next line you see the first word to become executed inside ‘definition’.
1.2.1 Single Stepper Keys |
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You see a prompt ‘>’ right of the first displayed word. At this prompt you have several options. Choose one by typing one key:
After the actual word finished execution the resulting stack is printed on the current line. The next line shows the next next word to become executed.
Having repeated this step several times, you can see to the right of every decompiled word what changes to the stack this word caused by comparing with the stack display on the line above.
You can single step through colon-definitions and the children of defining words. You can single step only loaded words, i.e. none of the kernel words.
[Top] | [Contents] | [Index] | [ ? ] |
This document was generated on November 5, 2024 using texi2html 5.0.
The buttons in the navigation panels have the following meaning:
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ << ] | FastBack | Beginning of this chapter or previous chapter | 1 |
[ < ] | Back | Previous section in reading order | 1.2.2 |
[ Up ] | Up | Up section | 1.2 |
[ > ] | Forward | Next section in reading order | 1.2.4 |
[ >> ] | FastForward | Next chapter | 2 |
[Top] | Top | Cover (top) of document | |
[Contents] | Contents | Table of contents | |
[Index] | Index | Index | |
[ ? ] | About | About (help) |
where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:
This document was generated on November 5, 2024 using texi2html 5.0.