[Lldb-commits] [lldb] r231342 - Add support for the DWARFv3 (circa 2005) DW_OP_form_tls_address

Jason Molenda jmolenda at apple.com
Wed Mar 4 18:42:06 PST 2015


Author: jmolenda
Date: Wed Mar  4 20:42:06 2015
New Revision: 231342

URL: http://llvm.org/viewvc/llvm-project?rev=231342&view=rev
Log:
Add support for the DWARFv3 (circa 2005) DW_OP_form_tls_address
operator in addition to the vendor-extension DW_OP_GNU_push_tls_address.
clang on PS4 and Darwin will be emitting the standard opcode 
as of r231286 via http://reviews.llvm.org/D8018

Behavior of this standard  opcode is the same as 
DW_OP_GNU_push_tls_address.

<rdar://problem/20043195>

Modified:
    lldb/trunk/source/Expression/DWARFExpression.cpp

Modified: lldb/trunk/source/Expression/DWARFExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/DWARFExpression.cpp?rev=231342&r1=231341&r2=231342&view=diff
==============================================================================
--- lldb/trunk/source/Expression/DWARFExpression.cpp (original)
+++ lldb/trunk/source/Expression/DWARFExpression.cpp Wed Mar  4 20:42:06 2015
@@ -611,7 +611,6 @@ DWARFExpression::DumpLocation (Stream *s
         case DW_OP_call_ref:                                                // 0x9a DWARF3 1 4- or 8-byte offset of DIE
             s->Printf("DW_OP_call_ref(0x%8.8" PRIx64 ")", m_data.GetAddress(&offset));
             break;
-//      case DW_OP_form_tls_address: s << "form_tls_address"; break;        // 0x9b DWARF3
 //      case DW_OP_call_frame_cfa: s << "call_frame_cfa"; break;            // 0x9c DWARF3
 //      case DW_OP_bit_piece:                                               // 0x9d DWARF3 2
 //          s->Printf("DW_OP_bit_piece(0x%x, 0x%x)", m_data.GetULEB128(&offset), m_data.GetULEB128(&offset));
@@ -624,6 +623,9 @@ DWARFExpression::DumpLocation (Stream *s
 //        case DW_OP_APPLE_array_ref:
 //            s->PutCString("DW_OP_APPLE_array_ref");
 //            break;
+        case DW_OP_form_tls_address:
+            s->PutCString("DW_OP_form_tls_address");  // 0x9b
+            break;
         case DW_OP_GNU_push_tls_address:
             s->PutCString("DW_OP_GNU_push_tls_address");  // 0xe0
             break;
@@ -2897,17 +2899,24 @@ DWARFExpression::Evaluate
             break;
 
         //----------------------------------------------------------------------
-        // OPCODE: DW_OP_GNU_push_tls_address
+        // OPCODE: DW_OP_form_tls_address (or the old pre-DWARFv3 vendor extension opcode, DW_OP_GNU_push_tls_address)
         // OPERANDS: none
         // DESCRIPTION: Pops a TLS offset from the stack, converts it to
-        // an absolute value, and pushes it back on.
+        // an address in the current thread's thread-local storage block, 
+        // and pushes it on the stack.
         //----------------------------------------------------------------------
+        case DW_OP_form_tls_address:
         case DW_OP_GNU_push_tls_address:
             {
                 if (stack.size() < 1)
                 {
                     if (error_ptr)
-                        error_ptr->SetErrorString("DW_OP_GNU_push_tls_address needs an argument.");
+                    {
+                        if (op == DW_OP_form_tls_address)
+                            error_ptr->SetErrorString("DW_OP_form_tls_address needs an argument.");
+                        else
+                            error_ptr->SetErrorString("DW_OP_GNU_push_tls_address needs an argument.");
+                    }
                     return false;
                 }
 





More information about the lldb-commits mailing list