From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3047 invoked by alias); 12 Oct 2012 09:54:09 -0000 Received: (qmail 3038 invoked by uid 22791); 12 Oct 2012 09:54:07 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Oct 2012 09:53:59 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id q9C9rrWe015079; Fri, 12 Oct 2012 11:53:53 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id q9C9rqfu020865; Fri, 12 Oct 2012 11:53:52 +0200 (CEST) Date: Fri, 12 Oct 2012 09:54:00 -0000 Message-Id: <201210120953.q9C9rqfu020865@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: eliz@gnu.org CC: gdb@sourceware.org In-reply-to: <83a9vs89r9.fsf@gnu.org> (message from Eli Zaretskii on Fri, 12 Oct 2012 08:50:02 +0200) Subject: Re: Calling __stdcall functions in the inferior References: <83a9vs89r9.fsf@gnu.org> 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/msg00062.txt.bz2 > 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. 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? In that case there are two things that will need to happen: * You'll need to implement Windows-specific push_dummy_call and/or push_dummy_code gdbarch methods for calling __stdcall functions. * You'll need to figure out a way to distinguish __stdcall functions from "normal" functions. If you decide to have a go at this, please create a new i386-windows-tdep.c file to put all the Windows-specific i386 code.