mirror of
https://github.com/JetSetIlly/Gopher2600.git
synced 2025-04-02 11:02:17 -04:00
o debugger
- sketched in ctrl-c handling
This commit is contained in:
parent
ac05b88ac9
commit
b7e037a3b7
1 changed files with 16 additions and 0 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"headlessVCS/hardware"
|
||||
"headlessVCS/hardware/cpu"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -52,9 +53,24 @@ func (dbg *Debugger) Start(filename string) error {
|
|||
func (dbg *Debugger) inputLoop() error {
|
||||
var err error
|
||||
var result *cpu.InstructionResult
|
||||
|
||||
breakpoint := true
|
||||
next := true
|
||||
|
||||
ctrlC := make(chan os.Signal)
|
||||
signal.Notify(ctrlC, os.Interrupt)
|
||||
go func() {
|
||||
for dbg.running {
|
||||
<-ctrlC
|
||||
if dbg.runUntilBreak == true {
|
||||
dbg.runUntilBreak = false
|
||||
} else {
|
||||
// TODO: interrupt os.Stdin.Read()
|
||||
dbg.running = false
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
dbg.running = true
|
||||
for dbg.running {
|
||||
if breakpoint {
|
||||
|
|
Loading…
Add table
Reference in a new issue