[Lldb-commits] [PATCH] D75493: [lldb] Remove some #ifdef LLDB_CONFIGURATION_DEBUG around asserts

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 6 11:36:57 PST 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG3b2c4e7178c3: [lldb] Remove some #ifdef LLDB_CONFIGURATION_DEBUG around asserts (authored by teemperor).

Changed prior to commit:
  https://reviews.llvm.org/D75493?vs=247761&id=248800#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75493/new/

https://reviews.llvm.org/D75493

Files:
  lldb/source/Core/Section.cpp
  lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
  lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h


Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
===================================================================
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
@@ -88,9 +88,7 @@
   void SetAllRegisterValid(bool b);
 
   bool GetRegisterIsValid(uint32_t reg) const {
-#if defined(LLDB_CONFIGURATION_DEBUG)
     assert(reg < m_reg_valid.size());
-#endif
     if (reg < m_reg_valid.size())
       return m_reg_valid[reg];
     return false;
@@ -103,9 +101,7 @@
   }
 
   void SetRegisterIsValid(uint32_t reg, bool valid) {
-#if defined(LLDB_CONFIGURATION_DEBUG)
     assert(reg < m_reg_valid.size());
-#endif
     if (reg < m_reg_valid.size())
       m_reg_valid[reg] = valid;
   }
Index: lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
===================================================================
--- lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
+++ lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
@@ -77,11 +77,9 @@
   }
 
   std::lock_guard<std::recursive_mutex> guard(m_sequence_mutex);
-#ifdef LLDB_CONFIGURATION_DEBUG
   // NOTE: this only works for packets that are in native endian byte order
   assert(request_packet.GetSize() ==
          *((const uint16_t *)(request_packet.GetData() + 2)));
-#endif
   lldb::offset_t offset = 1;
   const uint32_t num_retries = 3;
   for (uint32_t i = 0; i < num_retries; ++i) {
Index: lldb/source/Core/Section.cpp
===================================================================
--- lldb/source/Core/Section.cpp
+++ lldb/source/Core/Section.cpp
@@ -267,11 +267,8 @@
   so_addr.SetOffset(offset);
   so_addr.SetSection(const_cast<Section *>(this)->shared_from_this());
 
-#ifdef LLDB_CONFIGURATION_DEBUG
-  // For debug builds, ensure that there are no orphaned (i.e., moduleless)
-  // sections.
+  // Ensure that there are no orphaned (i.e., moduleless) sections.
   assert(GetModule().get());
-#endif
   return true;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75493.248800.patch
Type: text/x-patch
Size: 2046 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200306/f1ca56b5/attachment.bin>


More information about the lldb-commits mailing list