This is an archive of the discontinued LLVM Phabricator instance.

[libc++abi] Add a silent terminate handler to libcxxabi.
ClosedPublic

Authored by trybka on Jan 9 2017, 3:42 PM.

Details

Summary

The current std::terminate_handler pulls in some string code, some I/O
code, and more. Since it is automatically setup as the default, this means that
any trivial binary linking against libcxxabi will get this extra bloat.

On Android, debuggerd seems to actually handle unwinding and demangling, so
this code is unnecessary in certain cases. We would just like a way to turn it
off.

Diff Detail

Repository
rL LLVM

Event Timeline

trybka updated this revision to Diff 83725.Jan 9 2017, 3:42 PM
trybka retitled this revision from to [libc++abi] Add a silent terminate handler to libcxxabi..
trybka updated this object.
trybka added a reviewer: EricWF.
trybka added a subscriber: llvm-commits.

debuggerd will give you a stack trace, but it won't give you the exception information.

My plan for making this a bit leaner was to make a non-demangling version (but one that still handled the exception stuff). iirc the demangler is by far the heaviest part of this, and that part people can definitely get by without.

I talked this over with trybka on IM. There's precedent for a silent mode in libstdc++, and for his use case the debuggerd issues aren't actually a problem, so I think this is fine to go in. I'd also like a non-demangling version for the more generic Android case, but that doesn't need to be a part of this patch.

I'll defer to @EricWF to actually sign off, but this LGTM.

EricWF accepted this revision.Jan 12 2017, 1:01 PM
EricWF edited edge metadata.
This revision is now accepted and ready to land.Jan 12 2017, 1:01 PM
This revision was automatically updated to reflect the committed changes.