This is the mail archive of the
mailing list for the GDB project.
Re: [RFA] Handle DW_OP_form_tls_address
- From: Tom Tromey <tom at tromey dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Fri, 02 Sep 2016 10:06:30 -0600
- Subject: Re: [RFA] Handle DW_OP_form_tls_address
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com> <firstname.lastname@example.org>
>>>>> "Pedro" == Pedro Alves <email@example.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
Pedro> LGTM as is.