Calc-U 59 Help 7 Debugger

Chapter 7 · Debugger

Debugger

The debugger stops a running machine, lets you step through it, and records what its processor does. Use it to find out why a program does what it does, or to follow the ROM through a routine. What the product's debug panel shows, its debugger in an editor, breakpoints and watches are in the product's part: Debugger of this product.

Running and paused

A machine is either running or paused. While it is paused:

A pause has a level. Every product has the level of single instructions, cpu; a product may have a level of its own, such as one program step of a user program. The product's part says which levels it has.

Pause, step and resume

The window has three run-control buttons for a level: pause, step and resume. Their labels and their place are the product's.

Button Can be used Does
Pause while the machine runs pauses it where that level lands
Step while it is paused at that level carries out one step and pauses again; held down, it repeats four times a second
Resume while it is paused at that level lets it run on

Machine ▸ Resume resumes the machine whatever paused it. It can be used while the machine is paused.

Traces

A trace records every instruction the processor carries out into a trace file, in the product's trace format. Start one with the product's trace button or with a preset's trace: step.

Debugger steps in a preset

A preset can drive the debugger with these steps (Presets):

Step What it does
trace: <file name> starts a trace into that file in the trace folder; no / or \ in the name
trace: off ends the trace
pause: <level> pauses the machine at that level; already paused: nothing happens
pause-on-start: <level> / off pauses at the next start the level names (the next program step; the processor leaving key readiness); off disarms it
step: { level: <level>, count: n } while paused, carries out n steps (1 to 100000; 1 without a count); not paused, a line in the log and nothing else
resume: lets the paused machine run on
debug-panel: <view> shows that view of the debug panel; a frontend without the panel ignores it

Not every product defines every one of these steps on every model; the product's part says which it takes. A step it does not take refuses the preset when it is read.

While the machine is paused, a step that needs it to run (a key press, a program to write into memory) waits until it runs again; the debugger steps go on, so step: and resume: work. A wait: while paused counts the computer's time and ends with the machine still paused. A preset that ends paused leaves the machine paused.

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