From 5df0b6f70f8cde6e317b081f9e00bff8477a7e92 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Sat, 20 Apr 2024 22:22:28 +0200 Subject: [PATCH] show wait state in debugger --- cpu.h | 4 ++-- debugger.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cpu.h b/cpu.h index e5010f2..a6028cf 100644 --- a/cpu.h +++ b/cpu.h @@ -126,8 +126,6 @@ public: uint64_t get_wait_time() const { return wait_time; } std::tuple get_mips_rel_speed(const std::optional & instruction_count, const std::optional & t_diff_1s) const; - std::map > get_queued_interrupts() const { return queued_interrupts; } - bool get_debug() const { return debug_mode; } void set_debug(const bool d) { debug_mode = d; stacktrace.clear(); } std::vector > get_stack_trace() const; @@ -141,6 +139,8 @@ public: void init_interrupt_queue(); void queue_interrupt(const uint8_t level, const uint8_t vector); + std::map > get_queued_interrupts() const { return queued_interrupts; } + std::optional get_interrupt_delay_left() const { return trap_delay; } void trap(uint16_t vector, const int new_ipl = -1, const bool is_interrupt = false); bool is_it_a_trap() const { return it_is_a_trap; } diff --git a/debugger.cpp b/debugger.cpp index 153d328..114dfa3 100644 --- a/debugger.cpp +++ b/debugger.cpp @@ -720,6 +720,12 @@ void show_queued_interrupts(console *const cnsl, cpu *const c) { cnsl->put_string_lf(format("Current level: %d", c->getPSW_spl())); + auto delay = c->get_interrupt_delay_left(); + if (delay.has_value()) + cnsl->put_string_lf(format("Current delay left: %d", delay.value())); + else + cnsl->put_string_lf("No delay"); + auto queued_interrupts = c->get_queued_interrupts(); for(auto & level: queued_interrupts) {