Why does -g force .cfi_* directives?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



g++ -fno-exceptions -fno-asynchronous-unwind-tables -S a.cc => no
.cfi_* directive
g++ -fno-exceptions -fno-asynchronous-unwind-tables -g -S a.cc =>
there are .cfi_* directive

C++ exceptions passing through -fno-exceptions frames have undefined behaviors.
Without .eh_frame, the traditional behavior is std::terminate() as a
result of _Unwind_RaiseException returning _URC_END_OF_STACK.

So -fno-asynchronous-unwind-tables is a good way to detect C++
exceptions passing through -fno-exceptions frames.
-g (imagine a build which always turns on debug information) forcing
.cfi_* defeats such usage.
(I can understand that if .debug_frame is used (rare), -g always forces .cfi_*)



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux