From: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
-fexceptions
: Enable exception handling. Generates extra code needed to propagate exceptions. For some targets, this implies GCC generates frame unwind information for all functions,
-funwind-tables
Similar to-fexceptions
, except that it just generates any needed static data, but does not affect the generated code in any other way. You normally do not need to enable this option; instead, a language processor that needs this handling enables it on your behalf.
Could somebody please explain, from -funwind-tables
, what does it mean by "any needed static data". What data they are referring to. And why is the data needed to be generated? What happens if that data is not generated? Where is that data used for?
And it also says "similar to -fexception
". So I think it also generates frame unwind information. What is frame unwind information? Who uses the frame information and how?
In some SO posts, I read that programs has to be compiled with this flag for the _Unwind_Backtrace
has to work properly. Please explain how _Unwind_Backtrace
use the information generated by -funwind-tables
.