Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Keith Seitz <keiths@redhat.com>
Cc: "gp >> \"gdb-patches@sourceware.org ml\"" <gdb-patches@sourceware.org>
Subject: Re: [RFA] Fix c++/16253 (tag/variable name collision)
Date: Mon, 24 Mar 2014 14:15:00 -0000	[thread overview]
Message-ID: <20140324141527.GM4282@adacore.com> (raw)
In-Reply-To: <532C810F.7010809@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1550 bytes --]

Hey Keith,

> I must also give a shout out to Joel -- I've largely avoided hacking
> with/at Ada. In fact, Ada *largely* remains unchanged. However, it
> now must explicitly search STRUCT_DOMAIN in a few places itself (an
> analogous change to the other symbol table API changes I've made).
> Joel, if you could run this through your internal AdaCore test
> harness, that would be most helpful.

I had a chance to test your patch today, and unfortunately our testsuite
detected some regressions. I think they might all be the same, so I
picked the simplest testcase. I might be running short of time today
to look deeper into this, but I can try scheduling some time for it
tomorrow or Wed.

    % gnatmake -g foo
    % gdb foo
    (gdb) ptype base

It should have been:

    (gdb) ptype base
    type = (first, middle, last)

The debugger finds the type if you start the program, but I think
it's because it finds it via the DIE generated inside the main
subprogram's DIE because of the variable of that type declared
there:

    (gdb) start
    Temporary breakpoint 1 at 0x401d86: file foo.adb, line 4.
    Starting program: /[...]/foo

    Temporary breakpoint 1, foo () at foo.adb:4
    4          B : Base := Base'First;   <<<<<---  the variable of type Base
    (gdb) ptype base
    type = (first, middle, last)

This may not be directly related to your patch. I seem to have seen
some unexplainable behavior in GDB occasionally in the recent past
making me wonder whether there might be something fishy in the symbol
lookup for Ada.

-- 
Joel

[-- Attachment #2: pck.ads --]
[-- Type: text/plain, Size: 169 bytes --]

with System;

package Pck is
   type Base is (First, Middle, Last);
   subtype Enum is Base range First .. Last;

   procedure Do_Nothing (A : System.Address);
end Pck;

[-- Attachment #3: pck.adb --]
[-- Type: text/plain, Size: 119 bytes --]

package body Pck is

   procedure Do_Nothing (A : System.Address) is
   begin
      null;
   end Do_Nothing;

end Pck;

[-- Attachment #4: foo.adb --]
[-- Type: text/plain, Size: 106 bytes --]

with Pck; use Pck;

procedure Foo is
   B : Base := Base'First;
begin
   Do_Nothing (B'Address);
end Foo;

  reply	other threads:[~2014-03-24 14:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 18:12 Keith Seitz
2014-03-24 14:15 ` Joel Brobecker [this message]
2014-03-25 18:11   ` Keith Seitz
2014-03-26 13:32     ` Joel Brobecker
2014-03-26 13:40 ` Joel Brobecker
2014-03-26 15:34   ` Keith Seitz
2014-04-10 18:54   ` Keith Seitz
2014-04-10 20:29     ` Tom Tromey
2014-05-28 17:55       ` Doug Evans
2014-04-17 19:03     ` Regression for gdb.cp/koenig.exp: p entry (c) [Re: [RFA] Fix c++/16253 (tag/variable name collision)] Jan Kratochvil

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=20140324141527.GM4282@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@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