public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "tromey at redhat dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug python/14235] verbose RTTI message polluting traces
Date: Sat, 16 Feb 2013 02:29:00 -0000	[thread overview]
Message-ID: <bug-14235-4717-30ZuAZIx8L@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-14235-4717@http.sourceware.org/bugzilla/>

http://sourceware.org/bugzilla/show_bug.cgi?id=14235

--- Comment #10 from Tom Tromey <tromey at redhat dot com> 2013-02-16 02:29:47 UTC ---
This also appears to be valid:

void f()
{
  {
    struct Z { virtual ~Z() { } };
    Z zz;
  }
  {
    struct Z { virtual ~Z() { } };
    Z zz;
  }
}

Yielding:

barimba. nm dt.o
00000000000000db T _Z1fv
0000000000000040 r _ZTIZ1fvE1Z
0000000000000050 r _ZTIZ1fvE1Z_0
000000000000006b r _ZTSZ1fvE1Z
0000000000000060 r _ZTSZ1fvE1Z_0
                 U _ZTVN10__cxxabiv117__class_type_infoE
0000000000000020 r _ZTVZ1fvE1Z
0000000000000000 r _ZTVZ1fvE1Z_0
00000000000000c6 t _ZZ1fvEN1ZC1E_0v
0000000000000058 t _ZZ1fvEN1ZC1Ev
00000000000000c6 t _ZZ1fvEN1ZC2E_0v
0000000000000058 t _ZZ1fvEN1ZC2Ev
00000000000000a0 t _ZZ1fvEN1ZD0E_0v
0000000000000032 t _ZZ1fvEN1ZD0Ev
000000000000006e t _ZZ1fvEN1ZD1E_0v
0000000000000000 t _ZZ1fvEN1ZD1Ev
000000000000006e t _ZZ1fvEN1ZD2E_0v
0000000000000000 t _ZZ1fvEN1ZD2Ev
                 U _ZdlPv


barimba. nm -C dt.o | grep vtable
                 U vtable for __cxxabiv1::__class_type_info
0000000000000020 r vtable for f()::Z
0000000000000000 r vtable for f()::Z

(Also, note the "()"s.  In the earlier example there was a
hidden trick: main is extern "C".)


Furthermore it seems to me that we can't rely on ever having
read debuginfo for the scope in which the class is defined.
We have to expand the CU holding the function first, then
find the type in the function.

A multi-step approach:

First, use the demangler to dissect the vtable's mangled name.
>From this deduce whether a function scope must be read.

Then construct the name of the function and look up its symbol,
causing the desired CU expansion.

Then search all the blocks of that function looking for the
appropriate type.  This is tricky due to the example above.
In fact it isn't clear to me how it can reliably be done given
the debuginfo currently emitted.  I don't see a way to determine
which type to use based on just the name of its vtable.
(And if we added some ad hoc attribute I wonder how it would work
for partially constructed objects.)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


  parent reply	other threads:[~2013-02-16  2:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 11:05 [Bug python/14235] New: " michael.meeks at suse dot com
2012-06-14 11:08 ` [Bug python/14235] " michael.meeks at suse dot com
2012-06-14 11:10 ` michael.meeks at suse dot com
2013-01-30  9:28 ` jan.kratochvil at redhat dot com
2013-01-30  9:47 ` jan.kratochvil at redhat dot com
2013-02-12 17:10 ` andre.poenitz at digia dot com
2013-02-13 10:11 ` michael.meeks at suse dot com
2013-02-13 21:02 ` tromey at redhat dot com
2013-02-15 19:19 ` tromey at redhat dot com
2013-02-15 21:26 ` tromey at redhat dot com
2013-02-16  2:29 ` tromey at redhat dot com [this message]
2013-02-25 15:36 ` muhammad_bilal at codesourcery dot com
2013-02-25 15:54 ` muhammad_bilal at codesourcery dot com
2013-02-25 16:18 ` jan.kratochvil at redhat dot com
2014-02-16 19:20 ` jackie.rosen at hushmail dot com
2014-05-28 19:43 ` schwab at sourceware dot org

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=bug-14235-4717-30ZuAZIx8L@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).