This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [PATCH][PR c++/18141, c++/18417] std::iostream is a typedef


On Fri, May 15, 2015 at 2:17 PM, Doug Evans <dje@google.com> wrote:
> Hi.
>
> This patch fixes 18141, 18417.
>
> gnuv3_rtti_type/cp_lookup_rtti_type make the assumption that the name being
> lookup up is a class (after all, gnuv3_rtti_type calls check_typedef).
> This assumption breaks for std::iostream.
>
> From 18417:
>
> "p std::cerr" can give the following:
>
> warning: RTTI symbol for class 'std::iostream' has bad type
>
> this is because the minsym for the vtable is a typedef.
>
> gnuv3_rtti_type calls check_typedef on the value's type,
> and then does a minsym lookup by pc for the vtable
> which returns "_ZTVSo" which demangles as
> "vtable for std::ostream", and "std::iostream" is a typedef.
>
> For 18141, this is another classic case of .gdb_index saying the
> symbol is present but upon expansion symbol lookup doesn't find it.
> So we end up expanding one (or more) CUs in potentially 1000s of
> shared libraries.  The cost is 10s of GB of memory and an untold
> number of minutes (I gave up waiting for it to finish).
>
> My gmonster perf testcase will have a test to cover this.
>
> 2015-05-15  Doug Evans  <dje@google.com>
>
>         PR c++/18141, c++/18417.
>         * cp-support.c (cp_lookup_rtti_type): Handle the case of NAME being
>         a typedef.
>
>         testsuite/
>         * gdb.cp/iostream.cc: New file.
>         * gdb.cp/iostream.exp: New file.

Committed.


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