[Lldb-commits] [PATCH] D18646: Fix DWO breakage in r264909
Jim Ingham via lldb-commits
lldb-commits at lists.llvm.org
Thu Mar 31 11:06:47 PDT 2016
jingham added a subscriber: jingham.
jingham added a comment.
I don't agree that asserts are good in released code unless you have no way of backing out of the situation you find yourself in. After all, you are saying to some unlucky user out there that they can't use the debugger on their app and in general there's nothing they can do about it. Greg's suggestion is for this low-level API to say "I couldn't find this DIE" and then if that's something higher layers can work around - by saying "Yeah I couldn't find that type" then you've allowed the user to continue their debug session instead of stopping them cold.
Not asserting prematurely is particularly important for handling debug information; since we don't control the compiler we need to handle as much junk information as gracefully as possible.
Also, asserts, especially for debug information, don't tend to be very helpful in the field. You get a crash trace which really doesn't tell you the important stuff - what debug file was this, what DIE was bad, etc... And given the nature of life, this error is going to occur for a user who can't give you their project to repro the bug and can't reduce it to a smaller test case. Logs are pretty much all you have to go on. So an un-annotated assert like this is not a good idea.
So orthogonal to the assert issue, if you find something not copacetic in the debug information, you should log out as much local information as you can regardless of what you are going to do with the error.
More information about the lldb-commits