Displaying 1 result from an estimated 1 matches for "print1fptr".
2013 Nov 21
1
[LLVMdev] Replacing C-style function
...s point, I am able to retrieve pointers to all the 3 functions
(print1, print2 and mainOfLibrary) correctly and execute them as well, e.g:
//check the print1f is behaving properly
llvm::Function *print1f = main->getFunction( "print1" );
ASSERT_NE( print1f, nullptr );
void *print1fPtr = ee->getPointerToFunction( print1f );
int ret = ((int(*)(void))(print1fPtr))();
EXPECT_EQ(0xdeadbeef, ret);
However, when i try to replace the use of print1 with print2, it doesn't
seem to work correctly. This is the sequence of steps that I am following:
llvm::Function *print2...