From patchwork Tue Jun 29 19:20:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 57301 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 5FE3FB6F06 for ; Wed, 30 Jun 2010 05:20:24 +1000 (EST) Received: (qmail 2791 invoked by alias); 29 Jun 2010 19:20:23 -0000 Received: (qmail 2741 invoked by uid 22791); 29 Jun 2010 19:20:22 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 Jun 2010 19:20:15 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5TJKDRq010145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 29 Jun 2010 15:20:14 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5TJKDE2006594; Tue, 29 Jun 2010 15:20:13 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o5TJKCBS016536; Tue, 29 Jun 2010 15:20:12 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id D7590378268; Tue, 29 Jun 2010 13:20:11 -0600 (MDT) From: Tom Tromey To: Richard Henderson Cc: gcc-patches@gcc.gnu.org, Jakub Jelinek Subject: Re: RFA: don't emit .debug_pub* References: <4C293E85.8090305@redhat.com> Reply-To: Tom Tromey Date: Tue, 29 Jun 2010 13:20:11 -0600 In-Reply-To: <4C293E85.8090305@redhat.com> (Richard Henderson's message of "Mon, 28 Jun 2010 17:29:57 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 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 >>>>> "rth" == Richard Henderson writes: rth> One of these either needs an undef or an ifdef. Thanks -- I think the target-def.h one, though as before I have no way to test this. Tom 2010-06-21 Tom Tromey * config/darwin.h (TARGET_WANT_DEBUG_PUB_SECTIONS): Define. * target-def.h (TARGET_INITIALIZER): Update. (TARGET_WANT_DEBUG_PUB_SECTIONS): New define. * dwarf2out.c (add_pubname_string): Check targetm.want_debug_pub_sections. (add_pubname): Likewise. (add_pubtype): Likewise. * target.h (struct gcc_target) : New field. 2010-06-21 Tom Tromey * g++.dg/debug/dwarf2/pubnames-1.C: Add dg-do compile. Index: target.h =================================================================== --- target.h (revision 160567) +++ target.h (working copy) @@ -1284,6 +1284,11 @@ */ bool arm_eabi_unwinder; + /* True if the target wants .debug_pubtypes and .debug_pubnames. In + most cases these are not interesting, as GDB and other tools do + not use them. */ + bool want_debug_pub_sections; + /* Leave the boolean fields at the end. */ }; Index: testsuite/g++.dg/debug/dwarf2/pubnames-1.C =================================================================== --- testsuite/g++.dg/debug/dwarf2/pubnames-1.C (revision 160567) +++ testsuite/g++.dg/debug/dwarf2/pubnames-1.C (working copy) @@ -1,5 +1,6 @@ // Contributed by Dodji Seketeli // Origin PR debug/39706 +// { dg-do compile { target *-*-darwin* } } // { dg-options "-g -dA -fno-merge-debug-strings" } // { dg-do compile } // Index: dwarf2out.c =================================================================== --- dwarf2out.c (revision 160567) +++ dwarf2out.c (working copy) @@ -11080,17 +11080,20 @@ static void add_pubname_string (const char *str, dw_die_ref die) { - pubname_entry e; + if (targetm.want_debug_pub_sections) + { + pubname_entry e; - e.die = die; - e.name = xstrdup (str); - VEC_safe_push (pubname_entry, gc, pubname_table, &e); + e.die = die; + e.name = xstrdup (str); + VEC_safe_push (pubname_entry, gc, pubname_table, &e); + } } static void add_pubname (tree decl, dw_die_ref die) { - if (TREE_PUBLIC (decl)) + if (targetm.want_debug_pub_sections && TREE_PUBLIC (decl)) { const char *name = dwarf2_name (decl, 1); if (name) @@ -11105,6 +11108,9 @@ { pubname_entry e; + if (!targetm.want_debug_pub_sections) + return; + e.name = NULL; if ((TREE_PUBLIC (decl) || die->die_parent == comp_unit_die) Index: target-def.h =================================================================== --- target-def.h (revision 160567) +++ target-def.h (working copy) @@ -680,6 +680,10 @@ #define TARGET_ARM_EABI_UNWINDER false +#ifndef TARGET_WANT_DEBUG_PUB_SECTIONS +#define TARGET_WANT_DEBUG_PUB_SECTIONS false +#endif + #define TARGET_PROMOTE_FUNCTION_MODE default_promote_function_mode #define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_false @@ -1085,7 +1089,8 @@ TARGET_ASM_FILE_START_FILE_DIRECTIVE, \ TARGET_HANDLE_PRAGMA_EXTERN_PREFIX, \ TARGET_RELAXED_ORDERING, \ - TARGET_ARM_EABI_UNWINDER \ + TARGET_ARM_EABI_UNWINDER, \ + TARGET_WANT_DEBUG_PUB_SECTIONS \ } #define TARGET_HANDLE_C_OPTION default_handle_c_option Index: config/darwin.h =================================================================== --- config/darwin.h (revision 160567) +++ config/darwin.h (working copy) @@ -471,6 +471,8 @@ #define DEBUG_STR_SECTION "__DWARF,__debug_str,regular,debug" #define DEBUG_RANGES_SECTION "__DWARF,__debug_ranges,regular,debug" +#define TARGET_WANT_DEBUG_PUB_SECTIONS true + /* When generating stabs debugging, use N_BINCL entries. */ #define DBX_USE_BINCL