Calc-U 59 Help 7 Debugger Debugger of Calc-U-59

Chapter 7 · Debugger

Debugger of Calc-U-59

Running and paused, pause, step and resume, traces and the debugger steps of a preset are the family's: Debugger. This part shows Calc-U-59's debug panel and its two levels: program, one step of a keystroke program, and cpu, one instruction of the calculator's processor.

The debug panel stands beside the calculator and the paper on macOS, Windows and Linux, on the iPad in landscape and in the browser's wide layout; in portrait on the iPhone and the iPad it is a page of its own (Settings ▸ Layout ▸ Debug Page in Portrait). It has three tabs: CALCULATOR, CPU and RUN LOG.

Tab Shows Use it for
CALCULATOR the program around the next step, the registers, the flags, at the level program stepping through your own program
CPU the processor's last instructions, at the level cpu following the ROM's own logic one instruction at a time
RUN LOG the log, the dumps, the TRACE button recording a trace to study afterwards

The run-control buttons

The CALCULATOR and the CPU tab each have a row of buttons in their header:

FREEZE and FREEZE ON START can be used while the calculator runs. Once it is paused, RESUME and STEP work in the tab that paused it. Machine ▸ Resume resumes it whatever paused it.

CALCULATOR tab

The CALCULATOR tab shows the calculator between two program steps:

While the calculator is paused the tab also has the whole listing of the program that runs. Fast mode is shown while a program runs in it (Fast mode).

The CALCULATOR tab on an iPhone

CPU tab

The CPU tab lists the instructions the processor carried out, each with its address, its text and the registers. Each entry already ran: the newest 32 while the calculator runs, up to 1024 and the next instruction while it is paused, so you can scroll back. Jumps, subroutine calls and the ROM's page changes show in the addresses.

The CPU tab on an iPad

RUN LOG tab

Traces

A trace started with the TRACE button is named after the model: CALCU59_TRACE.bin, CALCU58_TRACE.bin or CALCU58C_TRACE.bin. It goes into the trace folder (the family's rules):

System Trace folder
iPhone, iPad the app's own storage (Application Support), or its iCloud folder when Settings ▸ Tracing ▸ Save Location says iCloud
macOS, Windows, Linux the save folder, unless Settings ▸ Tracing ▸ Trace folder names another
the browser a trace that ended is offered to download, in the wide layout

Only one trace runs at a time, the button's or a preset's; it holds the processor's instructions and the gaps between them. When the file reaches the size limit (Settings ▸ Tracing ▸ Maximum file size), the trace ends and a notice says so.

To read a trace, download or clone the repository tinue/Calc-U on a computer with Python, and in products/calc-u-59/ run:

python3 tools/read_trace.py --clean --skip-repeating CALCU59_TRACE.bin > CALCU59_TRACE.txt

The script needs the files next to it (the disassembler and its table of mnemonics), so it cannot be downloaded alone. The binary file can be large (190 MB for a long session), the text much smaller, because the script folds repeated loops such as the keyboard scan loop.

Good to know

Help built from Calc-U-59-help.zip 3.1.0, the help of the Calc-U-59 3.1.0 release.