Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Michael Elizabeth Chastain <mec.gnu@mindspring.com>
Cc: gdb-patches@sources.redhat.com, carlton@kealia.com
Subject: Re: [rfa/c++] cp_lookup_rtti_type, take 2
Date: Fri, 05 Dec 2003 03:30:00 -0000	[thread overview]
Message-ID: <20031205032959.GA13165@nevyn.them.org> (raw)
In-Reply-To: <20031201214039.7A1504B364@berman.michael-chastain.com>

On Mon, Dec 01, 2003 at 04:40:39PM -0500, Michael Chastain wrote:
> Here is version #2 of cp_lookup_rtti_type.

This patch is OK.  I have a couple of comments, but none of them
require changing it.

> And it still needs this follow-up work:
> 
> . The calls to lookup_rtti_type need a proper "block" parameter.
>   The old code needed this too; I haven't regressed anything.
>   I put FIXME notes in for this.

I'm not as sure as you are about this - certainly we do _not_ want a
block that came down the call chain; think about what dynamic type is. 
The only reason we can do it by symbol lookup at all is the One
Definition Rule, and we should probably be restricting ourselves to the
objfile in which we found the minimal symbol.  Searching STRUCT_DOMAIN
works because every class with debug info will be entered in both
STRUCT_DOMAIN and VAR_DOMAIN, and there should only be one entry in
STRUCT_DOMAIN for a non-POD type in a given objfile (or you'll get link
errors from the multiple vtables!  Ignoring anonymous namespaces for
now.)

> . hpacc_value_rtti_type has the same buggy code.  I can't change the
>   code because I can't test it, but I can put in a big FIXME into it.
>   (I wonder if anyone still uses HP aCC with gdb).

I would be dumbfounded if it still worked right.  Note that this is aCC
only, not GCC on HP/UX; and I believe that newer HP/UX compilers will
use the Itanium C++ ABI, which means roughly the same as GNU v3.

Now that we've had another major release of GDB I am extremely tempted
to rip out aCC C++ support.  If you really want to experiment, the HP
TestDrive systems do have aCC installed; www.testdrive.hp.com and
spe191.testdrive.hp.com:telnet.  But they're a real nuisance to run
tests on due to the lack of usable (to me) tools, and the restrictive
firewall.  And if we found problems, there wouldn't be anyone motivated
to fix them.

> . Nested types give a warning and don't work.
>   It would be nice to make them work.

It's a pain.  I spent quite some time trying to sort out the issues. 
I'll give it a shot again after more of David's patches have been
merged.

> 2003-12-01  Michael Chastain  <mec.gnu@mindspring.com>
> 
> 	Partial fix for PR c++/1465.
> 	Fix for PR c++/1377.
> 	* cp-support.h (cp_lookup_rtti_type): New function.
> 	* cp-support.c (cp_lookup_rtti_type): New function.
> 	* gnu-v2-abi.c: Update copyright years.
> 	(gnuv2_rtti_type): Call cp_lookup_rtti_type.
> 	* gnu-v3-abi.c: Update copyright years.
> 	(gnuv3_rtti_type): Call cp_lookup_rtti_type.


> !   /* Make sure the type symbol is sane.  (An earlier version of this
> !      code would find constructor functions, who have the same name as
> !      the class.)  */

The "earlier version" used VAR_DOMAIN, FYI.  It was presumably based on
the code in gnu-v2-abi.c, but because gnu-v2-abi.c didn't show the
problem I encountered at the time I didn't update it.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2003-12-05  3:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-01 21:40 Michael Elizabeth Chastain
2003-12-05  3:30 ` Daniel Jacobowitz [this message]
2003-12-05 16:57   ` David Carlton
2003-12-05 17:16     ` Daniel Jacobowitz
2003-12-05  4:23 Michael Elizabeth Chastain
2003-12-05  5:01 ` Daniel Jacobowitz
2003-12-05 17:12 ` David Carlton
2003-12-05 17:16   ` Daniel Jacobowitz
2003-12-05 17:38     ` David Carlton
2003-12-05 17:40       ` Daniel Jacobowitz
2003-12-05  5:26 Michael Elizabeth Chastain

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=20031205032959.GA13165@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=carlton@kealia.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec.gnu@mindspring.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