From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5957 invoked by alias); 23 Jun 2012 19:59:01 -0000 Received: (qmail 5943 invoked by uid 22791); 23 Jun 2012 19:59:00 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vc0-f169.google.com (HELO mail-vc0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 23 Jun 2012 19:58:47 +0000 Received: by vcbfl10 with SMTP id fl10so1748394vcb.0 for ; Sat, 23 Jun 2012 12:58:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-system-of-record :x-gm-message-state; bh=KOrntbvsOr/iniJ+gxtZ/uFqEYexbD5DOVszwszMqwQ=; b=AethL5VZRJuVqpH7Mywvsm3JwMYDK5UeKgIsZ83C/oI7jVzvwo7kAWtMCHbdku5XSj pg7yyvdpgDYkfnML7bwSHNdu4RH/gK/qwFY7Hc7st0XBrLr78X0eiJANllo3r4vHgaXr vgQhejvXeg/GzTkyBqf5SMWi2Csmqk72nyDQbKOlLpmdKBsTIkGsO+jKfegLH8WcTnt0 4E371Jk5hQR3E8WhzgGeOugHqm01F0WTO5gGjxRji9R9Bf+8TaXRUHWcvuMp2FKzkhCV srKEFo+4HOUCuR35s15TOQ+iZEBA5fDAgwSFOaryH+CXRHVAAOnmdZhYqczQhpUgCYdI tFFA== Received: by 10.220.240.18 with SMTP id ky18mr1404922vcb.74.1340481526908; Sat, 23 Jun 2012 12:58:46 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.240.18 with SMTP id ky18mr1404913vcb.74.1340481526789; Sat, 23 Jun 2012 12:58:46 -0700 (PDT) Received: by 10.52.168.99 with HTTP; Sat, 23 Jun 2012 12:58:46 -0700 (PDT) In-Reply-To: References: <20120619074931.6F0B41E136F@ruffy2.mtv.corp.google.com> <87txy3f7wr.fsf@fleche.redhat.com> <87y5nfdpq7.fsf@fleche.redhat.com> Date: Sat, 23 Jun 2012 19:59:00 -0000 Message-ID: Subject: Re: [RFA] Add global/static and symbol kind indicator to .gdb_index From: Doug Evans To: Cary Coutant Cc: Tom Tromey , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-Gm-Message-State: ALoCoQnU4DiXGvdBrp4MHI7fOomuoBCy6d1/9Plo1KKTxw3l+eJMaDr3Fd+Fcybl7XjnqBx73USB0VQfWv+oaPz3QbzGdCoaHkBH8GxSF+d3PtDG+yfTPc/b0dM7bf9/EhP/0J9GcBMPpeo8CqQWmhdGoKMTLZdKkEfhYRux6CHRyvL9UYcZ03lKjBtDR2sjwW5nyYOkKRd/ X-IsSubscribed: yes 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: 2012-06/txt/msg00743.txt.bz2 On Fri, Jun 22, 2012 at 2:20 PM, Cary Coutant wrote: >> Doug> The global/static bit massively speeds up looking up things like >> Doug> "int" when debugging with lots of shared libraries (all having >> Doug> .gdb_index). =A0PR 14125 >> >> Tom> I don't think this patch is needed to achieve this. =A0At least, th= e "int" >> Tom> case and other similar cases were fixed by: >> >> Doug pointed out on irc that I was mistaken here. >> The issue in his case is that, even though each individual index has a >> single entry for "int", there are still many indices, so gdb still does >> excessive CU expansion. >> I'm sorry for the error. > > Is there still something I need to fix in gold in this regard? I think > gold will produce an index entry for "int" in every CU that mentions > it. If the right thing to do is to have only one CU, how do I decide > what kinds of names get this treatment? (For example, some arbitrary > type "struct foo" might actually be a different type, and you'd want > multiple index entries.) As a data point, using -fshort-double I created a program where gdb's behaviour with the index is different than its behaviour without it. Things like -fshort-double aren't well supported anyway, so I don't know if this particular issue is something we want to worry about in the near term. fshort-double.c: double normal_double; extern void foo (void); int main () { foo (); return 0; } fshort-double-1.c: double short_double; void foo () { short_double =3D 42; } $ gcc -g -c fshort-double.c $ gcc -g -c -fshort-double fshort-double-1.c $ gcc -g fshort-double.o fshort-double-1.o $ gdb a.out (gdb) b foo (gdb) p sizeof(double) 4 then $ gdb-add-index a.out $ gdb a.out (gdb) b foo (gdb) p sizeof(double) 8 [I can well believe there is more than one bug here though. :-)]