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.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134579 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/DWARFExpression.cpp b/source/Expression/DWARFExpression.cpp
index b038a56..d4bc257 100644
--- a/source/Expression/DWARFExpression.cpp
+++ b/source/Expression/DWARFExpression.cpp
@@ -896,7 +896,7 @@
// 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 @@
// 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 @@
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 @@
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 @@
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;