The patch I announced on the mailing list regarding address space recognition.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1275 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
unzner
2012-05-28 09:23:27 +00:00
parent ae1459e6fd
commit ebd62281c3
27 changed files with 642 additions and 85 deletions

View File

@ -87,7 +87,7 @@ void BochsController::dbgEnableInstrPtrOutput(unsigned regularity, std::ostream*
}
#endif // DEBUG
void BochsController::onInstrPtrChanged(address_t instrPtr)
void BochsController::onInstrPtrChanged(address_t instrPtr, address_t address_space)
{
#ifdef DEBUG
if(m_Regularity != 0 && ++m_Counter % m_Regularity == 0)
@ -99,8 +99,7 @@ void BochsController::onInstrPtrChanged(address_t instrPtr)
{
// FIXME: Maybe we need to improve the performance of this check.
fi::BPEvent* pEvBreakpt = dynamic_cast<fi::BPEvent*>(*it);
if(pEvBreakpt && (instrPtr == pEvBreakpt->getWatchInstructionPointer() ||
pEvBreakpt->getWatchInstructionPointer() == fi::ANY_ADDR))
if(pEvBreakpt && pEvBreakpt->isMatching(instrPtr, address_space))
{
pEvBreakpt->setTriggerInstructionPointer(instrPtr);
it = m_EvList.makeActive(it);
@ -108,13 +107,6 @@ void BochsController::onInstrPtrChanged(address_t instrPtr)
// makeActive()):
continue; // -> skip iterator increment
}
fi::BPRangeEvent* pEvRange = dynamic_cast<fi::BPRangeEvent*>(*it);
if(pEvRange && pEvRange->isMatching(instrPtr))
{
pEvRange->setTriggerInstructionPointer(instrPtr);
it = m_EvList.makeActive(it);
continue; // dito.
}
it++;
}
m_EvList.fireActiveEvents();

View File

@ -86,8 +86,9 @@ class BochsController : public SimulatorController
* Instruction pointer modification handler. This method is called (from
* the Breakpoints aspect) every time when the Bochs-internal IP changes.
* @param instrPtr the new instruction pointer
* @param address_space
*/
void onInstrPtrChanged(address_t instrPtr);
void onInstrPtrChanged(address_t instrPtr, address_t address_space);
/**
* This method is called when an experiment flow adds a new event by
* calling \c simulator.addEvent(pev) or \c simulator.addEventAndWait(pev).

View File

@ -25,7 +25,7 @@ aspect Breakpoints
//bxInstruction_c* pInstr = *(tjp->arg<1>());
// report this event to the Bochs controller:
sal::simulator.onInstrPtrChanged(pThis->get_instruction_pointer());
sal::simulator.onInstrPtrChanged(pThis->get_instruction_pointer(), pThis->cr3);
// Note: get_bx_opcode_name(pInstr->getIaOpcode()) retrieves the mnemonics.
}
};

View File

@ -2,6 +2,7 @@
#define __CREDITS_AH__
#include <string.h>
#include <stdio.h>
aspect credits {
bool first;