💾 Archived View for gem.librehacker.com › gemlog › tech › 20220414-0.gmi captured on 2024-06-16 at 12:30:28. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-04-28)

-=-=-=-=-=-=-

RP2040 Mecrisp Stellaris: Viewing Data Stack Values in GDB

This information applies to Mecrisp Stellaris Forth running on a rp2040 platform such as Rpi Pico.

Top of Stack (TOS) is stored in register r6. So a simple "i r r6" or "print $r6" will get you the TOS value.

The rest of the data stack is stored in RAM, with a point to the top value stored in register r7. The data stack is 32 bit cells, so "x /8dw $r7" will show the next eight values of the stack. Use "x /8hw $r7" if you want them printed as hex values instead of decimal.

Just keep in mind that whenever you pause execution while the interpreter seems to be idle, the interpreter is actually running various procedures to check for serial communication, so it might have some of its own stack data on top of yours.