summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp16
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h1
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp4
3 files changed, 16 insertions, 5 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 603d824f315..bb10ed7a309 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -2385,7 +2385,9 @@ SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (lldb::clang_type_t clang_type
if (die->HasChildren())
{
SymbolContext sc(GetCompUnitForDWARFCompUnit(dwarf_cu));
- ParseChildEnumerators(sc, clang_type, type->GetByteSize(), dwarf_cu, die);
+ bool is_signed = false;
+ ast.IsIntegerType(clang_type, is_signed);
+ ParseChildEnumerators(sc, clang_type, is_signed, type->GetByteSize(), dwarf_cu, die);
}
ast.CompleteTagDeclarationDefinition (clang_type);
return clang_type;
@@ -4051,7 +4053,8 @@ size_t
SymbolFileDWARF::ParseChildEnumerators
(
const SymbolContext& sc,
- clang_type_t enumerator_clang_type,
+ clang_type_t enumerator_clang_type,
+ bool is_signed,
uint32_t enumerator_byte_size,
DWARFCompileUnit* dwarf_cu,
const DWARFDebugInfoEntry *parent_die
@@ -4089,7 +4092,10 @@ SymbolFileDWARF::ParseChildEnumerators
{
case DW_AT_const_value:
got_value = true;
- enum_value = form_value.Unsigned();
+ if (is_signed)
+ enum_value = form_value.Signed();
+ else
+ enum_value = form_value.Unsigned();
break;
case DW_AT_name:
@@ -6074,7 +6080,9 @@ SymbolFileDWARF::ParseType (const SymbolContext& sc, DWARFCompileUnit* dwarf_cu,
if (die->HasChildren())
{
SymbolContext cu_sc(GetCompUnitForDWARFCompUnit(dwarf_cu));
- ParseChildEnumerators(cu_sc, clang_type, type_sp->GetByteSize(), dwarf_cu, die);
+ bool is_signed = false;
+ ast.IsIntegerType(clang_type, is_signed);
+ ParseChildEnumerators(cu_sc, clang_type, is_signed, type_sp->GetByteSize(), dwarf_cu, die);
}
ast.CompleteTagDeclarationDefinition (clang_type);
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index 31fb4cc3b3f..f4703e8e147 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -368,6 +368,7 @@ protected:
size_t ParseChildEnumerators(
const lldb_private::SymbolContext& sc,
lldb::clang_type_t enumerator_qual_type,
+ bool is_signed,
uint32_t enumerator_byte_size,
DWARFCompileUnit* dwarf_cu,
const DWARFDebugInfoEntry *enum_die);
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 71e183c059d..1853c30d7ff 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -5502,6 +5502,8 @@ ClangASTContext::AddEnumerationValueToEnumerationType
assert (identifier_table != NULL);
QualType enum_qual_type (QualType::getFromOpaquePtr(enum_clang_type));
+ bool is_signed = false;
+ IsIntegerType (enumerator_clang_type, is_signed);
const clang::Type *clang_type = enum_qual_type.getTypePtr();
if (clang_type)
{
@@ -5509,7 +5511,7 @@ ClangASTContext::AddEnumerationValueToEnumerationType
if (enum_type)
{
- llvm::APSInt enum_llvm_apsint(enum_value_bit_size, false);
+ llvm::APSInt enum_llvm_apsint(enum_value_bit_size, is_signed);
enum_llvm_apsint = enum_value;
EnumConstantDecl *enumerator_decl =
EnumConstantDecl::Create (*ast,
OpenPOWER on IntegriCloud