$NetBSD: patch-ae,v 1.2 2005/11/03 21:51:57 rillig Exp $ --- src/core.cpp 2004/08/12 17:16:45 1.1 +++ src/core.cpp 2004/08/12 17:17:18 @@ -26,7 +26,7 @@ #include "core.h" #include "isa.h" #include -#include +#include #include "disarm.h" #ifndef ARM6 #include "booth.h" @@ -34,6 +34,8 @@ #include "memory.cpp" +using namespace std; + static const char* mode_str[16] = {"reset", "fiq", "irq", "svc", NULL, NULL, NULL, "abort", NULL, NULL, NULL, "undef", @@ -4031,22 +4033,29 @@ { char str[80]; - cout.form("-------------------------------------------------------------------------------\n"); - cout.form("SWARM Core debug dump\n\n"); + cout << "-------------------------------------------------------------------------------\n"; + cout << "SWARM Core debug dump\n\n"; - cout.form("Registers:"); + cout << "Registers:"; for (int j = 0; j < 4; j++) { - for (int i = 0; i < 4; i++) - cout.form(" 0x%08X", m_regsWorking[i + (j * 4)]); - cout.form("\n\t "); + for (int i = 0; i < 4; i++) { + cout << " "; + cout << hex << m_regsWorking[i + (j * 4)]; + } + cout << "\n\t "; } - cout.form(" 0x%08X", m_regsWorking[16]); + cout << " "; + cout << hex << m_regsWorking[16]; - if (m_mode == M_FIQ) - cout.form("\tSPSR_%s[0x%08x]\n\n", mode_str[m_mode & 0xF], m_regsFiq[7]); - else if ((m_mode == M_USER) || (m_mode == M_SYSTEM)) - cout.form("\n\n"); + if (m_mode == M_FIQ) { + cout << "\tSPSR_"; + cout << mode_str[m_mode & 0xF]; + cout << "["; + cout << hex << m_regsFiq[7]; + cout << "]\n\n"; + } else if ((m_mode == M_USER) || (m_mode == M_SYSTEM)) + cout << "\n\n"; else { uint32_t* temp; @@ -4060,31 +4069,50 @@ temp = NULL; break; // ??? } - if (temp != NULL) - cout.form("\tSPSR_%s[0x%08x]\n\n", mode_str[m_mode & 0xF], temp[2]); + if (temp != NULL) { + cout << "\tSPSR_"; + cout << mode_str[m_mode & 0xF]; + cout << "["; + cout << hex << temp[2]; + cout << "]\n\n"; + } } - cout.form("Instruction Pipe (top is current instruction):\n"); + cout << "Instruction Pipe (top is current instruction):\n"; for (int i = 2; i > 0; i--) { - cout.form("\t0x%08X - ", m_iPipe[i]); + cout << "\t0x"; + cout << hex << m_iPipe[i]; + cout << " - "; memset(str, 0, 80); CDisarm::Decode(m_iPipe[i], str); - cout.form("%s\n", str); + cout << str; + cout << "\n"; } if (m_busCurrent != NULL) { - cout.form("\t0x%08X - ", m_busCurrent->Din); + cout << "\t0x"; + cout << hex << m_busCurrent->Din; + cout << " - "; memset(str, 0, 80); CDisarm::Decode(m_busCurrent->Din, str); - cout.form("%s (suspect if bad address error)\n", str); + cout << str; + cout << " (suspect if bad address error)\n"; } - cout.form("Instruction Stage last executed - %d\n\n", m_nCtrlCur); - - cout.form("DIn reg = 0x%08X DOut reg = 0x%08X Addr reg = 0x%08X\n", - m_regDataIn, m_regDataOut, m_regAddr); + cout << "Instruction Stage last executed - "; + cout << dec << m_nCtrlCur; + cout << "\n\n"; + + cout << "DIn reg = 0x"; + cout << hex << m_regDataIn; + cout << " DOut reg = 0x"; + cout << hex << m_regDataOut; + cout << " Addr reg = 0x"; + cout << hex << m_regAddr; + cout << "\n"; + cout << dec; - cout.form("-------------------------------------------------------------------------------\n"); + cout << "-------------------------------------------------------------------------------\n"; }