TraceFlag('LocalApic', "Local APIC debugging")
TraceFlag('PageTableWalker', \
"Page table walker state machine debugging")
+ TraceFlag('Faults', "Trace all faults/exceptions/traps")
SimObject('X86LocalApic.py')
SimObject('X86System.py')
#if FULL_SYSTEM
void X86FaultBase::invoke(ThreadContext * tc)
{
+ Addr pc = tc->readPC();
+ DPRINTF(Faults, "RIP %#x: vector %d: %s\n", pc, vector, describe());
using namespace X86ISAInst::RomLabels;
HandyM5Reg m5reg = tc->readMiscRegNoEffect(MISCREG_M5_REG);
MicroPC entry;
entry = extern_label_legacyModeInterrupt;
}
tc->setIntReg(INTREG_MICRO(1), vector);
- tc->setIntReg(INTREG_MICRO(7), tc->readPC());
+ tc->setIntReg(INTREG_MICRO(7), pc);
if (errorCode != (uint64_t)(-1)) {
if (m5reg.mode == LongMode) {
entry = extern_label_longModeInterruptWithError;
tc->setMicroPC(romMicroPC(entry));
tc->setNextMicroPC(romMicroPC(entry) + 1);
}
+
+ std::string
+ X86FaultBase::describe() const
+ {
+ std::stringstream ss;
+ ccprintf(ss, "%s", mnemonic());
+ if (errorCode != (uint64_t)(-1)) {
+ ccprintf(ss, "(%#x)", errorCode);
+ }
+
+ return ss.str();
+ }
void X86Trap::invoke(ThreadContext * tc)
{
}
}
+ std::string
+ PageFault::describe() const
+ {
+ std::stringstream ss;
+ ccprintf(ss, "%s at %#x", X86FaultBase::describe(), addr);
+ return ss.str();
+ }
+
#endif
} // namespace X86ISA
#include "base/misc.hh"
#include "sim/faults.hh"
+#include <string>
+
namespace X86ISA
{
// Base class for all x86 "faults" where faults is in the m5 sense
#if FULL_SYSTEM
void invoke(ThreadContext * tc);
+
+ virtual std::string describe() const;
#endif
};
#if FULL_SYSTEM
void invoke(ThreadContext * tc);
+
+ virtual std::string describe() const;
#endif
};
{
public:
SoftwareInterrupt(uint8_t _vector) :
- X86Interrupt("Software Interrupt", "INTn", _vector)
+ X86Interrupt("Software Interrupt", "#INTR", _vector)
{}
bool isSoft()