Signal-iOS/SignalServiceKit/DebuggerUtils/DebuggerUtils.h
Harry bb083ca39c
Fold SignalCoreKit into SignalServiceKit
Co-authored-by: Adam Sharp <sharplet@signal.org>
2024-06-26 08:44:41 -07:00

32 lines
513 B
Objective-C

//
// Copyright 2024 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
#import <Foundation/Foundation.h>
#ifdef DEBUG
NS_ASSUME_NONNULL_BEGIN
// Returns whether the debugger is attached to this process.
BOOL IsDebuggerAttached(void);
// If the debugger is attached, break (like a breakpoint). Otherwise, abort.
void TrapDebugger(void);
NS_ASSUME_NONNULL_END
#else // DEBUG
NS_INLINE BOOL IsDebuggerAttached(void)
{
return NO;
}
NS_INLINE void TrapDebugger(void)
{
}
#endif // DEBUG