Skip to content

CPUDebuggerAPI ​

cpp
#include <VirtualC64.h>
cpp
class CPUDebuggerAPI

Defined in VirtualC64.h:366

CPU Debugger API

Public Methods ​

ReturnNameDescription
isizeloggedInstructions constReturns the number of instructions in the record buffer.
voidclearLogEmpties the record buffer.
RecordedInstructionlogEntry constReturns an entry from the record buffer. Returned by value (rather than by reference) since the log buffer is written concurrently by the emulator thread.
voidsetNumberFormatDetermines how the disassembler displays numbers.
stringdisassemble constDisassembles an instruction.
stringdisassembleRecorded constDisassembles an instruction from the record buffer.

loggedInstructions ​

const

cpp
isize loggedInstructions() const

Defined in VirtualC64.h:380

Returns the number of instructions in the record buffer.

NOTE

The record buffer is only filled in track mode. To save computation time, the GUI enables track mode when the CPU inspector is opened and disables track mode when it is closed.


clearLog ​

cpp
void clearLog()

Defined in VirtualC64.h:384

Empties the record buffer.


logEntry ​

const

cpp
RecordedInstruction logEntry(isize nr) const

Defined in VirtualC64.h:393

Returns an entry from the record buffer. Returned by value (rather than by reference) since the log buffer is written concurrently by the emulator thread.

Returns ​

The recorded instruction, including the address (pc) it was fetched from.

Parameters ​

ParameterTypeDescription
nrisizeIndex of the instruction in the record buffer

setNumberFormat ​

cpp
void setNumberFormat(DasmNumberFormat instrFormat, DasmNumberFormat dataFormat)

Defined in VirtualC64.h:399

Determines how the disassembler displays numbers.

Parameters ​

ParameterTypeDescription
instrFormatDasmNumberFormatFormat for numbers inside instructions
dataFormatDasmNumberFormatFormat for printed data values

disassemble ​

const

cpp
string disassemble(u16 addr, const string & fmt, isize * len = nullptr) const

Defined in VirtualC64.h:409

Disassembles an instruction.

Returns ​

The disassembled text.

Parameters ​

ParameterTypeDescription
addru16Address of the instruction to disassemble
fmtconst string &String defining the output format. The directives are p (address), b (instruction bytes), i (instruction), and f (flags, recorded instructions only).
lenisize *If given, receives the length of the instruction in bytes.

disassembleRecorded ​

const

cpp
string disassembleRecorded(isize nr, const string & fmt, isize * len = nullptr) const

Defined in VirtualC64.h:417

Disassembles an instruction from the record buffer.

Returns ​

The disassembled text.

Parameters ​

ParameterTypeDescription
nrisizeIndex of the instruction in the record buffer
fmtconst string &String defining the output format (see disassemble())
lenisize *If given, receives the length of the instruction in bytes.