public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Hannes Domani via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC][PATCH] Fix function argument and return value locations
Date: Thu, 07 May 2020 07:43:22 -0600	[thread overview]
Message-ID: <87ftcbzwqt.fsf@tromey.com> (raw)
In-Reply-To: <20200505133256.4790-1-ssbssa@yahoo.de> (Hannes Domani via Gdb-patches's message of "Tue, 5 May 2020 15:32:56 +0200")

>>>>> "Hannes" == Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> writes:

Hannes> For return values, there were a lot more issues:
Hannes> - TYPE_CODE_DECFLOAT is NOT returned via XMM0.
Hannes> - long double is NOT returned via XMM0.
Hannes> - but __int128 IS returned via XMM0.
Hannes> - the comments for TYPE_CODE_FLT state that __m128, __m128i and __m128d are
Hannes>   returned by XMM0, and this is correct, but it doesn't actually check for
Hannes>   them, because they are TYPE_CODE_ARRAY with TYPE_VECTOR

Hannes> Could it be that this depends on the version of the used compiler?

It's definitely possible, but in this case I don't know.

Normally, following the platform ABI is the best thing to do.  In some
cases, this isn't possible and you have to resort to other approaches,
like compiler sniffing or whatever.

I guess it's likely nobody ever tried these tests on Windows, or that
they did but since the failures were 'baseline', they were just ignored.

If the platform ABI doesn't cover the cases, but some common compiler
(like gcc) does, then IMO it's fine to handle what the compiler emits.
If compilers disagree, then it gets more difficult.

Hannes> Also, in call-sc.exp, for the "value foo returned" test, I'm wondering
Hannes> if it can really ever return 90.

I think the idea there is that 90 is 'Z', so this catches the case where
somehow "return" completely failed, but at the same time gdb didn't warn
about it.  Maybe it can't really happen and it's just a defensive test.
Or maybe things changed since it was written and nobody noticed to
update the test.

Hannes> If any of this correct, then I will send a proper patch again (and maybe I
Hannes> should split the argument part into its own patch), if not, please advise.

I think it looks pretty reasonable, especially if it is making failing
tests now pass :)

Hannes>  T foo = '1', L;
Hannes> +T init = '9';
 
Hannes> -  Fun(foo);	
Hannes> +  Fun(init);
 
I didn't understand the need for these parts.

Hannes> +# On Windows, you can't replace the executable if it is still running.
Hannes> +gdb_exit
Hannes> +gdb_start

This seems like something that could go in immediately.

thanks,
Tom

  reply	other threads:[~2020-05-07 13:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200505133256.4790-1-ssbssa.ref@yahoo.de>
2020-05-05 13:32 ` Hannes Domani
2020-05-07 13:43   ` Tom Tromey [this message]
2020-05-07 18:18     ` Hannes Domani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ftcbzwqt.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).