mirror of
https://github.com/JetSetIlly/Gopher2600.git
synced 2024-05-20 13:48:02 -04:00
c19a37a738
two reasons: 1) to keep performance acceptable playmode only checks halting conditions on a CPU instruction boundary. however a CLK changes many times during an instruction meaning it will never match. 2) a CLK breakpoint will always match within 228 emulation ticks so there is no point entering playmode at all because it will definitely drop back to the debugger (within microseconds) added a range change check to SCANLINE and CLK targets in breakpoints.parseCommand(). we know what the possible values are for these targets so we can be helpful and inform the user the some values will never match
72 lines
2.2 KiB
Go
72 lines
2.2 KiB
Go
// This file is part of Gopher2600.
|
|
//
|
|
// Gopher2600 is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// Gopher2600 is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with Gopher2600. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
package debugger_test
|
|
|
|
func (trm *mockTerm) testWatches() {
|
|
// debugger starts off with no watches
|
|
trm.sndInput("LIST WATCHES")
|
|
trm.cmpOutput("no watches")
|
|
|
|
// add read watch. there should be no output.
|
|
trm.sndInput("WATCH READ 0x80")
|
|
trm.cmpOutput("")
|
|
|
|
// try to re-add the same watch
|
|
trm.sndInput("WATCH READ 0x80")
|
|
trm.cmpOutput("already being watched (0x0080 (RAM) read)")
|
|
|
|
// list watches
|
|
trm.sndInput("LIST WATCHES")
|
|
trm.cmpOutput(" 0: 0x0080 (RAM) read")
|
|
|
|
// try to re-add the same watch but with a different event selector
|
|
trm.sndInput("WATCH WRITE 0x80")
|
|
trm.cmpOutput("")
|
|
|
|
// list watches
|
|
trm.sndInput("LIST WATCHES")
|
|
trm.cmpOutput(" 1: 0x0080 (RAM) write")
|
|
|
|
// clear watches
|
|
trm.sndInput("CLEAR WATCHES")
|
|
trm.cmpOutput("watches cleared")
|
|
|
|
// no watches after successful clear
|
|
trm.sndInput("LIST WATCHES")
|
|
trm.cmpOutput("no watches")
|
|
|
|
// try adding an invalid read address by symbol
|
|
trm.sndInput("WATCH READ VSYNC")
|
|
trm.cmpOutput("invalid watch address (VSYNC) expecting 16-bit address or a read symbol")
|
|
|
|
// add address by symbol. no read/write modifier means it tries
|
|
trm.sndInput("WATCH WRITE VSYNC")
|
|
trm.cmpOutput("")
|
|
|
|
// last item in list watches should be the new entry
|
|
trm.sndInput("LIST WATCHES")
|
|
trm.cmpOutput(" 0: 0x0000 (VSYNC) (TIA) write")
|
|
|
|
// add address by symbol. no read/write modifier means it tries
|
|
// plus a specific value
|
|
trm.sndInput("WATCH WRITE VSYNC 0x1")
|
|
trm.cmpOutput("")
|
|
|
|
// last item in list watches should be the new entry
|
|
trm.sndInput("LIST WATCHES")
|
|
trm.cmpOutput(" 1: 0x0000 (VSYNC) (TIA) write (value=0x01)")
|
|
}
|