From: Tom Tromey <tromey@redhat.com>
To: Matthieu VIAL <matthieu.vial@orange-ftgroup.com>
Cc: archer@sourceware.org
Subject: Re: How to cast a pointer to a base class with multiple inheritance
Date: Mon, 03 Aug 2009 18:30:00 -0000 [thread overview]
Message-ID: <m3eirskaxl.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1249291199.3046.15.camel@pc1134.silicomp.fr> (Matthieu VIAL's message of "Mon\, 03 Aug 2009 11\:19\:59 +0200")
>>>>> "Matthieu" == Matthieu VIAL <matthieu.vial@orange-ftgroup.com> writes:
Matthieu> Sorry Value.cast seems to work but my problem is actually a bit more
Matthieu> complex.
Ok.
Matthieu> I need to compare pointers to the interface with pointers to
Matthieu> the base class. But these classes are not directly related so
Matthieu> Value.cast is useless. The solution is to up cast the base
Matthieu> class pointer to the final class and then down cast to the
Matthieu> interface. But i need run time type information for that. The
Matthieu> typeid operator doesn't seem to be available in archer.
Nope. The Python API just exposes things that already exist in gdb.
typeid is not implemented yet, there's a bug for it:
http://sourceware.org/bugzilla/show_bug.cgi?id=9065
However, gdb does have "set print object on"... if this prints the right
thing for you, I think we could hook up the internal code to find the
"real object" as a Value method.
Tom
next prev parent reply other threads:[~2009-08-03 18:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-31 7:21 Matthieu VIAL
2009-07-31 18:03 ` Tom Tromey
2009-08-03 9:20 ` Matthieu VIAL
2009-08-03 18:30 ` Tom Tromey [this message]
2009-08-04 8:42 ` Richard Ward
2009-08-04 11:40 ` Matthieu VIAL
2009-08-10 21:12 ` Tom Tromey
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=m3eirskaxl.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=archer@sourceware.org \
--cc=matthieu.vial@orange-ftgroup.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).