From: Daniel Jacobowitz <drow@mvista.com>
To: gdb@sources.redhat.com
Subject: Re: Problem with virtual function pointers
Date: Thu, 27 Mar 2003 14:53:00 -0000 [thread overview]
Message-ID: <20030327145346.GA7253@nevyn.them.org> (raw)
In-Reply-To: <20030327142412.GK23762@cygbert.vinschen.de>
On Thu, Mar 27, 2003 at 03:24:12PM +0100, Corinna Vinschen wrote:
> Hi,
>
> I'm just investigating a problem which XStormy16 gets in
> gdb.c++/printmethod.exp:
>
> print theA->virt^M
> $1 = invalid pointer to member function^M
> FAIL: gdb.c++/printmethod.exp: print virtual method.
>
> It turned out that the error happens in xstormy16_pointer_to_address().
> This function converts an address to a jump table entry into a pointer
> to the actual function. To do this, it calls a conversion routine,
> which is only called if the following condition applies:
>
>
> enum type_code target = TYPE_CODE (TYPE_TARGET_TYPE (type));
>
> if (target == TYPE_CODE_FUNC || target == TYPE_CODE_METHOD)
> convert();
>
> Surprisingly (at least for me) this fails for the above case. Looking
> into type, I found that type is TYPE_CODE_PTR which is correct, but
> target_type is TYPE_CODE_VOID! Sure, the above virtual method is of
> type void but is that really ok? Shouldn't that be
>
> type: TYPE_CODE_PTR
> type->target_type: TYPE_CODE_METHOD
> type->target_type->target_type: TYPE_CODE_VOID
>
> ?
Could you give me a backtrace?
> Does somebody know why that happens? Is that just a bug in gdb? Or
> could that be related to incorrect debug info from gcc?
I believe this has to do with the type info emitted for virtual
function tables, but I need to see the backtrace to confirm. If so I'm
not sure whether it's really a bug in GCC or GDB...
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-03-27 14:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-27 14:24 Corinna Vinschen
2003-03-27 14:53 ` Daniel Jacobowitz [this message]
2003-03-27 15:20 ` Corinna Vinschen
2003-03-27 15:26 ` Daniel Jacobowitz
2003-03-27 16:18 ` Corinna Vinschen
2003-04-01 17:34 ` Corinna Vinschen
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=20030327145346.GA7253@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb@sources.redhat.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).