This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Calling __stdcall functions in the inferior
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: eliz at gnu dot org
- Cc: gdb at sourceware dot org
- Date: Fri, 12 Oct 2012 11:53:52 +0200 (CEST)
- Subject: Re: Calling __stdcall functions in the inferior
- References: <83a9vs89r9.fsf@gnu.org>
> Date: Fri, 12 Oct 2012 08:50:02 +0200
> From: Eli Zaretskii <eliz@gnu.org>
>
> 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.