[Lldb-commits] [lldb] r203692 - If DWARF debug info and verbose mode is enabled ("log enable dwarf info verbose"), then dump all DIEs for a compile unit after all DIEs have been parsed for a compile unit.

Greg Clayton gclayton at apple.com
Wed Mar 12 11:26:19 PDT 2014


Author: gclayton
Date: Wed Mar 12 13:26:18 2014
New Revision: 203692

URL: http://llvm.org/viewvc/llvm-project?rev=203692&view=rev
Log:
If DWARF debug info and verbose mode is enabled ("log enable dwarf info verbose"), then dump all DIEs for a compile unit after all DIEs have been parsed for a compile unit.


Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp?rev=203692&r1=203691&r2=203692&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp Wed Mar 12 13:26:18 2014
@@ -265,12 +265,16 @@ DWARFCompileUnit::ExtractDIEsIfNeeded (b
         DWARFDebugInfoEntry::collection exact_size_die_array (m_die_array.begin(), m_die_array.end());
         exact_size_die_array.swap (m_die_array);
     }
-    Log *log (LogChannelDWARF::GetLogIfAll (DWARF_LOG_DEBUG_INFO | DWARF_LOG_VERBOSE));
-    if (log)
+    Log *verbose_log (LogChannelDWARF::GetLogIfAll (DWARF_LOG_DEBUG_INFO | DWARF_LOG_VERBOSE));
+    if (verbose_log)
     {
         StreamString strm;
-        DWARFDebugInfoEntry::DumpDIECollection (strm, m_die_array);
-        log->PutCString (strm.GetString().c_str());
+        Dump(&strm);
+        if (m_die_array.empty())
+            strm.Printf("error: no DIE for compile unit");
+        else
+            m_die_array[0].Dump(m_dwarf2Data, this, strm, UINT32_MAX);        
+        verbose_log->PutCString (strm.GetString().c_str());
     }
 
     return m_die_array.size();





More information about the lldb-commits mailing list