Do you make sense of 'Exception tables' and 'Unwind tables"?

​ Exception tables are necessary to handle exceptions thrown by functions in high-level languages such as C++.

​ Unwind tables contain debug frame information which is also necessary for the handling of such exceptions. An exception can only propagate through a function with a unwind table. You use FRAME directives to enable the assembler to generate unwind tables.

​ An assembly language function is code enclosed by either PROC and ENDP or FUNC and ENDFUNC directives. Functions written in C++ have unwind information by default. However, for assembly language functions that are called from C++ code, you must ensure that there are exception tables and unwind tables to enable the exceptions to propagate through them.

​ An exception can not propagate through a function with a no-unwind table. The exception handling runtime environment terminates the program if it encounters a no-unwind table during exception processing.

​ The assembler can generate no-unwind table entries for all functions and non-functions. The assembler can generate an unwind table for a function only if the function contains sufficient FRAME directives to describe the use of the stack within the function. To be able to create an unwind table for a function, each POP or PUSH instruction must be followed by a FRAME POP or FRAME PUSH directive respectively. Functions must conform to the conditions set out in the Exception Handling ABI for the ARM Architecture(EHABI), section 9.1 Constraints on Use. If the assembler can not generate an unwind table it generates a no-unwind table.

Overview of exception handling

​ The process of finding excepting handling information from the current PC is summarized in the diagram below:

Diagram of exception handling process

​ All tables are in “text” space. The types pointed by the typeinfo pointers are identified by a GP-relative offset.

​ Note:

​ For more detailed information, see:
https://itanium-cxx-abi.github.io/cxx-abi/exceptions.pdf
https://itanium-cxx-abi.github.io/cxx-abi/abi-eh.html#base-data

Related Information:

1.1 Exception Handler Framework

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值