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

@ -42,7 +42,7 @@ void SimulatorController::initExperiments()
/* empty. */
}
void SimulatorController::onBreakpointEvent(address_t instrPtr)
void SimulatorController::onBreakpointEvent(address_t instrPtr, address_t address_space)
{
assert(false &&
"FIXME: SimulatorController::onBreakpointEvent() has not been tested before");
@ -54,8 +54,8 @@ void SimulatorController::onBreakpointEvent(address_t instrPtr)
while (it != m_EvList.end())
{
fi::BaseEvent* pev = *it;
fi::BPEvent* pbp; fi::BPRangeEvent* pbpr;
if((pbp = dynamic_cast<fi::BPEvent*>(pev)) && pbp->isMatching(instrPtr))
fi::BPSingleEvent* pbp; fi::BPRangeEvent* pbpr;
if((pbp = dynamic_cast<fi::BPSingleEvent*>(pev)) && pbp->isMatching(instrPtr, address_space))
{
pbp->setTriggerInstructionPointer(instrPtr);
it = m_EvList.makeActive(it);
@ -64,7 +64,7 @@ void SimulatorController::onBreakpointEvent(address_t instrPtr)
continue; // -> skip iterator increment
}
else if((pbpr = dynamic_cast<fi::BPRangeEvent*>(pev)) &&
pbpr->isMatching(instrPtr))
pbpr->isMatching(instrPtr, address_space))
{
pbpr->setTriggerInstructionPointer(instrPtr);
it = m_EvList.makeActive(it);

View File

@ -81,8 +81,9 @@ class SimulatorController
* Breakpoint event handler. This routine needs to be called in the
* simulator specific backend each time a breakpoint event occurs.
* @param instrPtr the instruction pointer of the breakpoint event
* @param address_space the address space it should occur in
*/
void onBreakpointEvent(address_t instrPtr);
void onBreakpointEvent(address_t instrPtr, address_t address_space);
/**
* Memory access event handler (read/write).
* @param addr the accessed memory address

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;

View File

@ -83,7 +83,7 @@ void OVPController::onInstrPtrChanged(address_t instrPtr)
{
// FIXME: Performance verbessern (dazu muss entsprechend auch die Speicherung
// in EventList(.cc|.hpp) angepasst bzw. verbessert werden).
fi::BPEvent* pEvBreakpt = dynamic_cast<fi::BPEvent*>(*it);
fi::BPSingleEvent* pEvBreakpt = dynamic_cast<fi::BPSingleEvent*>(*it);
if(pEvBreakpt && (instrPtr == pEvBreakpt->getWatchInstructionPointer() ||
pEvBreakpt->getWatchInstructionPointer() == fi::ANY_ADDR))
{