summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2015-03-05 02:42:06 +0000
committerJason Molenda <jmolenda@apple.com>2015-03-05 02:42:06 +0000
commit9594459b215911a01c034dc54174e4b3c24676ef (patch)
tree022f7063d4f266e08d65f9c0b0118aaa64b36fb8
parent2fc3fe1282e8022c2b52b38f2daa616d77a3b901 (diff)
downloadbcm5719-llvm-9594459b215911a01c034dc54174e4b3c24676ef.tar.gz
bcm5719-llvm-9594459b215911a01c034dc54174e4b3c24676ef.zip
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> llvm-svn: 231342
-rw-r--r--lldb/source/Expression/DWARFExpression.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp
index e1f29742882..77a6f7d1299 100644
--- a/lldb/source/Expression/DWARFExpression.cpp
+++ b/lldb/source/Expression/DWARFExpression.cpp
@@ -611,7 +611,6 @@ DWARFExpression::DumpLocation (Stream *s, lldb::offset_t offset, lldb::offset_t
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, lldb::offset_t offset, lldb::offset_t
// 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;
}
OpenPOWER on IntegriCloud