Re: RFA: New port: ia64-hp-openvms - the stub

Pedro Alves
2012-02-24T11:24:59Z

On 02/24/2012 11:12 AM, Tristan Gingold wrote:
>
> On Feb 24, 2012, at 11:46 AM, Pedro Alves wrote:
>
>>>>>>> +#if 1
>>>>>>> + /* What a mess. Gdb and linux expects bsp to point after the current
>>>>>>> + register frame. Adjust. */
>>>>>>
>>>>>> What does this mean? Are we committing to a hack that will make our
>>>>>> lives hard when we want to fix it?
>>>>>
>>>>> I have updated the comment. Currently, ia64-tdep.c follows the Linux convention, and we don't want to change that. So the BSP has to be adjusted.
>>>>
>>>> Why don't we want to change it?
>>>
>>> I think it's too late. That would be a change in gdbserver and other stubs, so it would break compatibility.
>>
>> We have ways to make it happen without breaking other stubs. The question is what is the
>> right thing to do.
>
> I am not sure that modifying the convention of BSP is the right thing to do.
>
>> Is this really Linux specific? We have ia64 hpux support as well.
>
> AFAIU, hpux also follows the Linux convention.
>
>> I take it libunwind must follow the same convention as well, and I hope a libunwind
>> built on a Linux host doesn't behave different from a libunwind built on a
>> different host.
>
> That's correct. libunwind convention matches the VMS one, and therefore ia64-tdep.c has to translate the convention.
> See for example the case of UNW_IA64_AR_BSP in ia64-tdep.c:ia64_access_reg.

Damn, what a mess... If we want to fix this, getting rid of the unnecessary conversions
all around, we can do it with a xml target description with a new standard feature
(org.gnu.gdb.ia64.something) so that gdb knows the registers are sent with the
libunwind/vms convention. Without that, yes, we should feed the raw register set
as gdb has been expecting it.

>
>> The adjustment in the VMS stubs isn't that complex.
>>
>> Hopefully it'll still be simple with infcalls in the game. :-) afaics, you're
>> not undoing the adjustment on writes.
>
> Correct. Writing this register is used only to implement inferior call, which is not yet implemented. The user will never modify it
> directly, as this value cannot be changed without modifying other registers. HPUX even don't allow to modify it (for not so bad reasons).
> Welcome in ia64 world!
>
> Tristan.
>

--
Pedro Alves