summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Core/ValueObjectVariable.cpp13
-rw-r--r--lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp6
2 files changed, 15 insertions, 4 deletions
diff --git a/lldb/source/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp
index 2f017aa36f7..229cdd8bacd 100644
--- a/lldb/source/Core/ValueObjectVariable.cpp
+++ b/lldb/source/Core/ValueObjectVariable.cpp
@@ -66,9 +66,16 @@ ValueObjectVariable::~ValueObjectVariable() {}
CompilerType ValueObjectVariable::GetCompilerTypeImpl() {
Type *var_type = m_variable_sp->GetType();
- if (var_type)
- return var_type->GetForwardCompilerType();
- return CompilerType();
+ if (!var_type)
+ return CompilerType();
+
+ // It's important to return the layout type here. If we have an enum then the
+ // symbol file plugin may have decided to complete it lazily, in which case a
+ // forward type won't be sufficient to display the variable. On the other
+ // hand, if we have a pointer to a class type, then getting the full type will
+ // resolve the class type, which is too much. The layout type is both
+ // necessary and sufficient.
+ return var_type->GetLayoutCompilerType();
}
ConstString ValueObjectVariable::GetTypeName() {
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index 40637574e4b..78d03e27d8f 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -710,7 +710,10 @@ void ObjectFilePECOFF::CreateSections(SectionList &unified_section_list) {
llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA &&
((const_sect_name == g_data_sect_name) ||
(const_sect_name == g_DATA_sect_name))) {
- section_type = eSectionTypeData;
+ if (m_sect_headers[idx].size == 0 && m_sect_headers[idx].offset == 0)
+ section_type = eSectionTypeZeroFill;
+ else
+ section_type = eSectionTypeData;
} else if (m_sect_headers[idx].flags &
llvm::COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA &&
((const_sect_name == g_bss_sect_name) ||
@@ -1053,6 +1056,7 @@ ObjectFile::Type ObjectFilePECOFF::CalculateType() {
}
ObjectFile::Strata ObjectFilePECOFF::CalculateStrata() { return eStrataUser; }
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
OpenPOWER on IntegriCloud