How to check if to UINT64 are equal
Nov 23, 2013 at 1:17pm UTC
I have been trying to compare if two UINT64 are equal what am i missing. I am trying to do the following "if(count() == static_cast<UINT64>(4571))". Please do i have to convert it to int?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
class mutatetriangle : public OASIS::Pin::Callback < mutatetriangle (void ) >
{
public :
mutatetriangle (void )
: count_ (0) { }
void handle_analyze (void )
{
++ this ->count_;
}
UINT64 count (void ) const
{
return this ->count_;
}
private :
UINT64 count_;
};
class Instruction : public OASIS::Pin::Instruction_Instrument <Instruction>
{
public :
void handle_instrument (const OASIS::Pin::Ins & ins)
{
if (count() == static_cast <UINT64>(4571)){
std::ofstream fout ("triangletool0_.out" ,ios::app);
fout.setf (ios::showbase);
fout << ins.disassemble()<< count() << std::endl;
//ins.direct_branch_or_call_target_address
//ARG_BRANCH_TARGET_ADDRESS
fout.close ();
}
ins.insert_call (IPOINT_BEFORE, &this ->callback_);
}
UINT64 count (void ) const
{
return this ->callback_.count ();
}
private :
mutatetriangle callback_;
static KNOB <string> outfile__;
};
Topic archived. No new replies allowed.