This is the mail archive of the mailing list for the Archer project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Proposal for a new DWARF name index section

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

$ 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.


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]