From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18356 invoked by alias); 8 Jan 2013 16:41:50 -0000 Received: (qmail 18255 invoked by uid 22791); 8 Jan 2013 16:41:47 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BJ 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, 08 Jan 2013 16:41:34 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r08GfXhe002089 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 8 Jan 2013 11:41:33 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r08GfUpQ026432 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 8 Jan 2013 11:41:32 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Subject: RFC: make GNU v3 ABI the default C++ ABI Date: Tue, 08 Jan 2013 16:41:00 -0000 Message-ID: <874nir4og5.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-01/txt/msg00134.txt.bz2 This patch makes the GNU v3 ABI the default ABI. This has been the default ABI for g++ since November 2000. I think it is long past time for gdb to assume this. Anybody still using the v2 ABI can still set it explicitly. This doesn't usually matter, due to the hack in minsyms.c, but it can be seen if you happen to run gdb on a C++ object without any minsyms. Built and regtested on x86-64 Fedora 16. Tom * gnu-v2-abi.c (_initialize_gnu_v2_abi): Don't set default ABI. * gnu-v3-abi.c (_initialize_gnu_v3_abi): Set default ABI. * minsyms.c (install_minimal_symbols): Don't check for _Z symbols. --- gdb/gnu-v2-abi.c | 1 - gdb/gnu-v3-abi.c | 1 + gdb/minsyms.c | 23 ----------------------- 3 files changed, 1 insertions(+), 24 deletions(-) diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c index 4a600d3..c17955a 100644 --- a/gdb/gnu-v2-abi.c +++ b/gdb/gnu-v2-abi.c @@ -423,5 +423,4 @@ _initialize_gnu_v2_abi (void) { init_gnuv2_ops (); register_cp_abi (&gnu_v2_abi_ops); - set_cp_abi_as_auto_default (gnu_v2_abi_ops.shortname); } diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index aef5ae0..641b2b1 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -1134,4 +1134,5 @@ _initialize_gnu_v3_abi (void) init_gnuv3_ops (); register_cp_abi (&gnu_v3_abi_ops); + set_cp_abi_as_auto_default (gnu_v3_abi_ops.shortname); } diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 8a90668..779b9f9 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -1240,29 +1240,6 @@ install_minimal_symbols (struct objfile *objfile) objfile->minimal_symbol_count = mcount; objfile->msymbols = msymbols; - /* Try to guess the appropriate C++ ABI by looking at the names - of the minimal symbols in the table. */ - { - int i; - - for (i = 0; i < mcount; i++) - { - /* If a symbol's name starts with _Z and was successfully - demangled, then we can assume we've found a GNU v3 symbol. - For now we set the C++ ABI globally; if the user is - mixing ABIs then the user will need to "set cp-abi" - manually. */ - const char *name = SYMBOL_LINKAGE_NAME (&objfile->msymbols[i]); - - if (name[0] == '_' && name[1] == 'Z' - && SYMBOL_DEMANGLED_NAME (&objfile->msymbols[i]) != NULL) - { - set_cp_abi_as_auto_default ("gnu-v3"); - break; - } - } - } - /* Now build the hash tables; we can't do this incrementally at an earlier point since we weren't finished with the obstack yet. (And if the msymbol obstack gets moved, all the internal -- 1.7.7.6