[Lldb-commits] [lldb] r356469 - Remove a couple of log statements.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 19 09:26:09 PDT 2019


Author: zturner
Date: Tue Mar 19 09:26:08 2019
New Revision: 356469

URL: http://llvm.org/viewvc/llvm-project?rev=356469&view=rev
Log:
Remove a couple of log statements.

These log statements have questionable value, and hinder the effort
of separating the high and low level DWARF parsing interfaces inside
of LLDB.  Removing them for now, and if/when we need such log statements
again in the future, we can add them back (if possible) or introduce a
mechanism for logging from the low-level interface in such a way that it
isn't coupled to the high level interface.

Differential Revision: https://reviews.llvm.org/D59498

Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp?rev=356469&r1=356468&r2=356469&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp Tue Mar 19 09:26:08 2019
@@ -13,13 +13,11 @@
 
 #include <algorithm>
 
-#include "lldb/Utility/Log.h"
 #include "lldb/Utility/Stream.h"
 #include "lldb/Utility/Timer.h"
 
 #include "DWARFUnit.h"
 #include "DWARFDebugInfo.h"
-#include "LogChannelDWARF.h"
 #include "SymbolFileDWARF.h"
 
 using namespace lldb;
@@ -118,30 +116,8 @@ void DWARFDebugAranges::Sort(bool minimi
   Timer scoped_timer(func_cat, "%s this = %p", LLVM_PRETTY_FUNCTION,
                      static_cast<void *>(this));
 
-  Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_ARANGES));
-  size_t orig_arange_size = 0;
-  if (log) {
-    orig_arange_size = m_aranges.GetSize();
-    log->Printf("DWARFDebugAranges::Sort(minimize = %u) with %" PRIu64
-                " entries",
-                minimize, (uint64_t)orig_arange_size);
-  }
-
   m_aranges.Sort();
   m_aranges.CombineConsecutiveEntriesWithEqualData();
-
-  if (log) {
-    if (minimize) {
-      const size_t new_arange_size = m_aranges.GetSize();
-      const size_t delta = orig_arange_size - new_arange_size;
-      log->Printf("DWARFDebugAranges::Sort() %" PRIu64
-                  " entries after minimizing (%" PRIu64
-                  " entries combined for %" PRIu64 " bytes saved)",
-                  (uint64_t)new_arange_size, (uint64_t)delta,
-                  (uint64_t)delta * sizeof(Range));
-    }
-    Dump(log);
-  }
 }
 
 //----------------------------------------------------------------------

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp?rev=356469&r1=356468&r2=356469&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp Tue Mar 19 09:26:08 2019
@@ -22,7 +22,6 @@
 #include "DWARFDebugInfo.h"
 #include "DWARFDebugInfoEntry.h"
 #include "DWARFFormValue.h"
-#include "LogChannelDWARF.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -48,17 +47,10 @@ llvm::Expected<DWARFDebugAranges &> DWAR
 
   assert(m_dwarf2Data);
 
-  Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_ARANGES));
-
   m_cu_aranges_up = llvm::make_unique<DWARFDebugAranges>();
   const DWARFDataExtractor &debug_aranges_data =
       m_dwarf2Data->get_debug_aranges_data();
   if (debug_aranges_data.GetByteSize() > 0) {
-    if (log)
-      log->Printf(
-          "DWARFDebugInfo::GetCompileUnitAranges() for \"%s\" from "
-          ".debug_aranges",
-          m_dwarf2Data->GetObjectFile()->GetFileSpec().GetPath().c_str());
     llvm::Error error = m_cu_aranges_up->extract(debug_aranges_data);
     if (error)
       return std::move(error);
@@ -74,22 +66,13 @@ llvm::Expected<DWARFDebugAranges &> DWAR
 
   // Manually build arange data for everything that wasn't in the
   // .debug_aranges table.
-  bool printed = false;
   const size_t num_compile_units = GetNumCompileUnits();
   for (size_t idx = 0; idx < num_compile_units; ++idx) {
     DWARFUnit *cu = GetCompileUnitAtIndex(idx);
 
     dw_offset_t offset = cu->GetOffset();
-    if (cus_with_data.find(offset) == cus_with_data.end()) {
-      if (log) {
-        if (!printed)
-          log->Printf(
-              "DWARFDebugInfo::GetCompileUnitAranges() for \"%s\" by parsing",
-              m_dwarf2Data->GetObjectFile()->GetFileSpec().GetPath().c_str());
-        printed = true;
-      }
+    if (cus_with_data.find(offset) == cus_with_data.end())
       cu->BuildAddressRangeTable(m_dwarf2Data, m_cu_aranges_up.get());
-    }
   }
 
   const bool minimize = true;

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp?rev=356469&r1=356468&r2=356469&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp Tue Mar 19 09:26:08 2019
@@ -165,15 +165,6 @@ void DWARFUnit::ExtractDIEsRWLocked() {
 
   DWARFDebugInfoEntry die;
   // Keep a flat array of the DIE for binary lookup by DIE offset
-  Log *log(
-      LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO | DWARF_LOG_LOOKUPS));
-  if (log) {
-    m_dwarf->GetObjectFile()->GetModule()->LogMessageVerboseBacktrace(
-        log,
-        "DWARFUnit::ExtractDIEsIfNeeded () for compile unit at "
-        ".debug_info[0x%8.8x]",
-        GetOffset());
-  }
 
   uint32_t depth = 0;
   // We are in our compile unit, parse starting at the offset we were told to
@@ -834,15 +825,6 @@ dw_offset_t DWARFUnit::GetBaseObjOffset(
 const DWARFDebugAranges &DWARFUnit::GetFunctionAranges() {
   if (m_func_aranges_up == NULL) {
     m_func_aranges_up.reset(new DWARFDebugAranges());
-    Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_ARANGES));
-
-    if (log) {
-      m_dwarf->GetObjectFile()->GetModule()->LogMessage(
-          log,
-          "DWARFUnit::GetFunctionAranges() for compile unit at "
-          ".debug_info[0x%8.8x]",
-          GetOffset());
-    }
     const DWARFDebugInfoEntry *die = DIEPtr();
     if (die)
       die->BuildFunctionAddressRangeTable(m_dwarf, this,




More information about the lldb-commits mailing list