debugger

package
v0.0.0-...-07c6f37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package debugger provides an interactive stepping debugger for go6502 with breakpoints on instruction type, register values and memory location.

Example

An example interactive debugging session:

$ go run go6502.go --via-ssd1306 --debug
CPU PC:0xF31F AC:0x00 X:0x00 Y:0x00 SP:0x00 SR:--_b-i--
Next: SEI implied
$F31F> step
CPU PC:0xF320 AC:0x00 X:0x00 Y:0x00 SP:0x00 SR:--_b----
Next: LDX immediate $FF
$F320> break-register X $FF
Breakpoint set: X = $FF (255)
$F320> continue
Breakpoint for X = $FF (255)
CPU PC:0xF322 AC:0x00 X:0xFF Y:0x00 SP:0x00 SR:n-_b----
Next: TXS implied
$F322> step
Breakpoint for X = $FF (255)
CPU PC:0xF323 AC:0x00 X:0xFF Y:0x00 SP:0xFF SR:n-_b----
Next: CLI implied
$F323>
Breakpoint for X = $FF (255)
CPU PC:0xF324 AC:0x00 X:0xFF Y:0x00 SP:0xFF SR:n-_b-i--
Next: CLD implied
$F324>
Breakpoint for X = $FF (255)
CPU PC:0xF325 AC:0x00 X:0xFF Y:0x00 SP:0xFF SR:n-_b-i--
Next: JMP absolute $F07B
$F325> break-instruction nop
$F325> r
Breakpoint for X = $FF (255)
CPU PC:0xF07B AC:0x00 X:0xFF Y:0x00 SP:0xFF SR:n-_b-i--
Next: LDA immediate $00
$F07B> q

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Debugger

type Debugger struct {
	// contains filtered or unexported fields
}

func NewDebugger

func NewDebugger(cpu *cpu.Cpu, debugFile string) *Debugger

NewDebugger creates a debugger. Be sure to defer a call to Debugger.Shutdown() afterwards, or your terminal will be left in a broken state.

func (*Debugger) BeforeExecute

func (d *Debugger) BeforeExecute(in cpu.Instruction)

BeforeExecute receives each cpu.Instruction just before the program counter is incremented and the instruction executed.

func (*Debugger) QueueCommands

func (d *Debugger) QueueCommands(cmds []string)

Queue a list of commands to be executed at the next prompt(s). This is useful for accepting a list of commands as a CLI parameter.

func (*Debugger) Shutdown

func (d *Debugger) Shutdown()

Shutdown the debugger session, including resetting the terminal to its previous state.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL