BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
ridebuglib.c File Reference
#include "blitzlib.h"

Data Structures

struct  dmessage

Macros

#define TOK_docall   0xd509
#define DC_ADDTRACE   255
#define DC_DELTRACE   254
#define DC_VARWINDOW   253
#define DC_DISWINDOW   252
#define DC_COPPERLIST   251
#define DC_PROCCONTROL   250
#define DC_MEMWINDOWMOVE   249

Functions

void _dummybranch (void)
 _dummybranch: the routine of every command, init and finit: RTS.
void _addvartracechk (void)
void _delvartracechk (void)
void _vartracewindowchk (void)
void _disasmchk (void)
void _coptracechk (void)
void _coptracechk2 (void)
void _procstatus (void)
void _procstatus2 (void)
void _memadrchk (void)
static void send (void)
static UBYTE * copyname (UBYTE *d, const UBYTE *s)
static void addvartrace_c (ULONG var, const UBYTE *name, UWORD out, const UWORD *types)
 AddVarTrace variable,string$,output (check): add a variable trace.
static void delvartrace_c (const UBYTE *name)
 DelVarTrace variable$ (check): remove a trace on a named variable.
static void vartracewindow_c (void)
 VarTraceWindow (check): open the variable trace window on the debugger screen (_varwindow, 253; data1 = $FF).
static void disasm_c (const UWORD *pc)
 DisAsmWindow (check): open the disassembly window at this instruction.
static void coptrace_c (ULONG adr)
 CopperTrace address (check): open the copper window at address.
static void coptrace2_c (const UBYTE *adr, UWORD off)
 CopperTrace address,offset (check): the copper list whose address is at address+offset (a CopList object).
static void procstatus_c (UBYTE on, UBYTE explicit)
static void procstatus0_c (void)
 ProcControl (check): toggle the procedure checking (_proccontrol, 250, data1 = data2 = 0).
static void procstatus2_c (UWORD on)
 ProcControl On|Off (check): set the procedure checking (_proccontrol, data1 = the byte, data2 = $FF).
static void memadr_c (UWORD num, ULONG adr)
 MemoryWindow num#,address (check): open a memory window on the debugger screen (_memwindowmove, 249).
 BLITZ_ERRCHK_ASM (disasmchk, " .globl __disasmchk\n" "__disasmchk:\n" " movem.l d0-d1/a0-a1,-(sp)\n" " move.l 16(sp),a0\n" " jsr _disasm_c\n" " movem.l (sp)+,d0-d1/a0-a1\n" " rts")

Variables

static struct dmessage mess1
static const UBYTE converttype [8] = { 0, 1, 2, 3, 5, 6, 0, 4 }

Macro Definition Documentation

◆ DC_ADDTRACE

#define DC_ADDTRACE   255

◆ DC_COPPERLIST

#define DC_COPPERLIST   251

◆ DC_DELTRACE

#define DC_DELTRACE   254

◆ DC_DISWINDOW

#define DC_DISWINDOW   252

◆ DC_MEMWINDOWMOVE

#define DC_MEMWINDOWMOVE   249

◆ DC_PROCCONTROL

#define DC_PROCCONTROL   250

◆ DC_VARWINDOW

#define DC_VARWINDOW   253

◆ TOK_docall

#define TOK_docall   0xd509

Function Documentation

◆ _addvartracechk()

void _addvartracechk ( void )

◆ _coptracechk()

void _coptracechk ( void )

◆ _coptracechk2()

void _coptracechk2 ( void )

◆ _delvartracechk()

void _delvartracechk ( void )

◆ _disasmchk()

void _disasmchk ( void )

◆ _dummybranch()

void _dummybranch ( void )

_dummybranch: the routine of every command, init and finit: RTS.

The commands act only in their error check routines (below), i.e. only when the program is compiled with the debugger.

◆ _memadrchk()

void _memadrchk ( void )

◆ _procstatus()

void _procstatus ( void )

◆ _procstatus2()

