This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC-v2] amd64-windows: Fix funcall with by-pointer arguments
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: 'Mark Kettenis' <mark dot kettenis at xs4all dot nl>, gdb-patches at sourceware dot org
- Date: Tue, 17 Sep 2013 06:50:29 -0700
- Subject: Re: [RFC-v2] amd64-windows: Fix funcall with by-pointer arguments
- Authentication-results: sourceware.org; auth=none
- References: <1351099417-18960-1-git-send-email-brobecker at adacore dot com> <201210251317 dot q9PDHrnJ026193 at glazunov dot sibelius dot xs4all dot nl> <20130116115840 dot GS6143 at adacore dot com> <003101ceb0ce$22cfd340$686f79c0$ at muller@ics-cnrs.unistra.fr> <20130916205705 dot GC3132 at adacore dot com>
> Thanks for doing that. I haven't completely finished reviewing
> the patch yet, but I wanted to send a message so that you and
> everyone else knows that I am on it. The patch looked good, minus
> some trivial formatting issues which I will fix, but I noticed
> a problem with function returning arrays. I am not sure where
> it is coming from, whether from me incorrectly applying your
> change, or missing something else, or whether it's a regression.
>
> I ran out of time for today, but will try to pursue this further
> tomorrow.
Small update for today. This is the change I had to apply on top of
your patch in order to fix the problem:
- else if (amd64_windows_passed_by_integer_register (type))
- regnum = AMD64_RAX_REGNUM;
+ else if (len == 1 || len == 2 || len == 4 || len == 8)
+ {
+ /* All values of this size are returned via RAX. */
+ regnum = AMD64_RAX_REGNUM;
+ }
It fixes the case where we return a small array of integers.
The documentation I have said, at the time:
Return values that can fit into 64-bits are returned through RAX
(including __m64 types), except for __m128, __m128i, __m128d, floats,
and doubles, which are returned in XMM0. [...] User defined types to
be returned must be 1, 2, 4, 8, 16, 32, or 64 bits in length.
This all made me realize that merging our two patches creates
a bit of confusion about what is a pure rewrite, and what is an
attempt to fix what.
So, here is what I will do: I will clean my patch up, retest,
also remove all amd64-windows-specific hooks as initially said,
and then send you an updated patch containing your changes, with
my fixes. If you could please:
1. Re-test, making sure that I did not break anything back;
2. Re-submit each piece for each problem that you're solving,
with description provided with each patch.
This will make the review process easier for me.
Thank you!
--
Joel