public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Dodji Seketeli <dodji@redhat.com>,
	GDB/Archer list <archer@sourceware.org>
Subject: Re: [RFC] Proposal for a new DWARF name index section
Date: Wed, 12 Aug 2009 19:20:00 -0000	[thread overview]
Message-ID: <20090812191950.GA28615@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <m3ljlqt1jt.fsf@fleche.redhat.com>

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

  reply	other threads:[~2009-08-12 19:20 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-10  9:04 Dodji Seketeli
2009-08-10 14:38 ` Jan Kratochvil
2009-08-10 17:36   ` Tom Tromey
2009-08-10 18:21     ` Jan Kratochvil
2009-08-11  7:55       ` Dodji Seketeli
2009-08-11 17:45         ` Jan Kratochvil
2009-08-11 22:43           ` Tom Tromey
2009-08-12 19:20             ` Jan Kratochvil [this message]
2009-08-11 22:29       ` Tom Tromey
2009-08-20 17:31 ` Dodji Seketeli
2009-11-17 23:46   ` Cary Coutant
2009-11-20 17:25     ` Tom Tromey
2009-11-22  4:39       ` Daniel Jacobowitz
2009-11-23 19:51         ` Tom Tromey
2009-12-01 19:14       ` Tom Tromey
2009-12-02  5:17         ` Daniel Jacobowitz
2009-12-02 17:07           ` Tom Tromey
2009-12-02 17:35             ` Daniel Jacobowitz
2009-12-02 19:23               ` Tom Tromey
2009-12-02 19:39                 ` Daniel Jacobowitz
2009-12-03  1:46                   ` Paul Pluzhnikov
2009-12-04 23:13                     ` Tom Tromey
2009-12-06  3:41                       ` Tom Tromey
2009-12-07 21:32                         ` Tom Tromey
2009-12-02 16:11         ` Dodji Seketeli
2009-12-02 17:29           ` Tom Tromey
2009-12-11 23:56     ` Tom Tromey
2009-12-12  0:06       ` Daniel Jacobowitz
2009-12-12  0:13       ` Cary Coutant
2009-12-13  3:48       ` Dodji Seketeli
2009-12-14 15:32       ` Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090812191950.GA28615@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=archer@sourceware.org \
    --cc=dodji@redhat.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).