From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2028 invoked by alias); 12 Oct 2012 10:42:50 -0000 Received: (qmail 2016 invoked by uid 22791); 12 Oct 2012 10:42:48 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_YE,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout21.012.net.il (HELO mtaout21.012.net.il) (80.179.55.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Oct 2012 10:42:40 +0000 Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MBS00C0008LJG00@a-mtaout21.012.net.il> for gdb@sourceware.org; Fri, 12 Oct 2012 12:41:54 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MBS00C950DTEA70@a-mtaout21.012.net.il>; Fri, 12 Oct 2012 12:41:54 +0200 (IST) Date: Fri, 12 Oct 2012 10:42:00 -0000 From: Eli Zaretskii Subject: Re: Calling __stdcall functions in the inferior In-reply-to: <201210120953.q9C9rqfu020865@glazunov.sibelius.xs4all.nl> To: Mark Kettenis Cc: gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: <834nm07z0s.fsf@gnu.org> References: <83a9vs89r9.fsf@gnu.org> <201210120953.q9C9rqfu020865@glazunov.sibelius.xs4all.nl> X-IsSubscribed: yes 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/msg00064.txt.bz2 > Date: Fri, 12 Oct 2012 11:53:52 +0200 (CEST) > From: Mark Kettenis > CC: gdb@sourceware.org > > > Date: Fri, 12 Oct 2012 08:50:02 +0200 > > From: Eli Zaretskii > > > > Is there a way to call __stdcall functions in the inferior from GDB, > > while debugging a C program? The case in point is GetLastError, but > > any other function from the Windows API has this problem. > > Probably not. We only implement the System V and Darwin calling > conventions for i386. But we also support Pascal, AFAIK, which uses this convention: the callee pops the stack. The only difference is that the arguments are pushed right to left, unlike with Pascal. So I thought we already had this somewhere... > I'm not familliar with the Windows world (and don't really have a > desire to become familliar). But I assume "normal" (non-__stdcall) > functions use the System V calling conventions? Yes, it's the normal cdecl calling convention. > * 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. Thanks.