This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Handle DW_OP_form_tls_address


>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> On 08/23/2016 12:04 AM, Tom Tromey wrote:
>> Currently gdb supports DW_OP_GNU_push_tls_address, but not
>> DW_OP_form_tls_address.  I think it would be better if the toolchain
>> as a whole moved to using the standard opcode, and the prerequisite to
>> this is getting gdb to recognize it.

Pedro> Are the semantics of the two exactly the same?

Yes, but with a footnote.

DW_OP_form_tls_address is described in the standard:

    The DW_OP_form_tls_address operation pops a value from the stack,
    translates it into an address in the current thread's thread-local
    storage block, and pushes the address. If the DWARF expression
    containing the DW_OP_form_tls_address operation belongs to the main
    executable's DWARF info, the operation uses the main executable's
    thread-local storage block; if the expression belongs to a shared
    library's DWARF info, then it uses that shared library's
    thread-local storage block.

DW_OP_GNU_push_tls_address isn't documented to my knowledge; however it
pops a value from the stack and translates it into an address.

In either case, it seems to me that there's also a lot left to the
implementation, so much so that we can treat them identically.

My theory is that maybe the GNU one was added first and then
standardized.  But I didn't do any archaeology to try to find out for
sure.

Pedro> LGTM as is.

Thanks.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]