From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17840 invoked by alias); 12 Oct 2012 11:28:05 -0000 Received: (qmail 17830 invoked by uid 22791); 12 Oct 2012 11:28:03 -0000 X-SWARE-Spam-Status: No, hits=-8.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Oct 2012 11:27:56 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9CBRt5g024997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Oct 2012 07:27:55 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q9CBRrdS016793; Fri, 12 Oct 2012 07:27:54 -0400 Message-ID: <5077FEB9.4030304@redhat.com> Date: Fri, 12 Oct 2012 11:28:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1 MIME-Version: 1.0 To: Eli Zaretskii CC: Mark Kettenis , gdb@sourceware.org Subject: Re: Calling __stdcall functions in the inferior References: <83a9vs89r9.fsf@gnu.org> <201210120953.q9C9rqfu020865@glazunov.sibelius.xs4all.nl> <834nm07z0s.fsf@gnu.org> In-Reply-To: <834nm07z0s.fsf@gnu.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-10/txt/msg00066.txt.bz2 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