Skip to content

ridebuglib

This library lets a program talk to the runtime debugger while it runs: it can add and remove variable traces, switch the debugger’s procedure control and open the debugger’s variable trace, disassembly, copper and memory windows at a chosen place. The library only sends the instructions; the debugger carries them out.

The commands work only when the program is compiled with runtime error checking, that is, with the debugger. Without it they do nothing, so they can stay in the source. They can be used in Amiga mode only.

Watch a counter in hexadecimal in the variable trace window:

DEFTYPE .l
count=0
AddVarTrace count,"count",2
VarTraceWindow
For i=1 To 100
  count=count+1
Next

Based on the RI Debug Lib guide by Red When Excited.

Library number 51.

Commands

AddVarTrace

Adds a variable to the debugger’s list of traces. variable is the variable itself, string$ the name shown in the variable trace window, and output the way its value is shown.

Statement. Help text: variable,string$,output - add a variable trace
Arguments: &any, $, .b

The name need not be the variable’s name: "a (counter)" reminds you what a is used for. The type of the variable is passed along automatically. output is passed on to the debugger as it is; an output of 0 is sent as 1. A name longer than 251 characters is cut to 251.

Kept from the original: a variable whose type is not one of the basic types reaches the debugger with a meaningless type (#609).

CopperTrace

Opens the debugger’s copper window at address. With offset, address is that of a copper list object, and the window opens at the copper list whose address is the long at address plus offset.

Statement. Help text: address,[,offset] - offset<>0 for CopList objects
2 forms:

  • .l
  • .l, .w

Nothing happens if address, or the long read with offset, is 0. To open the window at the start of copper list 0:

CopperTrace Addr CopList(0),4

DelVarTrace

Asks the debugger to remove the trace with the name variable$ from its list. The name must be the one given to AddVarTrace, which need not be the variable’s.

Statement. Help text: variable$ - remove a trace on a named variable
Arguments: $

As with AddVarTrace, a name longer than 251 characters is cut to 251.

DisAsmWindow

Opens the debugger’s disassembly window at the place of this command in the program.

Statement. Help text: - open the disassembly window on the debugger screen
No arguments.

The command takes no address: the form DisAsmWindow address that the RI Debug Lib guide gives does not compile. The window opens at the DisAsmWindow statement itself, not at the command after it as the guide says.

Kept from the original: the search for the place of the command has no limit (#611).

MemoryWindow

Opens the debugger’s memory window num at address.

Statement. Help text: num#,address - open a memory window on the debugger screen
Arguments: .w, .l

ProcControl

Switches the debugger’s procedure control on or off; without an argument, it toggles it.

Statement. Help text: [On/Off]
2 forms:

  • no arguments
  • .b

VarTraceWindow

Opens the debugger’s variable trace window.

Statement. Help text: - open the variable trace window on the debugger screen
No arguments.