[Lldb-commits] [PATCH] D18646: Fix DWO breakage in r264909

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 31 09:33:40 PDT 2016


clayborg added a comment.

See inlined comment for a follow up fix.


================
Comment at: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp:136
@@ +135,3 @@
+{
+    assert(m_base_dwarf_cu->GetOffset() == die_ref.cu_offset);
+    return DebugInfo()->GetDIEForDIEOffset(die_ref.die_offset);
----------------
I would prefer to not use an assertion here, we can't crash if things go south for some reason. Can we change this to something like:

```
lldbassert(m_base_dwarf_cu->GetOffset() == die_ref.cu_offset);
if (m_base_dwarf_cu->GetOffset() == die_ref.cu_offset)
    return DebugInfo()->GetDIEForDIEOffset(die_ref.die_offset);
else
    return DWARFDIE();
```

The lldbassert will be in debug builds but not release builds so it can fire during testing, but won't crash a release build. assert() is dangerous as it is us to the builders to ensure DEBUG or NDEBUG is defined and if the assert is left in it can crash your lldb, IDE, or any program directly loading LLDB which isn't acceptable.


Repository:
  rL LLVM

http://reviews.llvm.org/D18646





More information about the lldb-commits mailing list