void BasicBlockCoverage::convertTbToBb() { BasicBlocks::iterator it; Blocks::iterator tbit; for(tbit = m_uniqueTbs.begin(); tbit != m_uniqueTbs.end(); ++tbit) { const Block &tb = *tbit; for (uint64_t s = tb.start; s < tb.end; s++) { BasicBlock tbb(s, s+1); it = m_allBbs.find(tbb); if(it == m_allBbs.end()) { std::cerr << "Missing TB: " << std::hex << "0x" << tb.start << ":0x" << tb.end << std::endl; continue; } //assert(it != m_allBbs.end()); BasicBlock newBlock; newBlock.timeStamp = tb.timeStamp; newBlock.start = (*it).start; newBlock.end = (*it).end; if (m_coveredBbs.find(newBlock) == m_coveredBbs.end()) { m_coveredBbs.insert(newBlock); } } } }
static int lua_AddButton(lua_State *L) { if (lua_type(L, 1) != LUA_TTABLE) { lua_pushlightuserdata(L, 0); return 1; } mir_ptr<TTBButton> tbb(MakeTBButton(L)); HANDLE res = ::TopToolbar_AddButton(tbb); lua_pushlightuserdata(L, res); return 1; }