Re: [rfa:ppc64] Use target in convert_from_func_ptr_addr

Andrew Cagney
2003-10-23T21:02:25Z

> On Oct 23, 12:26pm, Andrew Cagney wrote:
>
>
>> > On Oct 22, 9:37pm, Andrew Cagney wrote:
>> >
>> >
>
>> >> The attached rewrites the PPC64 GNU/Linux convert_from_func_ptr_addr
>> >> method so that it makes use of the explicit "struct target_ops"
>> >> parameter I recently added (previously it was indirectly using
>> >> current_target).
>
>>
>
>> >
>> > IMO, this version of the code is harder to read than the old version.

If you want I can add a wrapper method, reducing the actual change to
just the modification of:

- return read_memory_unsigned_integer (addr, 8);

to:

+ return get_target_memory_unsigned (targ, addr, 8);

>> > Can you explain what using an explicit `struct target_ops'' parameter
>> > buys us?
>
>>
>> By using the explicit "struct target_ops", I've eliminated the
>> assumption that the _single_ _global_ current_target contains the
>> function descriptor.
>
>
> Yes. But what does this buy us? I.e, what will we be able to do after
> this patch that we couldn't do before?

The ability to apply this architecture method to an arbitrary target
instance? Sorry, but I'm afraid that I'm missing something in your
question.

Andrew