From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28657 invoked by alias); 12 Aug 2009 19:20:11 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 28473 invoked by uid 22791); 12 Aug 2009 19:20:08 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Date: Wed, 12 Aug 2009 19:20:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: Dodji Seketeli , GDB/Archer list Subject: Re: [RFC] Proposal for a new DWARF name index section Message-ID: <20090812191950.GA28615@host0.dyn.jankratochvil.net> References: <20090810182136.GA25301@host0.dyn.jankratochvil.net> <4A7FE28D.4050901@redhat.com> <20090810143804.GA8671@host0.dyn.jankratochvil.net> <20090810182136.GA25301@host0.dyn.jankratochvil.net> <4A8123C9.3030209@redhat.com> <20090811174448.GA17263@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-SW-Source: 2009-q3/txt/msg00123.txt.bz2 On Wed, 12 Aug 2009 00:42:46 +0200, Tom Tromey wrote: > Jan> enumerator constants are not globally visible, they create no ELF > Jan> symbols, they need to be #included for each CU, they are like > Jan> static functions, therefore they should not be a part of > Jan> .debug_pubnames. > > Types also are not globally visible and create no ELF symbols. So, I > think you need an additional argument about why enum constants ought to > be treated differently. OK, I find .debug_pubtypes as a strong argument the DWARF committee probably intended debuggers should have wider lookup scope than the language itself. > Also, I will occasionally start gdb just to "print/d CONSTANT" to see > what its value is. So this would be another user-visible change -- we'd > require a full debuginfo scan on any expression. I expected before the debugger should require the lookup scope as the language does: $ gdb -q ./file (gdb) print/d CONSTANT No symbol "CONSTANT" in current context. (gdb) list main [...] (gdb) print/d CONSTANT $1 = 42 > (Though it occurs to me that perhaps this is happening due to some "static > scope" set at main or something ... I did not check. If so that would > eliminate this objection to this particular bit.) IMO (did not verify) it is because there no default scope for main. But if the symbol is not found in the current lexical block and current CU the symbol is looked for in all the other CUs and objfiles. If there would be two differing definitions of CONSTANT GDB will pick a random one (which is a bug). On Wed, 12 Aug 2009 00:29:10 +0200, Tom Tromey wrote: > The extensions are cheap on the gcc side (already done IIUC) and because > there is no gdb patch yet, equally cheap there. OK. I am now convinced the lookup for static symbols is probably OK. Software projects already try to have unique symbol names even if they are static. And clashing names for different C++ classes or enums are considered more a bug than anything encouraged. Thanks, Jan