aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-07-26 20:25:00 +0000
committerTom Tromey <tromey@redhat.com>2010-07-26 20:25:00 +0000
commit09d8bd0068cb53d4db91a951fd5982f16f126049 (patch)
tree6cf16d0c11389e00239bb2af7f7ea534c087cfb4 /gdb
parent9fe70b4fe2ead9bc8782751ae9fb2b808bcc8f58 (diff)
downloadgdb-09d8bd0068cb53d4db91a951fd5982f16f126049.zip
gdb-09d8bd0068cb53d4db91a951fd5982f16f126049.tar.gz
gdb-09d8bd0068cb53d4db91a951fd5982f16f126049.tar.bz2
* dwarf2loc.c (locexpr_describe_location_piece): Also recognize
TLS with DW_OP_const4u or DW_OP_const8u.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/dwarf2loc.c14
2 files changed, 14 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b9a411a..718e7d5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-26 Tom Tromey <tromey@redhat.com>
+
+ * dwarf2loc.c (locexpr_describe_location_piece): Also recognize
+ TLS with DW_OP_const4u or DW_OP_const8u.
+
2010-07-26 Thiago Jung Bauermann <bauerman@br.ibm.com>
* ppc-linux-nat.c (store_vsx_register): Use PTRACE_GETVSXREGS to get
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 2a8e557..f59bc40 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -2016,15 +2016,19 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
DW_AT_location : 10 byte block: 3 4 0 0 0 0 0 0 0 e0
(DW_OP_addr: 4; DW_OP_GNU_push_tls_address)
-
+
0x3 is the encoding for DW_OP_addr, which has an operand as long
as the size of an address on the target machine (here is 8
- bytes). 0xe0 is the encoding for DW_OP_GNU_push_tls_address.
- The operand represents the offset at which the variable is within
- the thread local storage. */
+ bytes). Note that more recent version of GCC emit DW_OP_const4u
+ or DW_OP_const8u, depending on address size, rather than
+ DW_OP_addr. 0xe0 is the encoding for
+ DW_OP_GNU_push_tls_address. The operand represents the offset at
+ which the variable is within the thread local storage. */
else if (data + 1 + addr_size < end
- && data[0] == DW_OP_addr
+ && (data[0] == DW_OP_addr
+ || (addr_size == 4 && data[0] == DW_OP_const4u)
+ || (addr_size == 8 && data[0] == DW_OP_const8u))
&& data[1 + addr_size] == DW_OP_GNU_push_tls_address
&& piece_end_p (data + 2 + addr_size, end))
{