From cc122a7a6848ec8f79eb4b7eb52fe8991ab2dfd6 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 31 Mar 2024 18:18:26 -0400 Subject: [PATCH] Add an SWI count, to aid in logging. --- Machines/Acorn/Archimedes/Archimedes.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Machines/Acorn/Archimedes/Archimedes.cpp b/Machines/Acorn/Archimedes/Archimedes.cpp index 888a587b6..a9d4fbbd4 100644 --- a/Machines/Acorn/Archimedes/Archimedes.cpp +++ b/Machines/Acorn/Archimedes/Archimedes.cpp @@ -44,7 +44,6 @@ namespace Archimedes { #ifndef NDEBUG template struct HackyDebugger { - void notify(uint32_t address, uint32_t instruction, Executor &executor) { pc_history[pc_history_ptr] = address; pc_history_ptr = (pc_history_ptr + 1) % pc_history.size(); @@ -102,6 +101,7 @@ struct HackyDebugger { ) { if(instruction & 0x2'0000) { swis.emplace_back(); + swis.back().count = swi_count++; swis.back().opcode = instruction; swis.back().address = executor.pc(); swis.back().return_address = executor.registers().pc(4); @@ -240,7 +240,7 @@ struct HackyDebugger { if(executor.registers().pc_status(0) & InstructionSet::ARM::ConditionCode::Overflow) { auto info = logger.info(); - info.append("failed swi "); + info.append("[%d] Failed swi ", back.count); if(back.swi_name.empty()) { info.append("&%x", back.opcode & 0xfd'ffff); } else { @@ -293,8 +293,10 @@ private: std::array pc_history; std::size_t pc_history_ptr = 0; uint32_t instr_count = 0; + uint32_t swi_count = 0; struct SWICall { + uint32_t count; uint32_t opcode; uint32_t address; uint32_t regs[10];