|
18 | 18 | #include "Plugins/ExpressionParser/Clang/ClangUtil.h"
|
19 | 19 | #include "Plugins/TypeSystem/Clang/TypeSystemClang.h"
|
20 | 20 | #include "Plugins/TypeSystem/Swift/SwiftDemangle.h"
|
| 21 | +#include "lldb/Core/ValueObjectMemory.h" |
21 | 22 | #include "lldb/Symbol/Variable.h"
|
22 | 23 | #include "lldb/Symbol/VariableList.h"
|
23 | 24 | #include "lldb/Target/ProcessStructReader.h"
|
@@ -2043,23 +2044,9 @@ bool SwiftLanguageRuntimeImpl::GetDynamicTypeAndAddress_IndirectEnumCase(
|
2043 | 2044 | address.SetRawAddress(old_box_value);
|
2044 | 2045 | return true;
|
2045 | 2046 | } else if (type_info.AllSet(eTypeIsSwift | eTypeIsProtocol)) {
|
2046 |
| - SwiftASTContext::ProtocolInfo protocol_info; |
2047 |
| - if (!SwiftASTContext::GetProtocolTypeInfo(payload_type, protocol_info)) |
2048 |
| - return false; |
2049 |
| - auto ptr_size = m_process.GetAddressByteSize(); |
2050 |
| - std::vector<uint8_t> buffer(ptr_size * protocol_info.m_num_storage_words, |
2051 |
| - 0); |
2052 |
| - for (uint32_t idx = 0; idx < protocol_info.m_num_storage_words; idx++) { |
2053 |
| - lldb::addr_t word = m_process.ReadUnsignedIntegerFromMemory( |
2054 |
| - box_value + idx * ptr_size, ptr_size, 0, error); |
2055 |
| - if (error.Fail()) |
2056 |
| - return false; |
2057 |
| - memcpy(&buffer[idx * ptr_size], &word, ptr_size); |
2058 |
| - } |
2059 |
| - DataExtractor data(&buffer[0], buffer.size(), m_process.GetByteOrder(), |
2060 |
| - m_process.GetAddressByteSize()); |
2061 |
| - ValueObjectSP valobj_sp(ValueObject::CreateValueObjectFromData( |
2062 |
| - "_", data, m_process, payload_type)); |
| 2047 | + ExecutionContext exe_ctx = in_value.GetExecutionContextRef(); |
| 2048 | + ValueObjectSP valobj_sp = ValueObjectMemory::Create( |
| 2049 | + exe_ctx.GetBestExecutionContextScope(), "_", box_value, payload_type); |
2063 | 2050 | if (!valobj_sp)
|
2064 | 2051 | return false;
|
2065 | 2052 |
|
|
0 commit comments