2021-08-30 02:14:06 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
// Debugging UI manager
|
|
|
|
globalThis.Debugger = class Debugger {
|
|
|
|
|
|
|
|
// Object constructor
|
|
|
|
constructor(app, sim) {
|
|
|
|
|
|
|
|
// Configure instance fields
|
|
|
|
this.app = app;
|
|
|
|
this.core = app.core;
|
|
|
|
this.gui = app.gui;
|
|
|
|
this.sim = sim;
|
|
|
|
|
2021-09-02 00:16:22 +00:00
|
|
|
// Memory window
|
2021-08-30 02:14:06 +00:00
|
|
|
this.memory = new MemoryWindow(this, {
|
|
|
|
title : "{sim}{memory._}",
|
|
|
|
height : 300,
|
|
|
|
visible: false,
|
|
|
|
width : 400
|
|
|
|
});
|
|
|
|
this.memory.addCloseListener(e=>this.memory.setVisible(false));
|
|
|
|
app.desktop.add(this.memory);
|
2021-09-02 00:16:22 +00:00
|
|
|
|
|
|
|
// CPU window
|
|
|
|
this.cpu = new CPUWindow(this, {
|
|
|
|
title : "{sim}{cpu._}",
|
|
|
|
height : 300,
|
|
|
|
visible: false,
|
|
|
|
width : 400
|
|
|
|
});
|
|
|
|
this.cpu.addCloseListener(e=>this.cpu.setVisible(false));
|
|
|
|
app.desktop.add(this.cpu);
|
2021-08-30 02:14:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////// Package Methods /////////////////////////////
|
|
|
|
|
|
|
|
// Message received from emulation thread
|
|
|
|
message(msg) {
|
2021-09-19 19:36:30 +00:00
|
|
|
switch (msg.dbgwnd) {
|
2021-09-02 00:16:22 +00:00
|
|
|
case "CPU" : this.cpu .message(msg); break;
|
2021-08-30 02:14:06 +00:00
|
|
|
case "Memory": this.memory.message(msg); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Reload all output
|
|
|
|
refresh() {
|
2021-09-02 00:16:22 +00:00
|
|
|
this.cpu .refresh();
|
2021-08-30 02:14:06 +00:00
|
|
|
this.memory.refresh();
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|