From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14202 invoked by alias); 26 Apr 2010 19:46:08 -0000 Received: (qmail 14188 invoked by uid 22791); 26 Apr 2010 19:46:06 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=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; Mon, 26 Apr 2010 19:46:00 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3QJjYU6021371 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 26 Apr 2010 15:45:34 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3QJjXKg008513; Mon, 26 Apr 2010 15:45:33 -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 o3QJjW00017147; Mon, 26 Apr 2010 15:45:32 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id EADDA37820A; Mon, 26 Apr 2010 13:45:31 -0600 (MDT) From: Tom Tromey To: Eli Zaretskii Cc: brobecker@adacore.com, gdb@sourceware.org Subject: Re: "set foo" References: <8339yk1skw.fsf@gnu.org> <20100424212118.GW13204@adacore.com> <83y6gbzm4e.fsf@gnu.org> <20100425144347.GA2744@adacore.com> <83sk6jzhzv.fsf@gnu.org> <83aasqyuo5.fsf@gnu.org> Reply-To: tromey@redhat.com Date: Mon, 26 Apr 2010 19:46:00 -0000 In-Reply-To: <83aasqyuo5.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 26 Apr 2010 20:45:30 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00148.txt.bz2 >>>>> "Eli" == Eli Zaretskii writes: >> FWIW, this sounds like a gdb bug to me. Eli> Could be a GCC bug as well, no? I suppose so. It is hard to say without more info. >> I looked at emacs/src/.gdbinit and it seems to me that the types and >> variables in question are global (in the sense of, not local to a >> function). So, they should be found without this trick. Eli> So you are saying that global types and variables are always loaded by Eli> GDB automatically, not lazily? I can only say what happens for DWARF debuginfo, I don't know anything about the other formats. (I gather stabs is similar, but I don't know details.) For DWARF, GDB does two passes over the debuginfo. The first time it reads "partial symbols". There are some maint commands ("apropos partial") to dump this info, that might be helpful to you. In this first pass, GDB just looks for global symbols -- variables, functions, and types. It skips a lot of the debuginfo. Then when a partial symbol is looked up, its partial symbol table is expanded to a full symbol table. In DWARF terms this means reading all the debuginfo in the CU. Because there are two scanners, this approach is open to a couple types of bugs if they disagree. One is if a symbol appears in a psymtab but not in a full symtab. GDB prints an error in that case (maybe internal_error, I forget). The other is the reverse, which sounds like what you've hit. Tom