[lldb-dev] using of asserts in lldb

jingham at apple.com jingham at apple.com
Thu May 7 10:00:03 PDT 2015


Just to  amplify.  LLDB is a library, used in various tools.  Moreover, in cases like Xcode, there may be multiple debug sessions running, and it is really unfortunate if an error in one destroys all the other sessions.  So lldb should never assert in release builds unless there really is no way to tear things down in a reasonable fashion.  It would be better to detach and null out the current process than do that, since it will still leave the other Debuggers alive.

I think Greg is also strongly opposed to asserts in header files.

Jim


> On May 7, 2015, at 9:08 AM, Enrico Granata <egranata at apple.com> wrote:
> 
> I don't think there is an explicit policy.
> But I would personally encourage you to look in LLDBAssert.h and consider using the lldbassert() macro defined there
> In debug builds it behaves like a normal assert
> But in release builds it dumps a scary assert()-style message with backtrace, but then does not crash. This is helpful because we'd rather much avoid tearing down debug sessions. Of course, you may still end up crashing even if the assert() does not tear us down, but it's at least worth a shot at "ask for bug reports then continue"
> 
> Sent from my iPhone
> 
>> On May 6, 2015, at 11:45 PM, Ilia K <ki.stfu at gmail.com> wrote:
>> 
>> Hello,
>> 
>> What is our policy about asserts?
>> 
>> Thanks,
>> Ilia
>> _______________________________________________
>> lldb-dev mailing list
>> lldb-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev





More information about the lldb-dev mailing list