Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TRACE_AddInstrumentFunction(Trace, 0); //called in main
- class readStore //This is for both read and write. Named read for historical reasons...
- {
- public:
- UINT64 addr;
- std::vector<LEVEL_BASE::REG> vread_regs;
- std::vector<LEVEL_BASE::REG> vwrite_regs;
- };
- for(BBL bbl=TRACE_BblHead(trace);BBL_Valid(bbl);bbl= BBL_Next(bbl))
- {
- BBL_InsertCall(bbl, IPOINT_BEFORE, AFUNPTR(docount), IARG_UINT32, BBL_NumIns(bbl), IARG_END);
- for(INS ins = BBL_InsHead(bbl); INS_Valid(ins); ins=INS_Next(ins))
- {
- LEVEL_BASE::REG readReg;
- LEVEL_BASE::REG writeReg;
- readStore *rs_temp= new readStore;
- noRRegs=INS_MaxNumRRegs(ins); //get count of read regs
- noWRegs=INS_MaxNumWRegs(ins);
- for(UINT32 i=0;i<noRRegs;i++)
- {
- readReg =INS_RegR(ins,i); //returns readR type
- if(REG_is_gr_type(readReg))
- {
- rs_temp->vread_regs.push_back(readReg) ;
- }
- //may want to add else condition
- }
- for(UINT32 j=0;j<noWRegs;j++) //store all write regs
- {
- writeReg= INS_RegW(ins,j);
- if(REG_is_gr_type(writeReg))
- {
- rs_temp->vwrite_regs.push_back(writeReg);
- }
- }
- rs_temp->addr= INS_Address(ins);
- cout << rs_temp->addr;
- cout << "n";
- readstore.push_back(*rs_temp);//array of objects with everything in it
Add Comment
Please, Sign In to add comment