void _procstatus2 ( void )

◆ _vartracewindowchk()

void _vartracewindowchk ( void )

◆ addvartrace_c()

void addvartrace_c ( ULONG var,
const UBYTE * name,
UWORD out,
const UWORD * types )
static

AddVarTrace variable,string$,output (check): add a variable trace.

Sends _addtrace (255): data1 = the debugger type of the variable (converttype; 0 becomes 1), data2 = output (0 becomes 1), pad = 255, size = the variable's address, then the name. BUG(orig) (#609): the type indexes the 8 byte table unchecked. Fixed (#612): an empty name sends just its 0 (the original copied on to the next 0); fixed (#613): the name is cut to the 252 characters of mess1 with its 0.

Parameters
vard0: the variable's address (varptr)
named1: the name string
outd2: the output format (byte)
typesa2: the argument stack, -2(a2) = the variable's type word

◆ BLITZ_ERRCHK_ASM()

BLITZ_ERRCHK_ASM ( disasmchk ,
" .globl __disasmchk\n" "__disasmchk:\n" " movem.l d0-d1/a0- a1,
- sp)\n" " move.l 16(sp,
a0\n" " jsr _disasm_c\n" " movem.l(sp)+ ,
d0-d1/a0-a1\n" " rts"  )

◆ coptrace2_c()

void coptrace2_c ( const UBYTE * adr,
UWORD off )
static

CopperTrace address,offset (check): the copper list whose address is at address+offset (a CopList object).

Nothing if address or the long read there is 0.

Parameters
adrd0: the object's address
offd1: the offset (word) of the copper list pointer

◆ coptrace_c()

void coptrace_c ( ULONG adr)
static

CopperTrace address (check): open the copper window at address.

Sends _copperlist (251) with size = address; nothing if address is 0.

Parameters
adrd0: the copper list address

◆ copyname()

UBYTE * copyname ( UBYTE * d,
const UBYTE * s )
static

◆ delvartrace_c()

void delvartrace_c ( const UBYTE * name)
static

DelVarTrace variable$ (check): remove a trace on a named variable.

Sends _deltrace (254) with the name at +8. Fixed (#610): the original wrote the name at +12 (+8..+11 kept the previous message's bytes, which the debugger read as the start of the name); the name copy as in AddVarTrace (fixed (#612, #613)).

Parameters
named0: the variable's name

◆ disasm_c()

void disasm_c ( const UWORD * pc)
static

DisAsmWindow (check): open the disassembly window at this instruction.

Searches back from the return address for the TRAP #1 ($4E41) the debugger's code has in front of the call and sends _diswindow (252) with data1/data2/pad = $FF and size = its address. BUG(orig) (#611): the search has no limit.

Parameters
pca0: the return address into the program (from the assembler thunk __disasmchk)

◆ memadr_c()

void memadr_c ( UWORD num,
ULONG adr )
static

MemoryWindow num#,address (check): open a memory window on the debugger screen (_memwindowmove, 249).

Parameters
numd0: the window number (data1, a byte)
adrd1: the address (size)

◆ procstatus0_c()

void procstatus0_c ( void )
static

ProcControl (check): toggle the procedure checking (_proccontrol, 250, data1 = data2 = 0).

◆ procstatus2_c()

void procstatus2_c ( UWORD on)
static

ProcControl On|Off (check): set the procedure checking (_proccontrol, data1 = the byte, data2 = $FF).

Parameters
ond0: On/Off (the low byte)

◆ procstatus_c()

void procstatus_c ( UBYTE on,
UBYTE explicit )
static

◆ send()

void send ( void )
static

◆ vartracewindow_c()

void vartracewindow_c ( void )
static

VarTraceWindow (check): open the variable trace window on the debugger screen (_varwindow, 253; data1 = $FF).

Variable Documentation

◆ converttype

const UBYTE converttype[8] = { 0, 1, 2, 3, 5, 6, 0, 4 }
static

◆ mess1

struct dmessage mess1
static