aboutsummaryrefslogtreecommitdiffgithub
path: root/packages/novice-web/novice-web/components/GuiDebugger.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/novice-web/novice-web/components/GuiDebugger.tsx')
-rw-r--r--packages/novice-web/novice-web/components/GuiDebugger.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/novice-web/novice-web/components/GuiDebugger.tsx b/packages/novice-web/novice-web/components/GuiDebugger.tsx
index baa62f2..f34f480 100644
--- a/packages/novice-web/novice-web/components/GuiDebugger.tsx
+++ b/packages/novice-web/novice-web/components/GuiDebugger.tsx
@@ -59,6 +59,10 @@ export class GuiDebugger extends React.Component<GuiDebuggerProps,
}
public render() {
+ // Be a little dishonest: to avoid confusing users, get 'stuck' on halts
+ const pc = this.state.state.halted ? this.state.state.pc - this.isa.spec.pc.increment
+ : this.state.state.pc;
+
const registers = this.isa.spec.regs.map(reg => {
let values;
@@ -80,7 +84,7 @@ export class GuiDebugger extends React.Component<GuiDebuggerProps,
const rowHeight = 20;
const cols = [20, 80, 80, 80, 200];
const colVal: ((addr: number) => string)[] = [
- addr => (this.state.state.pc === addr) ? '►' : '',
+ addr => (pc === addr) ? '►' : '',
addr => this.fmtAddr(addr),
addr => this.fmtWord(this.isa.stateLoad(this.state.state, addr)),
addr => this.isa.stateLoad(this.state.state, addr).toString(10),