tberghammer added a comment.

This assert is NOT verifying the debug info itself. It is verifying that LLDB 
asked the right SymbolFileDWARFDwo to find a DIE based on a DIERef. 
Independently of the debug info (what can be garbage) passed in to LLDB this 
assert should never fire if LLDB has no major bug in the DWO handling logic.

Considering that we have ~10k assert in LLVM, ~6k assert in clang and ~1k 
assert in LLDB you should compile your release binary without asserts if you 
want to avoid some crash what is caused by them.

In this concrete case if we return an empty DWARFDIE from this function then 
the caller of the function will crash (with a SEGV) as it is not prepared to 
handle the case when no DWARFDIE can be found based on a DIERef as it should 
never happen if LLDB works correctly (independently of the debug info).

I think the very high level question we are discussing is what should LLDB do 
when it notices that it has a bug in itself. In terms of a compiler displaying 
an "internal compiler error" and the exiting/crashing is definitely the good 
solution (to avoid miss compilation) but what is the expected behavior for an 
interactive application. If you want to be protected against every possible 
issue then we should remove all assert from LLDB, convince the LLVM and clang 
guys to do the same and protect every pointer deference with a null check just 
in case some of the previous function calls returned NULL. I don't think this 
is the approach we are wanting to go down as it will add a lot of overhead to 
LLDB and make a lot of bug silent what is very problematic in case of a 
debugger where displaying incorrect information is almost as bad as crashing 
the IDE.

PS: Pavel changed the assert to an lldb_assert in the meantime.


Repository:
  rL LLVM

http://reviews.llvm.org/D18646



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to