diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:06:29 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-01-19 10:06:29 +0000 | 
| commit | 94994d372d014ce4c8758b9605d63fae651bd8aa (patch) | |
| tree | 51c0b708bd59f205d6b35cb2a8c24d62f0c33d77 /source/Core/ValueObjectConstResult.cpp | |
| parent | 39be7ce23363d12ae3e49aeb1fdb2bfeb892e836 (diff) | |
Notes
Diffstat (limited to 'source/Core/ValueObjectConstResult.cpp')
| -rw-r--r-- | source/Core/ValueObjectConstResult.cpp | 20 | 
1 files changed, 11 insertions, 9 deletions
diff --git a/source/Core/ValueObjectConstResult.cpp b/source/Core/ValueObjectConstResult.cpp index 1023696c35a7..f6e32c03b0eb 100644 --- a/source/Core/ValueObjectConstResult.cpp +++ b/source/Core/ValueObjectConstResult.cpp @@ -9,15 +9,15 @@  #include "lldb/Core/ValueObjectConstResult.h" -#include "lldb/Core/Scalar.h" // for Scalar  #include "lldb/Core/ValueObjectDynamicValue.h"  #include "lldb/Symbol/CompilerType.h"  #include "lldb/Target/ExecutionContext.h" -#include "lldb/Target/ExecutionContextScope.h" // for ExecutionContextScope +#include "lldb/Target/ExecutionContextScope.h"  #include "lldb/Target/Process.h" -#include "lldb/Utility/DataBuffer.h"     // for DataBuffer -#include "lldb/Utility/DataBufferHeap.h" // for DataBufferHeap +#include "lldb/Utility/DataBuffer.h" +#include "lldb/Utility/DataBufferHeap.h"  #include "lldb/Utility/DataExtractor.h" +#include "lldb/Utility/Scalar.h"  namespace lldb_private {  class Module; @@ -198,17 +198,19 @@ lldb::ValueType ValueObjectConstResult::GetValueType() const {  uint64_t ValueObjectConstResult::GetByteSize() {    ExecutionContext exe_ctx(GetExecutionContextRef()); - -  if (m_byte_size == 0) -    SetByteSize( -        GetCompilerType().GetByteSize(exe_ctx.GetBestExecutionContextScope())); +  if (m_byte_size == 0) { +    if (auto size = +        GetCompilerType().GetByteSize(exe_ctx.GetBestExecutionContextScope())) +      SetByteSize(*size); +  }    return m_byte_size;  }  void ValueObjectConstResult::SetByteSize(size_t size) { m_byte_size = size; }  size_t ValueObjectConstResult::CalculateNumChildren(uint32_t max) { -  auto children_count = GetCompilerType().GetNumChildren(true); +  ExecutionContext exe_ctx(GetExecutionContextRef()); +  auto children_count = GetCompilerType().GetNumChildren(true, &exe_ctx);    return children_count <= max ? children_count : max;  }  | 
