Implementing stack backtrace without using ebp
问题 How a stack backtrace can be implemented when the compiler is explicitly told not to use ebp as stack frame pointer? 回答1: The answer to this was only ever in comments on the accepted answer on What is the purpose of the EBP frame pointer register?. Modern debuggers can do stack backtraces even in code compiled with -fomit-frame-pointer. That setting is the default in recent gcc. gcc puts the necessary stack-unwind info into a .eh_frame_hdr section. See this blog post for more details. It's