charles quarra
2012-Nov-07 20:16 UTC
[LLVMdev] accessing personality and other exception related functions
Hi, in ExceptionDemo code ( https://llvm.org/viewvc/llvm-project/llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp?view=markup&sortby=file ) the function "ourPersonality" is defined. a llvm::Function is created with the same name inside function "createStandardUtilityFunctions". The llvm::Function is retrieved in function "createCatchWrappedInvokeFunction". But nowhere i can find where a mapping between the actual function address and this llvm::Function is done, i was expecting to find some sort of addGlobalMapping somewhere tying both ends, but i cannot find it. So, my question is; is llvm::Module::getFunction resorting to some local symbol binary search when the function is unmapped? how does it find the actual "ourPersonality" function? Would it work the same if i just replaced that name with "__gxx_personality_v0"? or do i need to link my executable against some library?
Duncan Sands
2012-Nov-08 08:25 UTC
[LLVMdev] accessing personality and other exception related functions
Hi Charles,> in ExceptionDemo code ( > https://llvm.org/viewvc/llvm-project/llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp?view=markup&sortby=file > ) the function "ourPersonality" is defined. a llvm::Function is > created with the same name inside function > "createStandardUtilityFunctions". The llvm::Function is retrieved in > function "createCatchWrappedInvokeFunction". But nowhere i can find > where a mapping between the actual function address and this > llvm::Function is done, i was expecting to find some sort of > addGlobalMapping somewhere tying both ends, but i cannot find it. > > So, my question is; is llvm::Module::getFunction resorting to some > local symbol binary search when the function is unmapped? how does it > find the actual "ourPersonality" function? > > Would it work the same if i just replaced that name with > "__gxx_personality_v0"? or do i need to link my executable against > some library?it assumes you are linking against a library that provides the personality function. In your case that means linking against libstdc++ IIRC. Ciao, Duncan.
Apparently Analagous Threads
- [LLVMdev] Fwd: error while linking modules with exception handling demo code
- [LLVMdev] Catching exceptions passed through a JIT ExecutionEngine
- [LLVMdev] r98459 break of ExceptionDemo
- [LLVMdev] r98459 break of ExceptionDemo
- [LLVMdev] r98459 break of ExceptionDemo