processor-creative-kit-0.1.0.1: a creation kit for instruction sets and cpu simulators and development tools

Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Pck.Tool.Debugger

Contents

Synopsis

Debugger drivers

runDbg :: [DbgTrc] -> [DbgBrk] -> InstImage -> DataImage -> (TrcLog, CpuState) Source

debugging run

Example: run with a break condition. (break at pc == 1)

 > runDbg [] [(BrkPc BEQ 1)] [(0,[MOVI R0 7, MOVI R1 8, HALT])] []
 pc : 1
 gr : [7,0,0,0,0,0,0,0]
 fl : [False,False]

Example: run with trace output. (instruction trace)

 > runDbg [TrcInst] [] [(0,[MOVI R0 7, MOVI R1 8, HALT])] []
 TrcInst:        pc : 0  MOVI R0 7
 
 TrcInst:        pc : 1  MOVI R1 8
 
 TrcInst:        pc : 2  HALT

runDbgIO :: [DbgTrc] -> [DbgBrk] -> InstImage -> DataImage -> IO () Source

debugging run for IO output

Example: run with trace output. (instruction trace)

 > runDbgIO [TrcInst] [] [(0,[MOVI R0 7, MOVI R1 8, HALT])] []
 TrcInst:        pc : 0  MOVI R0 7
 
 TrcInst:        pc : 1  MOVI R1 8
 
 TrcInst:        pc : 2  HALT

Data type

trace

type TrcLog = ByteString Source

data type for runDbg log

data DbgTrc Source

trace conditions for runDbg or runDbgIO

Constructors

TrcInst

trace instructions

TrcReg

trace registers

TrcPc

trace pc

TrcCall

trace call target address

TrcBranch

trace branch information

TrcLoad

trace memory load

TrcStore

trace memory store

Instances

break

data DbgBrk Source

break conditions

Example:

 BrkPc BEQ 3          -- pc == 3
 BrkPc BGE 0x80       -- pc >= 0x80
 BrkGReg R0 BEQ 7     -- R0 == 7
 BrkDmem 0x20 BLT 4   -- *0x20 < 4

Constructors

BrkNon

no break

BrkOne

always one step break

BrkPc DbgOrd Int

pc break

BrkGReg GReg DbgOrd Int

register break

BrkDmem Int DbgOrd Int

data memory break

Instances

data DbgOrd Source

break operators

Constructors

BEQ

equal

BNE

not equal

BLT

little than

BLE

little equal

BGT

greater than

BGE

greater equal

Instances