From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15845 invoked by alias); 12 Oct 2012 10:20:37 -0000 Received: (qmail 15835 invoked by uid 22791); 12 Oct 2012 10:20:36 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_BRBL_LASTEXT,RCVD_IN_HOSTKARMA_YE,RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_L3,RCVD_IN_NJABL_RELAY,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from new.toad.com (HELO new.toad.com) (209.237.225.253) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Oct 2012 10:20:32 +0000 Received: from new.toad.com (localhost.localdomain [127.0.0.1]) by new.toad.com (8.12.9/8.12.9) with ESMTP id q9CAKMk7022512; Fri, 12 Oct 2012 03:20:22 -0700 Message-Id: <201210121020.q9CAKMk7022512@new.toad.com> To: Mark Kettenis cc: eliz@gnu.org, gdb@sourceware.org Subject: Re: Calling __stdcall functions in the inferior In-reply-to: <201210120953.q9C9rqfu020865@glazunov.sibelius.xs4all.nl> References: <83a9vs89r9.fsf@gnu.org> <201210120953.q9C9rqfu020865@glazunov.sibelius.xs4all.nl> Comments: In-reply-to Mark Kettenis message dated "Fri, 12 Oct 2012 11:53:52 +0200." Date: Fri, 12 Oct 2012 10:20:00 -0000 From: John Gilmore 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/msg00063.txt.bz2 > > 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. If you just need this capability to debug a particular problem, add a dummy debugging function to the source code of your buggy program, which has the normal calling sequence, and which just calls GetLastError and returns its result. Then call *that* function from GDB. John