Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Mark Kettenis <kettenis@chello.nl>,
	Corinna Vinschen <vinschen@redhat.com>
Cc: gdb@sources.redhat.com
Subject: Re: [RFC] Supporting alternative ABIs
Date: Thu, 11 Sep 2003 15:58:00 -0000	[thread overview]
Message-ID: <3F609BA0.3060106@redhat.com> (raw)
In-Reply-To: <86isop2y9h.fsf@elgar.kettenis.dyndns.org>

> Corinna Vinschen <vinschen@redhat.com> writes:
> 
> 
>> - EXTRACT_RETURN_VALUE, STORE_RETURN_VALUE, USE_STRUCT_CONVENTION and
>>   gdbarch_push_dummy_code gdbarch methods would be changed to expect
>>   the type of the function, not the type of its return value.  They
>>   can use TYPE_TARGET_TYPE to get the return value type, but this will
>>   also give them access to the `calling_convention' for the function type.
>> 
>> - gdbarch_push_dummy_call and EXTRACT_STRUCT_VALUE_ADDRESS would
>>   receive the function's type as an additional argument, to give them
>>   access to the function's calling convention information.
>> 
>> - USE_STRUCT_CONVENTION and gdbarch_push_dummy_code would not require
>>   the `gcc_p' and `using_gcc' flags anymore since this information
>>   is now given in the function type node.  Due to the way,
>>   gdbarch_parse_dwarf2_calling_convention evaluates the `calling_convention'
>>   value, all inferior call-related gdbarch methods could simply trust its
>>   value.
> 
> 
> I was working on the (32-bit) SPARC target today, and wished I had the
> function type available, so I'm positive this would be a good move.

... so seconded.

Going through them:

USE_STRUCT_CONVENTION:
I'd rename the existing USE_STRUCT_CONVENTION to 
DEPRECATED_USE_STRUCT_CONVENTION and then introduce new arch method 
gdbarch_use_struct_convention (gdbarch, struct type *func) that defaults 
to the old.

push_dummy_call:
Similar.  The struct_return parameter is now very redundant (the 
assertions "struct_return == new USE_STRUCT_CONVENTION (new function 
parameter)", and "(struct_return != 0) == (STRUCT_ADDR != 0)" should hold).

EXTRACT_STRUCT_VALUE_ADDRESS:
Is this one needed?  Instead always use EXTRACT_RETURN_VALUE to obtain 
the return value.  Renaming this to DEPRECATED_STRUCT_VALUE_ADDRESS_V2.

STORE_RETURN_VALUE:
Rename the existing to deprecated_store_return_value_v2?  Anyway, 
looking at set_return_value(), I think the replacement's default 
implementation should incorporate both of:
>   if (code == TYPE_CODE_STRUCT
>       || code == TYPE_CODE_UNION)       /* FIXME, implement struct return.  */
>     error ("GDB does not support specifying a struct or union return value.");
> 
>   STORE_RETURN_VALUE (type, current_regcache, VALUE_CONTENTS (val));
some ABI's allow struct return, some don't.  Generic code shouldn't be 
making the decision.

EXTRACT_RETURN_VALUE:
Rename the existing to deprecated_extract_return_value_v2?  Looking at 
value_being_returned, and given the comment above on 
EXTRACT_STRUCT_VALUE_ADDRESS, I think the default method should contain 
much of the existing value_being_returned function.

Andrew



  reply	other threads:[~2003-09-11 15:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-22  8:41 Corinna Vinschen
2003-08-22 12:57 ` Daniel Jacobowitz
2003-08-22 21:11 ` Mark Kettenis
2003-09-11 15:58   ` Andrew Cagney [this message]
2003-09-13 19:58     ` Andrew Cagney
2003-08-22 15:42 Michael Elizabeth Chastain
2003-08-22 18:16 ` Andrew Cagney

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=3F609BA0.3060106@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb@sources.redhat.com \
    --cc=kettenis@chello.nl \
    --cc=vinschen@redhat.com \
    /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