C ++的try /抛出/捕获= GT;机code [英] C++ try/throw/catch => machine code
问题描述
精神上,我一直想知道如何尽量/抛出/ catch语句看起来幕后,当C ++编译它翻译成汇编。但是,因为我从来没有使用它,我从来没有抽时间去检查出来(有些人会说懒惰)。
Mentally, I've always wondered how try/throw/catch looks behind the scenes, when the C++ compiles translates it to assembler. But since I never use it, I never got around to checking it out (some people would say lazy).
用于跟踪的尝试
S中正常的堆栈,或者是保持独此目的的独立的每个线程栈?是MSVC和g ++或大或小的执行?请给我一些伪ASM(IA-32也没关系),所以我从来没有检查出来喽! :)
Is the normal stack used for keeping track of try
s, or is a separate per-thread stack kept for this purpose alone? Is the implementation between MSVC and g++ big or small? Please show me some pseudo asm (IA-32 is ok too) so I never have to check it out myself! :)
编辑:现在,我得到MSVC对IA-32执行处理的基本知识。任何人都知道在IA-32 G ++,或任何其他CPU为此事?
Now I get the basics of MSVC's implementation on IA-32 handling. Anybody know for g++ on IA-32, or any other CPU for that matter?
推荐答案
Microsoft日记本的引擎盖下系列做了深入的看看这个非常受早在1997年:
Microsoft Journal's "Under the Hood" series did an in-depth look at that very subject back in 1997:
这篇关于C ++的try /抛出/捕获= GT;机code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!