From de5417f81d4e0ca732810e3b5565253b73b9e339 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Tue, 5 Nov 2019 11:09:27 -0800 Subject: [PATCH] [ValueObject] Upstream initialization from swift-lldb. This is a non-Swift-specific change in swift-lldb that seems to be useful for remote debugging. If does in fact turn out to be redundant we can remove it from llvm.org and then it will disappear in swift-lldb, too. --- lldb/source/Core/ValueObject.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 7b4034c..ecb5a41 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -100,6 +100,8 @@ ValueObject::ValueObject(ValueObject &parent) m_did_calculate_complete_objc_class_type(false), m_is_synthetic_children_generated( parent.m_is_synthetic_children_generated) { + m_data.SetByteOrder(parent.GetDataExtractor().GetByteOrder()); + m_data.SetAddressByteSize(parent.GetDataExtractor().GetAddressByteSize()); m_manager->ManageObject(this); } @@ -126,6 +128,14 @@ ValueObject::ValueObject(ExecutionContextScope *exe_scope, m_is_getting_summary(false), m_did_calculate_complete_objc_class_type(false), m_is_synthetic_children_generated(false) { + if (exe_scope) { + TargetSP target_sp(exe_scope->CalculateTarget()); + if (target_sp) { + const ArchSpec &arch = target_sp->GetArchitecture(); + m_data.SetByteOrder(arch.GetByteOrder()); + m_data.SetAddressByteSize(arch.GetAddressByteSize()); + } + } m_manager = new ValueObjectManager(); m_manager->ManageObject(this); } -- 2.7.4