mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
Fix bug in PE/COFF plugin and ValueObjectVariable.
There are two bugs here. The first is that MSVC and clang-cl emit their bss section under the name '.data' instead of '.bss' but with the size and file offset set to 0. ObjectFilePECOFF didn't handle this, and would only recognize a section as bss if it was actually called '.bss'. The effect of this is that if we tried to print the value of a variable that lived in BSS we would fail. The second bug is that ValueObjectVariable was only returning the forward type, which is insufficient to print the value of an enum. So we bump this up to the layout type. Differential Revision: https://reviews.llvm.org/D54241 llvm-svn: 346430
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user