Within __wrap___cxa_rethrow and __wrap___cxa_throw, we check the build type and unwind the frame based on what we see in the disassembly. This is very fragile and breaks anytime we change those functions. We should, before main is called, scan the index for the location of both of these function's index entry, use those to create unwind instruction for both and cache the unwind information. Now when throw or rethrow are called, simply pass the already made unwind instructions to unwind frame along with the virtual cpu state.
Within
__wrap___cxa_rethrow
and__wrap___cxa_throw
, we check the build type and unwind the frame based on what we see in the disassembly. This is very fragile and breaks anytime we change those functions. We should, before main is called, scan the index for the location of both of these function's index entry, use those to create unwind instruction for both and cache the unwind information. Now when throw or rethrow are called, simply pass the already made unwind instructions to unwind frame along with the virtual cpu state.