| 1 | package com.rox; | |
| 2 | ||
| 3 | import com.rox.debug.labels.LabelWatchTarget; | |
| 4 | ||
| 5 | import java.util.Map; | |
| 6 | import java.util.function.IntUnaryOperator; | |
| 7 | ||
| 8 | /** {@link LabelWatchTarget} over a live {@link NES}: its debugging edits, and {@link NesMemoryDebugSource}'s side-effect-free reads. */ | |
| 9 | final class NesLabelWatchTarget implements LabelWatchTarget { | |
| 10 | private final NES nes; | |
| 11 | private final NesMemoryDebugSource memory; | |
| 12 | ||
| 13 | NesLabelWatchTarget(final NES nes){ | |
| 14 | this.nes = nes; | |
| 15 | this.memory = new NesMemoryDebugSource(nes); | |
| 16 | } | |
| 17 | ||
| 18 | @Override | |
| 19 | public IntUnaryOperator peek(){ | |
| 20 |
1
1. peek : replaced return value with null for com/rox/NesLabelWatchTarget::peek → KILLED |
return memory.peek(); |
| 21 | } | |
| 22 | ||
| 23 | @Override | |
| 24 | public void poke(final int address, final int value){ | |
| 25 |
1
1. poke : removed call to com/rox/NES::pokeMemory → KILLED |
nes.pokeMemory(address, value); |
| 26 | } | |
| 27 | ||
| 28 | @Override | |
| 29 | public void lock(final int address, final int value){ | |
| 30 |
1
1. lock : removed call to com/rox/NES::lockMemory → KILLED |
nes.lockMemory(address, value); |
| 31 | } | |
| 32 | ||
| 33 | @Override | |
| 34 | public void unlock(final int address){ | |
| 35 |
1
1. unlock : removed call to com/rox/NES::unlockMemory → KILLED |
nes.unlockMemory(address); |
| 36 | } | |
| 37 | ||
| 38 | @Override | |
| 39 | public Map<Integer, Integer> locks(){ | |
| 40 |
1
1. locks : replaced return value with Collections.emptyMap for com/rox/NesLabelWatchTarget::locks → KILLED |
return nes.lockedMemory(); |
| 41 | } | |
| 42 | } | |
Mutations | ||
| 20 |
1.1 |
|
| 25 |
1.1 |
|
| 30 |
1.1 |
|
| 35 |
1.1 |
|
| 40 |
1.1 |