Re: GDB support for thread-local storage

Andrew Cagney
2002-06-22T15:31:50Z

> I don't know. HP people do monitor this list so may be able to answer.
>>
>
>> > But in any case, HP's gdbarch method for finding thread-local storage
>> > would be very simple: just add the offset to CR27, and there's your
>> > address.
>
>>
>> BTW, why, in your propsal, is the offset incorporated into the address
>> that is returned - rather than getting the base address and then
>> adding the offset - more like HP did.
>
>
> That's me imitating a rather weird quirk in the way the TLS run-time
> implementation works. But if you look at my Dwarf 2 sketch proposal,
> we can't do it that way. We need something that gives us the base
> address. So the way HP does it is pretty much the way we'll do it,
> except for the assumption that the base address is in a register.

So an initial work-in-progress interface can be simplified to just:

target_thread_base_address(thread, pc?, &base_addr)
-> ok, not-available

dropping that offset et.al.? Someone else can add them if they later
prove necessary.

Andrew