Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>, gdb@sourceware.org
Subject: Re: Calling __stdcall functions in the inferior
Date: Fri, 12 Oct 2012 11:28:00 -0000	[thread overview]
Message-ID: <5077FEB9.4030304@redhat.com> (raw)
In-Reply-To: <834nm07z0s.fsf@gnu.org>

On 10/12/2012 11:41 AM, Eli Zaretskii wrote:

>> * You'll need to figure out a way to distinguish __stdcall functions
>>   from "normal" functions.
> 
> Does someone know where GCC stashes this info?  "ptype" doesn't reveal
> this detail, AFAICS.

Not sure about debug info, but the (linker) symbol has a "@number" suffix
appended.  A.k.a., "decoration".  Like "symbol@4".

In gcc/config/i386/winnt.c:

  /* Return string which is the function name, identified by ID, modified
     with a suffix consisting of an atsign (@) followed by the number of
     bytes of arguments.  If ID is NULL use the DECL_NAME as base. If
     FASTCALL is true, also add the FASTCALL_PREFIX.
     Return NULL if no change required.  */

  static tree
  gen_stdcall_or_fastcall_suffix (tree decl, tree id, bool fastcall)
  {

As you see above, fastcall also has identifiable decoration.

I don't recall the rules or conditions of when the decoration is
stripped or not anymore.

See e.g., http://stackoverflow.com/questions/8063842/mingw32-g-and-stdcall-suffix?rq=1

-- 
Pedro Alves


  reply	other threads:[~2012-10-12 11:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-12  6:50 Eli Zaretskii
2012-10-12  9:54 ` Mark Kettenis
2012-10-12 10:20   ` John Gilmore
2012-10-12 10:44     ` Eli Zaretskii
2012-10-12 10:42   ` Eli Zaretskii
2012-10-12 11:28     ` Pedro Alves [this message]
2012-10-12 13:26       ` Eli Zaretskii
2012-10-15 13:17         ` Pierre Muller
2012-10-12 11:45     ` Mark Kettenis
2012-10-12 13:25       ` Eli Zaretskii

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=5077FEB9.4030304@redhat.com \
    --to=palves@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /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