Hi,

I'm working on a hack to forcibly corrupt the target of a direct control
branch currently being taken, but I'm not sure how to actually set the
desired PC value.

Within BaseSimpleCPU::advancePC, I check to see if the curStaticInst is a
direct control branch, and if it is, I retrieve the PC branch target
curStaticInst->branchTarget(thread->pcState()).pc()). 
After this, I make a new PC value based on this, and now I want to
essentially change the pc value mentioned to a new value.

I've been trying to something like this:

uint64_t fpc = curStaticInst->branchTarget(thread->pcState()).pc();
fpc = BLAH;
TheISA::PCState pcn = curStaticInst->branchTarget(thread->pcState()); 
pcn.pc(fpc); //At this point, pcn.pc() will return the value I want, but it
isn't set externally to this method
curStaticInst->branchTarget(thread->pcState(pcn)); // I thought this would
set, but it doesn't
TheISA::advancePC(pcn, curStaticInst); //Standard for the end of advancePC
thread->pcState(pcn);
//Standard for the end of advancePC

Any help would be appreciated. Forgive my stupidity, assuming there are
copious amounts of it.

Thanks,
Griffin

_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to