[llvm-commits] [llvm] r109586 - in /llvm/trunk: include/llvm/Support/CrashRecoveryContext.h lib/Support/CrashRecoveryContext.cpp
Daniel Dunbar
daniel at zuster.org
Wed Jul 28 13:19:54 PDT 2010
On Wed, Jul 28, 2010 at 9:12 AM, Chris Lattner <clattner at apple.com> wrote:
>
> On Jul 28, 2010, at 8:40 AM, Daniel Dunbar wrote:
>
>> Author: ddunbar
>> Date: Wed Jul 28 10:40:20 2010
>> New Revision: 109586
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=109586&view=rev
>> Log:
>> Support: Add CrashRecoveryContext helper object.
>> - Designed as a simple wrapper to allow clients to attempt to catch crashes
>> (memory errors, assertion violations, etc.) and do some kind of recovery.
>>
>> - Currently doesn't actually attempt to catch crashes.
>
> Looks like a nice interface.
I hope so -- assuming it has more than 0 working implementations. :)
>> + /// \return True if the function completed successfully, and false if the
>> + /// function crashed (or HandleCrash was called explicitly). Clients should
>> + /// make as little assumptions as possible about the program state when
>> + /// RunSafely has returned false. Clients can use getBacktrace() to retrieve
>> + /// the backtrace of the crash on failures.
>> + bool RunSafely(void (*Fn)(void*), void *UserData);
>
> It would be nice to add an #ifdef __BLOCKS__ version of this that took a block to execute.
Yeah, this occurred to me as well. I'll try to get around to it.
- Daniel
> -Chris
>
>
More information about the llvm-commits
mailing list