]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* dwarf2loc.c (locexpr_describe_location_piece): Also recognize
authorTom Tromey <tromey@redhat.com>
Tue, 27 Jul 2010 16:11:03 +0000 (16:11 +0000)
committerTom Tromey <tromey@redhat.com>
Tue, 27 Jul 2010 16:11:03 +0000 (16:11 +0000)
TLS with DW_OP_const4u or DW_OP_const8u.

gdb/ChangeLog
gdb/dwarf2loc.c

index 1585b526993e44d46541cbf72bc004d9d3b2face..f22ce9457b201e351e3798679c27f64c6d1c724c 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-27  Tom Tromey  <tromey@redhat.com>
+
+       * dwarf2loc.c (locexpr_describe_location_piece): Also recognize
+       TLS with DW_OP_const4u or DW_OP_const8u.
+
 2010-07-22  Pedro Alves  <pedro@codesourcery.com>
 
        * NEWS: Mention target reported shared libraries support by
index 2a8e557f2842b8ae5d454d767872abc9b879291d..f59bc4052fa6a6d6dc6d06391c9d90f4264c48bd 100644 (file)
@@ -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))
     {