Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* amd64-windows: Fix funcall with by-pointer arguments
@ 2012-10-24 17:23 Joel Brobecker
  2012-10-24 17:23 ` [RFA 2/2] amd64-windows: Arguments passed by pointer Joel Brobecker
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Joel Brobecker @ 2012-10-24 17:23 UTC (permalink / raw)
  To: gdb-patches; +Cc: kettenis

Hello,

I realized a while ago that I completely misunderstood the amd64-windows
API regarding arguments that are passed by pointer. The calling
convention is published there:

    http://msdn.microsoft.com/en-us/library/zthk2dkh(v=vs.80).aspx

Aggregates whose size is not 8/16/32/64 should be passed by pointer,
and what that means is that the caller is expected to make a copy
of the object, and pass its address as the argument. This is different
from passing the argument through the stack and the stack address
at the same time.

In particular, when you have a function call which involves one of
those by-pointer argument that follows an on-stack argument, the
incorrect method would puth the by-pointer argument on the stack
after the first argument, thus screwing up the offset of the first
argument relative to the caller's frame address, etc.

This patch series fixes the problem by:
  1. Reverting the first (incorrect) attempt at handling by-pointer
     arguments;
  2. Add handling of by-pointer arguments again.

Tested on x86_64-windows with AdaCore's testsuite, and on x86_64-linux
using the official testsuite.


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-09-26  0:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-24 17:23 amd64-windows: Fix funcall with by-pointer arguments Joel Brobecker
2012-10-24 17:23 ` [RFA 2/2] amd64-windows: Arguments passed by pointer Joel Brobecker
2012-10-24 17:24 ` [RFA 1/2] Revert "amd64-windows: memory args passed by pointer during function calls." Joel Brobecker
2012-10-25 13:18 ` amd64-windows: Fix funcall with by-pointer arguments Mark Kettenis
2013-01-16 11:59   ` Joel Brobecker
2013-09-13 22:11     ` [RFC-v2] " Pierre Muller
2013-09-16 20:57       ` Joel Brobecker
2013-09-17 13:50         ` Joel Brobecker
2013-09-20 23:20           ` Joel Brobecker
2013-09-24 16:33             ` Joel Brobecker
2013-09-24 16:33               ` [commit 1/4] Reimplement function calls on amd64-windows Joel Brobecker
2013-09-24 17:26                 ` fixed ChangeLog: " Joel Brobecker
2013-09-24 16:33               ` [commit 4/4] Revert use of classify callback in i386 gdbarch_tdep Joel Brobecker
2013-09-24 16:33               ` [commit 2/4] Revert use of integer_param_regs_saved_in_caller_frame " Joel Brobecker
2013-09-24 16:33               ` [commit 3/4] Revert use of memory_args_by_pointer " Joel Brobecker
2013-09-24 16:53               ` [RFC-v2] amd64-windows: Fix funcall with by-pointer arguments Mark Kettenis
2013-09-24 22:02               ` Pierre Muller
2013-09-26  0:34                 ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox