From patchwork Wed Aug 18 21:07:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 62090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id B120BB70D3 for ; Thu, 19 Aug 2010 07:08:11 +1000 (EST) Received: (qmail 8810 invoked by alias); 18 Aug 2010 21:08:09 -0000 Received: (qmail 8800 invoked by uid 22791); 18 Aug 2010 21:08:09 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Aug 2010 21:08:05 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 8291ACB0268 for ; Wed, 18 Aug 2010 23:08:03 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1lUD2FPq+-v4 for ; Wed, 18 Aug 2010 23:08:03 +0200 (CEST) Received: from new-host.home (ADijon-552-1-28-130.w92-138.abo.wanadoo.fr [92.138.163.130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 5B029CB021F for ; Wed, 18 Aug 2010 23:08:03 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Change backtrace mechanism for x86/Linux Date: Wed, 18 Aug 2010 23:07:55 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201008182307.55337.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 {