本文整理汇总了C++中MemoryArea::read方法的典型用法代码示例。如果您正苦于以下问题:C++ MemoryArea::read方法的具体用法?C++ MemoryArea::read怎么用?C++ MemoryArea::read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MemoryArea
的用法示例。
在下文中一共展示了MemoryArea::read方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doRead
bool MainMemoryAccessBase::doRead(uint32_t address, uint32_t* buffer, size_t count)
{
MemoryArea* cpu = mm->getMemoryArea("CPU");
if (!cpu)
return false;
uint32_t pc = 0;
cpu->read(0, &pc, 1);
bool omitFirst = (address & 0x1);
if (omitFirst) {
--address;
++count;
}
bool omitLast = (count & 1);
if (omitLast) {
++count;
}
const hal_id readMacro = devHandle->supportsQuickMemRead() ?
ID_ReadMemQuick : ID_ReadMemWords;
HalExecElement* el = new HalExecElement(this->devHandle->checkHalId(readMacro));
el->appendInputData32(this->getStart() + address);
el->appendInputData32(static_cast<uint32_t>(count/2));
el->appendInputData32(pc);
el->setOutputSize(count);
ReadElement r(buffer, count, omitFirst, omitLast, 0);
this->readMap[this->elements.size()] = r;
this->elements.push_back(el);
return true;
}
示例2: HalExecElement
bool DebugManagerV3::run (uint16_t controlMask, DebugEventTarget * cb, bool releaseJtag)
{
MemoryManager* mm = this->parent->getMemoryManager();
MemoryArea* cpu = mm->getMemoryArea("CPU");
if (!cpu)
{
return false;
}
lpm5WakeupDetected = false;
if(cb!=0)
{
cbx=cb;
}
uint32_t pc, sr;
cpu->read(0, &pc, 1);
cpu->read(2, &sr, 1);
if(mm->flushAll()==false)
{
return false;
}
cycleCounter_.reset();
ConfigManager *cm = parent->getFetHandle()->getConfigManager();
const uint16_t mdb = parent->getEmulationManager()->getSoftwareBreakpoints()->getSwbpManager()->getInstructionAt(pc);
if (mdb != 0)
{
mdbPatchValue = mdb;
}
HalExecElement* el = new HalExecElement(this->parent->checkHalId(ID_RestoreContext_ReleaseJtag));
this->parent->getWatchdogControl()->addParamsTo(el);
el->appendInputData32(pc);
el->appendInputData16(sr);
el->appendInputData16(controlMask!=0? 0x0007: 0x0006); // eem control bits
el->appendInputData16(mdbPatchValue); // mdb
el->appendInputData16(releaseJtag ? 1 : 0);
el->appendInputData16(cm->ulpDebugEnabled() ? 1 : 0);
mdbPatchValue = 0;
HalExecCommand cmd;
cmd.elements.push_back(el);
if (!this->parent->send(cmd))
{
return false;
}
// handle lpmx5 polling
if (releaseJtag)
{
pausePolling();
}
else
{
this->resumePolling();
}
if (controlMask!=0 && !releaseJtag)
{
if (!activatePolling(controlMask))
{
return false;
}
}
resetCycleCounterBeforeNextStep = true;
return true;
}