LLDB  mainline
ValueObjectVariable.cpp
Go to the documentation of this file.
1 //===-- ValueObjectVariable.cpp -------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 
11 #include "lldb/Core/Address.h"
12 #include "lldb/Core/AddressRange.h"
13 #include "lldb/Core/Declaration.h"
14 #include "lldb/Core/Module.h"
15 #include "lldb/Core/Value.h"
17 #include "lldb/Symbol/Function.h"
18 #include "lldb/Symbol/ObjectFile.h"
21 #include "lldb/Symbol/Type.h"
22 #include "lldb/Symbol/Variable.h"
24 #include "lldb/Target/Process.h"
26 #include "lldb/Target/Target.h"
29 #include "lldb/Utility/Scalar.h"
30 #include "lldb/Utility/Status.h"
32 #include "lldb/lldb-types.h"
33 
34 #include "llvm/ADT/StringRef.h"
35 
36 #include <cassert>
37 #include <memory>
38 
39 namespace lldb_private {
41 }
42 namespace lldb_private {
43 class StackFrame;
44 }
45 namespace lldb_private {
46 struct RegisterInfo;
47 }
48 using namespace lldb_private;
49 
50 lldb::ValueObjectSP
52  const lldb::VariableSP &var_sp) {
53  auto manager_sp = ValueObjectManager::Create();
54  return (new ValueObjectVariable(exe_scope, *manager_sp, var_sp))->GetSP();
55 }
56 
58  ValueObjectManager &manager,
59  const lldb::VariableSP &var_sp)
60  : ValueObject(exe_scope, manager), m_variable_sp(var_sp) {
61  // Do not attempt to construct one of these objects with no variable!
62  assert(m_variable_sp.get() != nullptr);
63  m_name = var_sp->GetName();
64 }
65 
67 
69  Type *var_type = m_variable_sp->GetType();
70  if (var_type)
71  return var_type->GetForwardCompilerType();
72  return CompilerType();
73 }
74 
76  Type *var_type = m_variable_sp->GetType();
77  if (var_type)
78  return var_type->GetName();
79  return ConstString();
80 }
81 
83  Type *var_type = m_variable_sp->GetType();
84  if (var_type)
85  return var_type->GetForwardCompilerType().GetDisplayTypeName();
86  return ConstString();
87 }
88 
90  Type *var_type = m_variable_sp->GetType();
91  if (var_type)
92  return var_type->GetQualifiedName();
93  return ConstString();
94 }
95 
98 
99  if (!type.IsValid())
100  return 0;
101 
103  const bool omit_empty_base_classes = true;
104  auto child_count = type.GetNumChildren(omit_empty_base_classes, &exe_ctx);
105  return child_count <= max ? child_count : max;
106 }
107 
108 llvm::Optional<uint64_t> ValueObjectVariable::GetByteSize() {
110 
112 
113  if (!type.IsValid())
114  return {};
115 
116  return type.GetByteSize(exe_ctx.GetBestExecutionContextScope());
117 }
118 
120  if (m_variable_sp)
121  return m_variable_sp->GetScope();
123 }
124 
126  SetValueIsValid(false);
127  m_error.Clear();
128 
129  Variable *variable = m_variable_sp.get();
130  DWARFExpressionList &expr_list = variable->LocationExpressionList();
131 
132  if (variable->GetLocationIsConstantValueData()) {
133  // expr doesn't contain DWARF bytes, it contains the constant variable
134  // value bytes themselves...
135  if (expr_list.GetExpressionData(m_data)) {
139  } else
140  m_error.SetErrorString("empty constant data");
141  // constant bytes can't be edited - sorry
143  } else {
144  lldb::addr_t loclist_base_load_addr = LLDB_INVALID_ADDRESS;
146 
147  Target *target = exe_ctx.GetTargetPtr();
148  if (target) {
151  }
152 
153  if (!expr_list.IsAlwaysValidSingleExpr()) {
154  SymbolContext sc;
155  variable->CalculateSymbolContext(&sc);
156  if (sc.function)
157  loclist_base_load_addr =
159  target);
160  }
161  Value old_value(m_value);
162  if (expr_list.Evaluate(&exe_ctx, nullptr, loclist_base_load_addr, nullptr,
163  nullptr, m_value, &m_error)) {
166 
167  CompilerType compiler_type = GetCompilerType();
168  if (compiler_type.IsValid())
169  m_value.SetCompilerType(compiler_type);
170 
171  Value::ValueType value_type = m_value.GetValueType();
172 
173  // The size of the buffer within m_value can be less than the size
174  // prescribed by its type. E.g. this can happen when an expression only
175  // partially describes an object (say, because it contains DW_OP_piece).
176  //
177  // In this case, grow m_value to the expected size. An alternative way to
178  // handle this is to teach Value::GetValueAsData() and ValueObjectChild
179  // not to read past the end of a host buffer, but this gets impractically
180  // complicated as a Value's host buffer may be shared with a distant
181  // ancestor or sibling in the ValueObject hierarchy.
182  //
183  // FIXME: When we grow m_value, we should represent the added bits as
184  // undefined somehow instead of as 0's.
185  if (value_type == Value::ValueType::HostAddress &&
186  compiler_type.IsValid()) {
187  if (size_t value_buf_size = m_value.GetBuffer().GetByteSize()) {
188  size_t value_size = m_value.GetValueByteSize(&m_error, &exe_ctx);
189  if (m_error.Success() && value_buf_size < value_size)
190  m_value.ResizeData(value_size);
191  }
192  }
193 
194  Process *process = exe_ctx.GetProcessPtr();
195  const bool process_is_alive = process && process->IsAlive();
196 
197  switch (value_type) {
199  m_error.SetErrorString("invalid value");
200  break;
202  // The variable value is in the Scalar value inside the m_value. We can
203  // point our m_data right to it.
204  m_error =
205  m_value.GetValueAsData(&exe_ctx, m_data, GetModule().get());
206  break;
207 
211  // The DWARF expression result was an address in the inferior process.
212  // If this variable is an aggregate type, we just need the address as
213  // the main value as all child variable objects will rely upon this
214  // location and add an offset and then read their own values as needed.
215  // If this variable is a simple type, we read all data for it into
216  // m_data. Make sure this type has a value before we try and read it
217 
218  // If we have a file address, convert it to a load address if we can.
219  if (value_type == Value::ValueType::FileAddress && process_is_alive)
220  m_value.ConvertToLoadAddress(GetModule().get(), target);
221 
222  if (!CanProvideValue()) {
223  // this value object represents an aggregate type whose children have
224  // values, but this object does not. So we say we are changed if our
225  // location has changed.
226  SetValueDidChange(value_type != old_value.GetValueType() ||
227  m_value.GetScalar() != old_value.GetScalar());
228  } else {
229  // Copy the Value and set the context to use our Variable so it can
230  // extract read its value into m_data appropriately
231  Value value(m_value);
232  value.SetContext(Value::ContextType::Variable, variable);
233  m_error =
234  value.GetValueAsData(&exe_ctx, m_data, GetModule().get());
235 
236  SetValueDidChange(value_type != old_value.GetValueType() ||
237  m_value.GetScalar() != old_value.GetScalar());
238  }
239  break;
240  }
241 
243  } else {
244  // could not find location, won't allow editing
246  }
247  }
248 
249  return m_error.Success();
250 }
251 
253  Value::ValueType value_type = valobj.GetValue().GetValueType();
255  Process *process = exe_ctx.GetProcessPtr();
256  const bool process_is_alive = process && process->IsAlive();
257  const uint32_t type_info = valobj.GetCompilerType().GetTypeInfo();
258  const bool is_pointer_or_ref =
259  (type_info & (lldb::eTypeIsPointer | lldb::eTypeIsReference)) != 0;
260 
261  switch (value_type) {
263  break;
265  // If this type is a pointer, then its children will be considered load
266  // addresses if the pointer or reference is dereferenced, but only if
267  // the process is alive.
268  //
269  // There could be global variables like in the following code:
270  // struct LinkedListNode { Foo* foo; LinkedListNode* next; };
271  // Foo g_foo1;
272  // Foo g_foo2;
273  // LinkedListNode g_second_node = { &g_foo2, NULL };
274  // LinkedListNode g_first_node = { &g_foo1, &g_second_node };
275  //
276  // When we aren't running, we should be able to look at these variables
277  // using the "target variable" command. Children of the "g_first_node"
278  // always will be of the same address type as the parent. But children
279  // of the "next" member of LinkedListNode will become load addresses if
280  // we have a live process, or remain a file address if it was a file
281  // address.
282  if (process_is_alive && is_pointer_or_ref)
284  else
286  break;
288  // Same as above for load addresses, except children of pointer or refs
289  // are always load addresses. Host addresses are used to store freeze
290  // dried variables. If this type is a struct, the entire struct
291  // contents will be copied into the heap of the
292  // LLDB process, but we do not currently follow any pointers.
293  if (is_pointer_or_ref)
295  else
297  break;
301  break;
302  }
303 }
304 
305 
306 
308  const ExecutionContextRef &exe_ctx_ref = GetExecutionContextRef();
309  if (exe_ctx_ref.HasFrameRef()) {
310  ExecutionContext exe_ctx(exe_ctx_ref);
311  StackFrame *frame = exe_ctx.GetFramePtr();
312  if (frame) {
313  return m_variable_sp->IsInScope(frame);
314  } else {
315  // This ValueObject had a frame at one time, but now we can't locate it,
316  // so return false since we probably aren't in scope.
317  return false;
318  }
319  }
320  // We have a variable that wasn't tied to a frame, which means it is a global
321  // and is always in scope.
322  return true;
323 }
324 
326  if (m_variable_sp) {
327  SymbolContextScope *sc_scope = m_variable_sp->GetSymbolContextScope();
328  if (sc_scope) {
329  return sc_scope->CalculateSymbolContextModule();
330  }
331  }
332  return lldb::ModuleSP();
333 }
334 
336  if (m_variable_sp)
337  return m_variable_sp->GetSymbolContextScope();
338  return nullptr;
339 }
340 
342  if (m_variable_sp) {
343  decl = m_variable_sp->GetDeclaration();
344  return true;
345  }
346  return false;
347 }
348 
352  else
354 }
355 
356 bool ValueObjectVariable::SetValueFromCString(const char *value_str,
357  Status &error) {
358  if (!UpdateValueIfNeeded()) {
359  error.SetErrorString("unable to update value before writing");
360  return false;
361  }
362 
364  RegisterInfo *reg_info = m_resolved_value.GetRegisterInfo();
366  RegisterContext *reg_ctx = exe_ctx.GetRegisterContext();
367  RegisterValue reg_value;
368  if (!reg_info || !reg_ctx) {
369  error.SetErrorString("unable to retrieve register info");
370  return false;
371  }
372  error = reg_value.SetValueFromString(reg_info, llvm::StringRef(value_str));
373  if (error.Fail())
374  return false;
375  if (reg_ctx->WriteRegister(reg_info, reg_value)) {
376  SetNeedsUpdate();
377  return true;
378  } else {
379  error.SetErrorString("unable to write back to register");
380  return false;
381  }
382  } else
383  return ValueObject::SetValueFromCString(value_str, error);
384 }
385 
387  if (!UpdateValueIfNeeded()) {
388  error.SetErrorString("unable to update value before writing");
389  return false;
390  }
391 
393  RegisterInfo *reg_info = m_resolved_value.GetRegisterInfo();
395  RegisterContext *reg_ctx = exe_ctx.GetRegisterContext();
396  RegisterValue reg_value;
397  if (!reg_info || !reg_ctx) {
398  error.SetErrorString("unable to retrieve register info");
399  return false;
400  }
401  error = reg_value.SetValueFromData(reg_info, data, 0, true);
402  if (error.Fail())
403  return false;
404  if (reg_ctx->WriteRegister(reg_info, reg_value)) {
405  SetNeedsUpdate();
406  return true;
407  } else {
408  error.SetErrorString("unable to write back to register");
409  return false;
410  }
411  } else
412  return ValueObject::SetData(data, error);
413 }
lldb_private::Variable::LocationExpressionList
DWARFExpressionList & LocationExpressionList()
Definition: Variable.h:76
lldb_private::AddressRange::GetBaseAddress
Address & GetBaseAddress()
Get accessor for the base address of the range.
Definition: AddressRange.h:209
lldb_private::RegisterContext::WriteRegister
virtual bool WriteRegister(const RegisterInfo *reg_info, const RegisterValue &reg_value)=0
lldb_private::ExecutionContextRef::HasFrameRef
bool HasFrameRef() const
Returns true if this object has a weak reference to a frame.
Definition: ExecutionContext.h:252
lldb_private::Value::ValueType::Scalar
@ Scalar
A raw scalar value.
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::ArchSpec::GetByteOrder
lldb::ByteOrder GetByteOrder() const
Returns the byte order for the architecture specification.
Definition: ArchSpec.cpp:729
lldb_private::DataBufferHeap::GetByteSize
lldb::offset_t GetByteSize() const override
Definition: DataBufferHeap.cpp:43
lldb_private::Value::GetBuffer
DataBufferHeap & GetBuffer()
Definition: Value.h:120
Scalar.h
lldb_private::ValueObject::CanProvideValue
virtual bool CanProvideValue()
Definition: ValueObject.cpp:3103
lldb_private::Value::ContextType::Variable
@ Variable
lldb_private::Variable *.
lldb_private::ValueObject::SetValueIsValid
void SetValueIsValid(bool valid)
Definition: ValueObject.h:980
lldb_private::ValueObject::GetValue
const Value & GetValue() const
Definition: ValueObject.h:497
lldb_private::RegisterValue
Definition: RegisterValue.h:28
lldb_private::Function::GetAddressRange
const AddressRange & GetAddressRange()
Definition: Function.h:457
lldb_private::SymbolContextScope::CalculateSymbolContextModule
virtual lldb::ModuleSP CalculateSymbolContextModule()
Definition: SymbolContextScope.h:78
lldb_private::Value
Definition: Value.h:38
lldb_private::ExecutionContext::GetProcessPtr
Process * GetProcessPtr() const
Returns a pointer to the process object.
Definition: ExecutionContext.cpp:206
lldb_private::Value::GetValueAsData
Status GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data, Module *module)
Definition: Value.cpp:298
lldb_private::Value::ValueType::Invalid
@ Invalid
lldb_private::Value::ValueType::FileAddress
@ FileAddress
A file address value.
lldb_private::Value::GetValueType
ValueType GetValueType() const
Definition: Value.cpp:106
lldb_private::ValueObjectVariable::GetModule
lldb::ModuleSP GetModule() override
Return the module associated with this value object in case the value is from an executable file and ...
Definition: ValueObjectVariable.cpp:325
lldb_private::ValueObjectVariable::GetDisplayTypeName
ConstString GetDisplayTypeName() override
Definition: ValueObjectVariable.cpp:82
lldb_private::ValueObject::m_name
ConstString m_name
The name of this object.
Definition: ValueObject.h:849
lldb_private::ClusterManager
Definition: SharedCluster.h:22
lldb_private::Process
Definition: Process.h:338
Module.h
lldb_private::eAddressTypeHost
@ eAddressTypeHost
Address is an address in the process that is running this code.
Definition: lldb-private-enumerations.h:36
lldb_private::DWARFExpressionList::IsAlwaysValidSingleExpr
bool IsAlwaysValidSingleExpr() const
Definition: DWARFExpressionList.cpp:20
lldb_private::ValueObject::SetValueDidChange
void SetValueDidChange(bool value_changed)
Definition: ValueObject.h:976
lldb_private::ValueObjectVariable::CalculateNumChildren
size_t CalculateNumChildren(uint32_t max) override
Should only be called by ValueObject::GetNumChildren().
Definition: ValueObjectVariable.cpp:96
lldb_private::ValueObjectVariable::GetDeclaration
bool GetDeclaration(Declaration &decl) override
Definition: ValueObjectVariable.cpp:341
lldb_private::ExecutionContext::GetFramePtr
StackFrame * GetFramePtr() const
Returns a pointer to the frame object.
Definition: ExecutionContext.h:408
lldb_private::Value::ValueType::LoadAddress
@ LoadAddress
A load address value.
lldb_private::ValueObjectVariable::GetTypeName
ConstString GetTypeName() override
Definition: ValueObjectVariable.cpp:75
lldb_private::CompilerType::GetByteSize
llvm::Optional< uint64_t > GetByteSize(ExecutionContextScope *exe_scope) const
Return the size of the type in bytes.
Definition: CompilerType.cpp:489
RegisterValue.h
lldb_private::Process::IsAlive
virtual bool IsAlive()
Check if a process is still alive.
Definition: Process.cpp:1085
lldb_private::ValueObjectVariable::GetValueType
lldb::ValueType GetValueType() const override
Definition: ValueObjectVariable.cpp:119
lldb_private::Type::GetName
ConstString GetName()
Definition: Type.cpp:302
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb-private-enumerations.h
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::Target
Definition: Target.h:469
Process.h
lldb_private::Value::ContextType::Invalid
@ Invalid
Undefined.
lldb_private::Value::GetRegisterInfo
RegisterInfo * GetRegisterInfo() const
Definition: Value.cpp:123
lldb_private::Value::SetCompilerType
void SetCompilerType(const CompilerType &compiler_type)
Definition: Value.cpp:251
lldb_private::ValueObject::m_data
DataExtractor m_data
A data extractor that can be used to extract the value.
Definition: ValueObject.h:851
Target.h
lldb_private::DataExtractor::SetByteOrder
void SetByteOrder(lldb::ByteOrder byte_order)
Set the byte_order value.
Definition: DataExtractor.h:931
lldb_private::Value::GetScalar
const Scalar & GetScalar() const
Definition: Value.h:112
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::Status::Success
bool Success() const
Test for success condition.
Definition: Status.cpp:287
lldb_private::ExecutionContext::GetRegisterContext
RegisterContext * GetRegisterContext() const
Definition: ExecutionContext.cpp:190
lldb_private::CompilerType::GetDisplayTypeName
ConstString GetDisplayTypeName() const
Definition: CompilerType.cpp:284
lldb_private::DataExtractor
Definition: DataExtractor.h:48
lldb_private::Value::ConvertToLoadAddress
void ConvertToLoadAddress(Module *module, Target *target)
Convert this value's file address to a load address, if possible.
Definition: Value.cpp:646
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb_private::ValueObject::SetAddressTypeOfChildren
void SetAddressTypeOfChildren(AddressType at)
Definition: ValueObject.h:759
Declaration.h
lldb_private::SymbolContext::function
Function * function
The Function for a given query.
Definition: SymbolContext.h:320
lldb_private::DataExtractor::SetAddressByteSize
void SetAddressByteSize(uint32_t addr_size)
Set the address byte size.
Definition: DataExtractor.h:845
lldb_private::ValueObjectVariable::GetCompilerTypeImpl
CompilerType GetCompilerTypeImpl() override
Definition: ValueObjectVariable.cpp:68
Type.h
lldb_private::DataExtractor::GetDataStart
const uint8_t * GetDataStart() const
Get the data start pointer.
Definition: DataExtractor.h:422
lldb_private::ValueObjectVariable::~ValueObjectVariable
~ValueObjectVariable() override
SymbolContextScope.h
lldb_private::ValueObjectVariable::ValueObjectVariable
ValueObjectVariable(ExecutionContextScope *exe_scope, ValueObjectManager &manager, const lldb::VariableSP &var_sp)
Definition: ValueObjectVariable.cpp:57
lldb_private::ConstString
Definition: ConstString.h:39
lldb_private::ValueObject::UpdateValueIfNeeded
bool UpdateValueIfNeeded(bool update_format=true)
Definition: ValueObject.cpp:111
lldb_private::ValueObjectVariable::m_variable_sp
lldb::VariableSP m_variable_sp
The variable that this value object is based upon.
Definition: ValueObjectVariable.h:76
lldb_private::Value::ValueType
ValueType
Type that describes Value::m_value.
Definition: Value.h:41
lldb_private::ValueObject::GetExecutionContextRef
const ExecutionContextRef & GetExecutionContextRef() const
Definition: ValueObject.h:330
lldb_private::eAddressTypeLoad
@ eAddressTypeLoad
Address is an address as in the current target inferior process.
Definition: lldb-private-enumerations.h:34
lldb_private::ValueObjectVariable::GetQualifiedTypeName
ConstString GetQualifiedTypeName() override
Definition: ValueObjectVariable.cpp:89
Address.h
lldb_private::RegisterContext
Definition: RegisterContext.h:17
lldb_private::CompilerType::IsValid
bool IsValid() const
Definition: CompilerType.h:72
lldb_private::ArchSpec::GetAddressByteSize
uint32_t GetAddressByteSize() const
Returns the size in bytes of an address of the current architecture.
Definition: ArchSpec.cpp:682
lldb_private::SymbolContextScope
Definition: SymbolContextScope.h:64
ObjectFile.h
lldb_private::DWARFExpressionList::Evaluate
bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx, lldb::addr_t func_load_addr, const Value *initial_value_ptr, const Value *object_address_ptr, Value &result, Status *error_ptr) const
Definition: DWARFExpressionList.cpp:201
lldb_private::CompilerType::GetNumChildren
uint32_t GetNumChildren(bool omit_empty_base_classes, const ExecutionContext *exe_ctx) const
Definition: CompilerType.cpp:515
lldb_private::ValueObject::SetValueFromCString
virtual bool SetValueFromCString(const char *value_str, Status &error)
Definition: ValueObject.cpp:1465
lldb-types.h
lldb_private::ValueObjectVariable::m_resolved_value
Value m_resolved_value
Definition: ValueObjectVariable.h:79
lldb_private::RegisterValue::SetValueFromData
Status SetValueFromData(const RegisterInfo *reg_info, DataExtractor &data, lldb::offset_t offset, bool partial_data_ok)
Definition: RegisterValue.cpp:172
lldb_private::Target::GetArchitecture
const ArchSpec & GetArchitecture() const
Definition: Target.h:989
lldb_private::Status
Definition: Status.h:44
lldb_private::ValueObject
ValueObject:
Definition: ValueObject.h:105
DWARFExpressionList.h
lldb::ValueType
ValueType
Definition: lldb-enumerations.h:315
lldb_private::Type::GetQualifiedName
ConstString GetQualifiedName()
Definition: Type.cpp:660
uint32_t
lldb_private::ExecutionContext::GetBestExecutionContextScope
ExecutionContextScope * GetBestExecutionContextScope() const
Definition: ExecutionContext.cpp:214
lldb_private::ValueObject::m_value
Value m_value
Definition: ValueObject.h:852
lldb_private::Value::ValueType::HostAddress
@ HostAddress
A host address value (for memory in the process that < A is using liblldb).
lldb_private::ValueObjectVariable::SetValueFromCString
bool SetValueFromCString(const char *value_str, Status &error) override
Definition: ValueObjectVariable.cpp:356
lldb_private::eAddressTypeFile
@ eAddressTypeFile
Address is an address as found in an object or symbol file.
Definition: lldb-private-enumerations.h:32
lldb_private::Type
Definition: Type.h:66
lldb_private::CompilerType::GetTypeInfo
uint32_t GetTypeInfo(CompilerType *pointee_or_element_compiler_type=nullptr) const
Definition: CompilerType.cpp:290
lldb_private::Status::SetErrorString
void SetErrorString(llvm::StringRef err_str)
Set the current error string to err_str.
Definition: Status.cpp:241
lldb_private::Address::GetLoadAddress
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
Definition: Address.cpp:311
lldb_private::Type::GetForwardCompilerType
CompilerType GetForwardCompilerType()
Definition: Type.cpp:655
lldb_private::Value::GetContextType
ContextType GetContextType() const
Definition: Value.h:87
lldb_private::ValueObject::GetCompilerType
CompilerType GetCompilerType()
Definition: ValueObject.h:352
lldb_private::Variable::CalculateSymbolContext
void CalculateSymbolContext(SymbolContext *sc)
Definition: Variable.cpp:206
lldb_private::ValueObjectVariable::SetData
bool SetData(DataExtractor &data, Status &error) override
Definition: ValueObjectVariable.cpp:386
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:74
DataExtractor.h
lldb_private::CompilerType
Generic representation of a type in a programming language.
Definition: CompilerType.h:33
Function.h
lldb_private::ValueObject::GetLocationAsCString
virtual const char * GetLocationAsCString()
Definition: ValueObject.h:508
lldb_private::Value::ContextType::RegisterInfo
@ RegisterInfo
RegisterInfo * (can be a scalar or a vector register).
lldb_private::ValueObjectVariable::DoUpdateChildrenAddressType
void DoUpdateChildrenAddressType(ValueObject &valobj) override
Definition: ValueObjectVariable.cpp:252
Status.h
SymbolContext.h
lldb_private::ValueObject::SetData
virtual bool SetData(DataExtractor &data, Status &error)
Definition: ValueObject.cpp:783
lldb_private::ValueObjectVariable::GetSymbolContextScope
SymbolContextScope * GetSymbolContextScope() override
Definition: ValueObjectVariable.cpp:335
lldb_private::Value::SetBytes
void SetBytes(const void *bytes, int len)
Definition: Value.cpp:87
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb::eValueTypeInvalid
@ eValueTypeInvalid
Definition: lldb-enumerations.h:316
lldb_private::Value::SetContext
void SetContext(ContextType context_type, void *p)
Definition: Value.h:96
lldb_private::Value::ResizeData
size_t ResizeData(size_t len)
Definition: Value.cpp:173
lldb_private::Variable::GetLocationIsConstantValueData
bool GetLocationIsConstantValueData() const
Definition: Variable.h:96
lldb_private::ValueObjectVariable::IsInScope
bool IsInScope() override
Definition: ValueObjectVariable.cpp:307
lldb_private::DWARFExpressionList::GetExpressionData
bool GetExpressionData(DataExtractor &data, lldb::addr_t func_load_addr=LLDB_INVALID_ADDRESS, lldb::addr_t file_addr=0) const
Get the expression data at the file address.
Definition: DWARFExpressionList.cpp:41
lldb_private::Status::Clear
void Clear()
Clear the object state.
Definition: Status.cpp:167
lldb_private::ValueObjectVariable::GetByteSize
llvm::Optional< uint64_t > GetByteSize() override
Definition: ValueObjectVariable.cpp:108
ValueObjectVariable.h
lldb_private::DWARFExpressionList
Definition: DWARFExpressionList.h:24
lldb_private::Value::GetValueByteSize
uint64_t GetValueByteSize(Status *error_ptr, ExecutionContext *exe_ctx)
Definition: Value.cpp:194
lldb_private::Variable
Definition: Variable.h:25
lldb_private::ValueObject::m_error
Status m_error
An error object that can describe any errors that occur when updating values.
Definition: ValueObject.h:855
lldb_private::ValueObjectVariable::Create
static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp)
Definition: ValueObjectVariable.cpp:51
lldb_private::ValueObject::GetLocationAsCStringImpl
const char * GetLocationAsCStringImpl(const Value &value, const DataExtractor &data)
Definition: ValueObject.cpp:288
Variable.h
lldb_private::Declaration
Definition: Declaration.h:24
lldb_private::DataExtractor::GetByteSize
uint64_t GetByteSize() const
Get the number of bytes contained in this object.
Definition: DataExtractor.h:270
lldb_private::StackFrame
Definition: StackFrame.h:40
AddressRange.h
lldb_private::ValueObjectVariable::UpdateValue
bool UpdateValue() override
Definition: ValueObjectVariable.cpp:125
RegisterContext.h
lldb_private::RegisterValue::SetValueFromString
Status SetValueFromString(const RegisterInfo *reg_info, llvm::StringRef value_str)
Definition: RegisterValue.cpp:335
Value.h
lldb_private::ExecutionContextRef
Execution context objects refer to objects in the execution of the program that is being debugged.
Definition: ExecutionContext.h:72
lldb_private::ExecutionContext::GetTargetPtr
Target * GetTargetPtr() const
Returns a pointer to the target object.
Definition: ExecutionContext.cpp:198
ExecutionContext.h
lldb_private::ClusterManager::Create
static std::shared_ptr< ClusterManager > Create()
Definition: SharedCluster.h:24
lldb_private::ValueObjectVariable::GetLocationAsCString
const char * GetLocationAsCString() override
Definition: ValueObjectVariable.cpp:349
lldb_private::ValueObject::SetNeedsUpdate
void SetNeedsUpdate()
Definition: ValueObject.cpp:229