This is an archive of the discontinued LLVM Phabricator instance.

Terminate debugger if an assert was hit
ClosedPublic

Authored by xbolva00 on Sep 3 2018, 3:21 PM.

Diff Detail

Event Timeline

xbolva00 created this revision.Sep 3 2018, 3:21 PM
teemperor added a reviewer: Restricted Project.Sep 4 2018, 5:36 AM
JDevlieghere added inline comments.Sep 4 2018, 5:55 AM
source/Utility/LLDBAssert.cpp
21–22

I guess while we're at it we can turn this into an early return and use LLVM_LIKELY?

if (LLVM_LIKELY(expression))
    return;
xbolva00 added inline comments.Sep 4 2018, 6:10 AM
source/Utility/LLDBAssert.cpp
21–22

I thought about it also.. :) I will update the patch.

xbolva00 updated this revision to Diff 163818.Sep 4 2018, 7:45 AM
  • Use early return
xbolva00 marked 2 inline comments as done.Sep 4 2018, 7:54 AM
lemo added a subscriber: lemo.Sep 4 2018, 9:09 AM
lemo added inline comments.
source/Utility/LLDBAssert.cpp
31

abort() may be a better choice here (exit() path calls a lot of shutdown code and it's not safe in a number of cases)

Yes abort is better as exit will cause the global C++ destructor chain to be called. I was always thinking lldbassert() was aborting, but seeing as this is not the case this could cause problems if you enable it as it will be a change. Watch the buildbots carefully.

xbolva00 updated this revision to Diff 163852.Sep 4 2018, 9:37 AM
  • Use abort
This revision is now accepted and ready to land.Sep 4 2018, 10:19 AM
xbolva00 closed this revision.Sep 4 2018, 10:20 AM

Thanks for review, commited as rL341387

Thanks for review, commited as rL341387

If you include the text:

Differential Revision: https://reviews.llvm.org/D51604

It will automatically close this and put in a comment with the revision

Thanks for review, commited as rL341387

If you include the text:

Differential Revision: https://reviews.llvm.org/D51604

It will automatically close this and put in a comment with the revision

Ok, I hope it would be okay next time.