Re: Calling __stdcall functions in the inferior

Mark Kettenis
2012-10-12T11:45:02Z

> Date: Fri, 12 Oct 2012 12:41:55 +0200
> From: Eli Zaretskii <eliz@gnu.org>
>
> > Date: Fri, 12 Oct 2012 11:53:52 +0200 (CEST)
> > From: Mark Kettenis <mark.kettenis@xs4all.nl>
> > CC: gdb@sourceware.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.
>
> 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...

The way call dummies work, the fact that the callee pops the stack
shouldn't be an issue.