* [RFA] fix calling conventions wrt 32-bit values
@ 2003-06-02 5:53 Richard Henderson
2003-06-02 13:43 ` Elena Zannoni
0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2003-06-02 5:53 UTC (permalink / raw)
To: gdb-patches
Ok?
r~
* alpha-tdep.c (alpha_push_dummy_call): Handle ABI mandated
sign-extension of 32-bit values.
(alpha_store_return_value): Similarly.
--- alpha-tdep.c.5 2003-06-01 22:34:01.000000000 -0700
+++ alpha-tdep.c 2003-06-01 22:42:32.000000000 -0700
@@ -276,9 +276,16 @@ alpha_push_dummy_call (struct gdbarch *g
case TYPE_CODE_CHAR:
case TYPE_CODE_RANGE:
case TYPE_CODE_ENUM:
- if (TYPE_LENGTH (arg_type) < TYPE_LENGTH (builtin_type_long))
+ if (TYPE_LENGTH (arg_type) == 4)
{
- arg_type = builtin_type_long;
+ /* 32-bit values must be sign-extended to 64 bits
+ even if the base data type is unsigned. */
+ arg_type = builtin_type_int32;
+ arg = value_cast (arg_type, arg);
+ }
+ if (TYPE_LENGTH (arg_type) < ALPHA_REGISTER_SIZE)
+ {
+ arg_type = builtin_type_int64;
arg = value_cast (arg_type, arg);
}
break;
@@ -541,6 +548,10 @@ alpha_store_return_value (struct type *v
default:
/* Assume everything else degenerates to an integer. */
+ /* 32-bit values must be sign-extended to 64 bits
+ even if the base data type is unsigned. */
+ if (length == 4)
+ valtype = builtin_type_int32;
l = unpack_long (valtype, valbuf);
regcache_cooked_write_unsigned (regcache, ALPHA_V0_REGNUM, l);
break;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] fix calling conventions wrt 32-bit values
2003-06-02 5:53 [RFA] fix calling conventions wrt 32-bit values Richard Henderson
@ 2003-06-02 13:43 ` Elena Zannoni
2003-06-02 16:00 ` Richard Henderson
0 siblings, 1 reply; 3+ messages in thread
From: Elena Zannoni @ 2003-06-02 13:43 UTC (permalink / raw)
To: Richard Henderson; +Cc: gdb-patches
Richard Henderson writes:
> Ok?
>
>
The alpha target has no official maintainer, and I think we can
consider most of these patches obvious. I think that if they work for
you, you can commit them yourself, and just post the patch with a
[PATCH] subject.
For patches to files other than the alpha ones, you still need an
[RFA].
elena
> r~
>
>
> * alpha-tdep.c (alpha_push_dummy_call): Handle ABI mandated
> sign-extension of 32-bit values.
> (alpha_store_return_value): Similarly.
>
>
> --- alpha-tdep.c.5 2003-06-01 22:34:01.000000000 -0700
> +++ alpha-tdep.c 2003-06-01 22:42:32.000000000 -0700
> @@ -276,9 +276,16 @@ alpha_push_dummy_call (struct gdbarch *g
> case TYPE_CODE_CHAR:
> case TYPE_CODE_RANGE:
> case TYPE_CODE_ENUM:
> - if (TYPE_LENGTH (arg_type) < TYPE_LENGTH (builtin_type_long))
> + if (TYPE_LENGTH (arg_type) == 4)
> {
> - arg_type = builtin_type_long;
> + /* 32-bit values must be sign-extended to 64 bits
> + even if the base data type is unsigned. */
> + arg_type = builtin_type_int32;
> + arg = value_cast (arg_type, arg);
> + }
> + if (TYPE_LENGTH (arg_type) < ALPHA_REGISTER_SIZE)
> + {
> + arg_type = builtin_type_int64;
> arg = value_cast (arg_type, arg);
> }
> break;
> @@ -541,6 +548,10 @@ alpha_store_return_value (struct type *v
>
> default:
> /* Assume everything else degenerates to an integer. */
> + /* 32-bit values must be sign-extended to 64 bits
> + even if the base data type is unsigned. */
> + if (length == 4)
> + valtype = builtin_type_int32;
> l = unpack_long (valtype, valbuf);
> regcache_cooked_write_unsigned (regcache, ALPHA_V0_REGNUM, l);
> break;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFA] fix calling conventions wrt 32-bit values
2003-06-02 13:43 ` Elena Zannoni
@ 2003-06-02 16:00 ` Richard Henderson
0 siblings, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2003-06-02 16:00 UTC (permalink / raw)
To: Elena Zannoni; +Cc: gdb-patches
On Mon, Jun 02, 2003 at 09:49:12AM -0400, Elena Zannoni wrote:
> The alpha target has no official maintainer, and I think we can
> consider most of these patches obvious. I think that if they work for
> you, you can commit them yourself, and just post the patch with a
> [PATCH] subject.
Thanks. I'll still specially mark any patch that I'm not 100%
sure I'm using the proper gdb interface, but I think the bulk
of that job is done. There's only one more pending patch that
removes instances of the word "deprecated".
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-06-02 16:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-02 5:53 [RFA] fix calling conventions wrt 32-bit values Richard Henderson
2003-06-02 13:43 ` Elena Zannoni
2003-06-02 16:00 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox