From: Elena Zannoni <ezannoni@redhat.com>
To: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
Cc: dan@debian.org, ezannoni@redhat.com,
gdb-patches@sources.redhat.com, jimb@redhat.com,
carlton@kealia.com
Subject: Re: [rfa/symtab/c++] fix c++ rtti type lookup
Date: Thu, 04 Dec 2003 21:16:00 -0000 [thread overview]
Message-ID: <16335.42037.408141.286736@localhost.redhat.com> (raw)
In-Reply-To: <20031127070903.48F634B40B@berman.michael-chastain.com>
Michael Elizabeth Chastain writes:
> This patch is a partial fix for PR c++/1465, which is the bug where RTTI
> lookup gets the "namespace" symbol instead of the class symbol. It also
> fixes PR c++/1377, which was another manifestation of the same bug.
>
> http://sources.redhat.com/gdb/bugs/1465
> http://sources.redhat.com/gdb/bugs/1377
>
> These bugs are regressions versus gdb 6.0 so they are high priority.
>
> First, lookup_rtti_type is a new function which takes a name and a block
> and returns the class type of that name. It's basically a block of code
> extracted from gnuv3_rtti_type. gnuv3_rtti_type calls lookup_rtti_type
> now.
>
> Then I changed gnuv2_rtti_type to call lookup_rtti_type. This
> changes the symbol lookup from VAR_DOMAIN to STRUCT_DOMAIN.
>
> lookup_rtti_type is full of checks and warnings so that it doesn't
> return crap to its caller.
>
> This fixes the simple cases of the bug.
>
> More work is needed:
>
> . 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.
>
> . 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 it a big FIXME into it.
> (I wonder if anyone still uses HP aCC with gdb).
>
here is a quandary. Should we carry around such code if nobody uses
it. If we cannot test it we might as well explicitly admit it.
> . Nested types give a warning and don't work.
> It would be nice to make them work.
>
is there a bug/testcase?
> . Types with virtual bases appear to work with v3, but give a warning
> and don't work with v2. "don't work" probably means that they fall back
> to the static type rather than the dynamic type.
>
> Testing: I tested with gcc v2 and v3, dwarf-2 and stabs+.
> Nothing got worse. gdb.cp/class2.exp has a specific test for this,
> which now passes.
>
> Some tests in virtfunc.exp that broke after the 2003-09-11 namespace
> commit started working again. That was pr gdb/1377.
>
> I think I need approval from a symtab maintainer to add the
If you move the function to cp-support.c and cp-support.h I think you
can avoid touching symtab.h altogether.
> new utility function "lookup_rtti_type", and then approval
> from a C++ maintainer to change gnuv2_rtti_type and gnuv3_rtti_type
> to call lookup_rtti_type.
>
> Okay to commit?
>
I think David ok'd it already.
elena
next prev parent reply other threads:[~2003-12-04 21:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-27 7:09 Michael Elizabeth Chastain
2003-12-01 17:13 ` David Carlton
2003-12-04 21:16 ` Elena Zannoni [this message]
2003-12-04 21:18 ` David Carlton
2003-12-04 21:38 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=16335.42037.408141.286736@localhost.redhat.com \
--to=ezannoni@redhat.com \
--cc=carlton@kealia.com \
--cc=dan@debian.org \
--cc=gdb-patches@sources.redhat.com \
--cc=jimb@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