Re: [PATCH 1/4] New gdb arch hook: return_with_first_hidden_param_p

Yao Qi
2012-05-16T01:55:23Z

On 05/16/2012 02:02 AM, Mark Kettenis wrote:
>> > No, the extra hidden parameter's type is the reference of the function's
>> > return type. My point is if we only examine debug info, we don't know
>> > whether hidden parameter is passed, because the debug info is the same
>> > regardless of hidden parameter is passed or not.
> I'm still very confused. This "hidden parameter" thing sounds exactly
> like "struct_return". So are you saying that on some architectures
> gdbarch_return_value() return RETUN_VALUE_REGISTER_CONVENTION when if
> fact for C++ (and not for plain C) it should return
> RETURN_VALUE_STRUCT_CONVENTION?

In an inferior call, there are two steps related to ABI, 1) passing
parameters, 2) fetching return value. The "hidden parameter" is
relevant to both steps. Your description above is correct, and it is
about step 2. My patches are trying to fix the problems in step 1. So
far, GDB passes hidden parameter for some language, but on some targets,
the hidden parameter is not passed by parameter register, it is passed
by other register specified by its ABI. GDB is wrong if it still pass
hidden parameter to parameter register.

--
Yao (é½å°§)