[Lldb-commits] [lldb] r149167 - /lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Greg Clayton gclayton at apple.com
Fri Jan 27 18:22:27 PST 2012


Author: gclayton
Date: Fri Jan 27 20:22:27 2012
New Revision: 149167

URL: http://llvm.org/viewvc/llvm-project?rev=149167&view=rev
Log:
Added logging so we can see the field names and offsets of any structures 
for when we enable the assisted layout.


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=149167&r1=149166&r2=149167&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri Jan 27 20:22:27 2012
@@ -1922,15 +1922,25 @@
                     const clang::RecordDecl *record_decl = record_type->getDecl();
                     
                     if (log)
+                    {
                         GetObjectFile()->GetModule()->LogMessage (log.get(), 
-                                                                  "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) record_decl = %p, bit_size = %llu, alignment = %llu, field_offsets[%u],base_offsets[0], vbase_offsets[0])",
+                                                                  "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) caching layout info for record_decl = %p, bit_size = %llu, alignment = %llu, field_offsets[%u], base_offsets[0], vbase_offsets[0])",
                                                                   clang_type,
                                                                   record_decl,
                                                                   layout_info.bit_size,
                                                                   layout_info.alignment,
                                                                   (uint32_t)layout_info.field_offsets.size());
                     
-
+                        llvm::DenseMap <const clang::FieldDecl *, uint64_t>::const_iterator pos, end = layout_info.field_offsets.end();
+                        for (pos = layout_info.field_offsets.begin(); pos != end; ++pos)
+                        {
+                            GetObjectFile()->GetModule()->LogMessage (log.get(), 
+                                                                      "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) field = { bit_offset=%u, name='%s' }",
+                                                                      clang_type,
+                                                                      (uint32_t)pos->second,
+                                                                      pos->first->getNameAsString().c_str());
+                        }
+                    }
                     m_record_decl_to_layout_map.insert(std::make_pair(record_decl, layout_info));
                 }
             }





More information about the lldb-commits mailing list