[Lldb-commits] [lldb] r145471 - /lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Greg Clayton
gclayton at apple.com
Tue Nov 29 18:48:29 PST 2011
Author: gclayton
Date: Tue Nov 29 20:48:28 2011
New Revision: 145471
URL: http://llvm.org/viewvc/llvm-project?rev=145471&view=rev
Log:
Add a work around to deal with incorrect forward class definitions in
objective C DWARF emitted by clang.
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=145471&r1=145470&r2=145471&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Nov 29 20:48:28 2011
@@ -4156,6 +4156,24 @@
tag_decl_kind = clang::TTK_Class;
default_accessibility = eAccessPrivate;
}
+
+ if (byte_size_valid && byte_size == 0 && type_name_cstr &&
+ die->HasChildren() == false &&
+ sc.comp_unit->GetLanguage() == eLanguageTypeObjC)
+ {
+ // Work around an issue with clang at the moment where
+ // forward declarations for objective C classes are emitted
+ // as:
+ // DW_TAG_structure_type [2]
+ // DW_AT_name( "ForwardObjcClass" )
+ // DW_AT_byte_size( 0x00 )
+ // DW_AT_decl_file( "..." )
+ // DW_AT_decl_line( 1 )
+ //
+ // Note that there is no DW_AT_declaration and there are
+ // no children, and the byte size is zero.
+ is_forward_declaration = true;
+ }
bool look_for_complete_objc_type = false;
if (class_language == eLanguageTypeObjC)
More information about the lldb-commits
mailing list