Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: gdb-patches@sourceware.org
Subject: Re: [PATCH] m32c-tdep.c: Don't choke on virtual functions in push_dummy_call
Date: Thu, 29 Jun 2006 13:22:00 -0000	[thread overview]
Message-ID: <20060629132219.GB12662@nevyn.them.org> (raw)
In-Reply-To: <20060629110136.GE18873@calimero.vinschen.de>

On Thu, Jun 29, 2006 at 01:01:36PM +0200, Corinna Vinschen wrote:
> This I don't understand.  Calling virtual methods works quite nicely,
> at least in my m32c case here.  After dereferencing the method type,
> the m32c_push_dummy_call function passes all args correctly and the
> return value of the call is correct, too.
> 
> As for the problem of having to dereference the virtual function type,
> Maybe it makes sense to do this in call_function_by_hand already.
> Or are you suggesting that the representation of virtual methods is
> incorrect in GDB?

This is what a pointer to a virtual function looks like in the Itanium
(GNU v3) C++ ABI:

struct {
  int (*__pfn) (A *this);
  int __delta;
};

If it's a virtual function, __pfn is actually an offset to the virtual
table.  This is what a pointer to method is supposed to look like.  GDB
botches this.  The house of cards it has now more or less works, but
that's it.

I think you should be getting a TYPE_CODE_METHOD, not a pointer to
method, in target specific code.

-- 
Daniel Jacobowitz
CodeSourcery


      reply	other threads:[~2006-06-29 13:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-28 14:18 Corinna Vinschen
2006-06-28 21:23 ` Mark Kettenis
2006-06-28 21:32 ` Daniel Jacobowitz
2006-06-29 11:01   ` Corinna Vinschen
2006-06-29 13:22     ` Daniel Jacobowitz [this message]

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=20060629132219.GB12662@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@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