Files
fail/src/core/sal/bochs/Breakpoints.ah

35 lines
913 B
Plaintext

#ifndef __BREAKPOINTS_AH__
#define __BREAKPOINTS_AH__
#include "config/FailConfig.hpp"
#ifdef BUILD_BOCHS
#ifdef CONFIG_EVENT_BREAKPOINTS
#include "bochs.h"
#include "cpu/cpu.h"
#include "../SALInst.hpp"
aspect Breakpoints {
pointcut cpuLoop() = "void defineCPULoopJoinPoint(...)";
advice execution (cpuLoop()) : after () // event source: "instruction pointer"
{
// Points to the cpu class: "this" if BX_USE_CPU_SMF == 0,
// BX_CPU(0) otherwise
BX_CPU_C* pThis = *(tjp->arg<0>());
// Points to the *current* bxInstruction-object
bxICacheEntry_c* pEntry = *(tjp->arg<1>());
// report this event to the Bochs controller:
fail::simulator.onInstrPtrChanged(pThis->get_instruction_pointer(), pThis->cr3, pThis, pEntry);
// Note: get_bx_opcode_name(pInstr->getIaOpcode()) retrieves the mnemonics.
}
};
#endif // CONFIG_EVENT_BREAKPOINTS
#endif // BUILD_BOCHS
#endif // __BREAKPOINTS_AH__