summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/DWARFExpression.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-07-07 01:59:51 +0000
committerGreg Clayton <gclayton@apple.com>2011-07-07 01:59:51 +0000
commit644247c1dc56106a06afbf8ac25fa4e07f46dd88 (patch)
treef318a596a16b71724e40d6ae52564b263b5baa10 /lldb/source/Expression/DWARFExpression.cpp
parenta3c122db7e4883129bb35558becd6fe8c4722295 (diff)
downloadbcm5719-llvm-644247c1dc56106a06afbf8ac25fa4e07f46dd88.tar.gz
bcm5719-llvm-644247c1dc56106a06afbf8ac25fa4e07f46dd88.zip
Added "target variable" command that allows introspection of global
variables prior to running your binary. Zero filled sections now get section data correctly filled with zeroes when Target::ReadMemory reads from the object file section data. Added new option groups and option values for file lists. I still need to hook up all of the options to "target variable" to allow more complete introspection by file and shlib. Added the ability for ValueObjectVariable objects to be created with only the target as the execution context. This allows them to be read from the object files through Target::ReadMemory(...). Added a "virtual Module * GetModule()" function to the ValueObject class. By default it will look to the parent variable object and return its module. The module is needed when we have global variables that have file addresses (virtual addresses that are specific to module object files) and in turn allows global variables to be displayed prior to running. Removed all of the unused proxy object support that bit rotted in lldb_private::Value. Replaced a lot of places that used "FileSpec::Compare (lhs, rhs) == 0" code with the more efficient "FileSpec::Equal (lhs, rhs)". Improved logging in GDB remote plug-in. llvm-svn: 134579
Diffstat (limited to 'lldb/source/Expression/DWARFExpression.cpp')
-rw-r--r--lldb/source/Expression/DWARFExpression.cpp32
1 files changed, 20 insertions, 12 deletions
diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp
index b038a5622e4..d4bc257c677 100644
--- a/lldb/source/Expression/DWARFExpression.cpp
+++ b/lldb/source/Expression/DWARFExpression.cpp
@@ -896,7 +896,7 @@ DWARFExpression::Evaluate
// address and whose size is the size of an address on the target machine.
//----------------------------------------------------------------------
case DW_OP_addr:
- stack.push_back(opcodes.GetAddress(&offset));
+ stack.push_back(Scalar(opcodes.GetAddress(&offset)));
stack.back().SetValueType (Value::eValueTypeFileAddress);
break;
@@ -1157,16 +1157,16 @@ DWARFExpression::Evaluate
// DW_OP_constu unsigned LEB128 integer constant
// DW_OP_consts signed LEB128 integer constant
//----------------------------------------------------------------------
- case DW_OP_const1u : stack.push_back(( uint8_t)opcodes.GetU8(&offset)); break;
- case DW_OP_const1s : stack.push_back(( int8_t)opcodes.GetU8(&offset)); break;
- case DW_OP_const2u : stack.push_back((uint16_t)opcodes.GetU16(&offset)); break;
- case DW_OP_const2s : stack.push_back(( int16_t)opcodes.GetU16(&offset)); break;
- case DW_OP_const4u : stack.push_back((uint32_t)opcodes.GetU32(&offset)); break;
- case DW_OP_const4s : stack.push_back(( int32_t)opcodes.GetU32(&offset)); break;
- case DW_OP_const8u : stack.push_back((uint64_t)opcodes.GetU64(&offset)); break;
- case DW_OP_const8s : stack.push_back(( int64_t)opcodes.GetU64(&offset)); break;
- case DW_OP_constu : stack.push_back(opcodes.GetULEB128(&offset)); break;
- case DW_OP_consts : stack.push_back(opcodes.GetSLEB128(&offset)); break;
+ case DW_OP_const1u : stack.push_back(Scalar(( uint8_t)opcodes.GetU8 (&offset))); break;
+ case DW_OP_const1s : stack.push_back(Scalar(( int8_t)opcodes.GetU8 (&offset))); break;
+ case DW_OP_const2u : stack.push_back(Scalar((uint16_t)opcodes.GetU16 (&offset))); break;
+ case DW_OP_const2s : stack.push_back(Scalar(( int16_t)opcodes.GetU16 (&offset))); break;
+ case DW_OP_const4u : stack.push_back(Scalar((uint32_t)opcodes.GetU32 (&offset))); break;
+ case DW_OP_const4s : stack.push_back(Scalar(( int32_t)opcodes.GetU32 (&offset))); break;
+ case DW_OP_const8u : stack.push_back(Scalar((uint64_t)opcodes.GetU64 (&offset))); break;
+ case DW_OP_const8s : stack.push_back(Scalar(( int64_t)opcodes.GetU64 (&offset))); break;
+ case DW_OP_constu : stack.push_back(Scalar(opcodes.GetULEB128 (&offset))); break;
+ case DW_OP_consts : stack.push_back(Scalar(opcodes.GetSLEB128 (&offset))); break;
//----------------------------------------------------------------------
// OPCODE: DW_OP_dup
@@ -1877,7 +1877,7 @@ DWARFExpression::Evaluate
case DW_OP_lit29:
case DW_OP_lit30:
case DW_OP_lit31:
- stack.push_back(op - DW_OP_lit0);
+ stack.push_back(Scalar(op - DW_OP_lit0));
break;
//----------------------------------------------------------------------
@@ -2567,6 +2567,10 @@ DWARFExpression::Evaluate
error_ptr->SetErrorStringWithFormat ("DW_OP_APPLE_expr_local(%u) with invalid index %u.\n", idx, idx);
return false;
}
+ // The proxy code has been removed. If it is ever re-added, please
+ // use shared pointers or return by value to avoid possible memory
+ // leak (there is no leak here, but in general, no returning pointers
+ // that must be manually freed please.
Value *proxy = expr_local_variable->CreateProxy();
stack.push_back(*proxy);
delete proxy;
@@ -2598,6 +2602,10 @@ DWARFExpression::Evaluate
error_ptr->SetErrorStringWithFormat ("DW_OP_APPLE_extern(%u) with invalid index %u.\n", idx, idx);
return false;
}
+ // The proxy code has been removed. If it is ever re-added, please
+ // use shared pointers or return by value to avoid possible memory
+ // leak (there is no leak here, but in general, no returning pointers
+ // that must be manually freed please.
Value *proxy = extern_var->CreateProxy();
stack.push_back(*proxy);
delete proxy;
OpenPOWER on IntegriCloud