[Lldb-commits] [lldb] r188124 - Fixed a case where GCC was emitting a DW_TAG_class_type that has a DW_AT_declaration set to true, yet the class actually contains a definition for the class in that DIE.
Greg Clayton
gclayton at apple.com
Fri Aug 9 17:09:36 PDT 2013
Author: gclayton
Date: Fri Aug 9 19:09:35 2013
New Revision: 188124
URL: http://llvm.org/viewvc/llvm-project?rev=188124&view=rev
Log:
Fixed a case where GCC was emitting a DW_TAG_class_type that has a DW_AT_declaration set to true, yet the class actually contains a definition for the class in that DIE.
Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=188124&r1=188123&r2=188124&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Aug 9 19:09:35 2013
@@ -6193,6 +6193,30 @@ SymbolFileDWARF::ParseType (const Symbol
GetUniqueDWARFASTTypeMap().Insert (type_name_const_str,
unique_ast_entry);
+ if (is_forward_declaration && die->HasChildren())
+ {
+ // Check to see if the DIE actually has a definition, some version of GCC will
+ // emit DIEs with DW_AT_declaration set to true, but yet still have subprogram,
+ // members, or inheritance, so we can't trust it
+ const DWARFDebugInfoEntry *child_die = die->GetFirstChild();
+ while (child_die)
+ {
+ switch (child_die->Tag())
+ {
+ case DW_TAG_inheritance:
+ case DW_TAG_subprogram:
+ case DW_TAG_member:
+ case DW_TAG_APPLE_property:
+ child_die = NULL;
+ is_forward_declaration = false;
+ break;
+ default:
+ child_die = child_die->GetSibling();
+ break;
+ }
+ }
+ }
+
if (!is_forward_declaration)
{
// Always start the definition for a class type so that
More information about the lldb-commits
mailing list