From patchwork Wed Aug 18 21:07:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Ada] Change backtrace mechanism for x86/Linux From: Eric Botcazou X-Patchwork-Id: 62090 Message-Id: <201008182307.55337.ebotcazou@adacore.com> To: gcc-patches@gcc.gnu.org Date: Wed, 18 Aug 2010 23:07:55 +0200 This adjusts the backtrace mechanism used on x86/Linux to the default setting of -fomit-frame-pointer on this platform. Tested on i586-suse-linux, applied on the mainline. 2010-08-18 Eric Botcazou * tracebak.c (i386): Use GCC unwinder on Linux with GCC > 4.5. Index: tracebak.c =================================================================== --- tracebak.c (revision 163220) +++ tracebak.c (working copy) @@ -303,7 +303,14 @@ struct layout #define IS_BAD_PTR(ptr) 0 #endif +/* Starting with GCC 4.6, -fomit-frame-pointer is turned on by default for + 32-bit x86/Linux as well and DWARF 2 unwind tables are emitted instead. + See the x86-64 case below for the drawbacks with this approach. */ +#if defined (linux) && (__GNUC__ * 10 + __GNUC_MINOR__ > 45) +#define USE_GCC_UNWINDER +#else #define USE_GENERIC_UNWINDER +#endif struct layout {