@@ -20,14 +20,14 @@ #endif OF_ASSUME_NONNULL_BEGIN @class OFArray OF_GENERIC(ObjectType); -@class OFMutableArray OF_GENERIC(ObjectType); @class OFString; +@class OFValue; -#define OFBacktraceSize 16 +#define OFStackTraceSize 16 #if defined(OF_WINDOWS) && defined(OF_HAVE_SOCKETS) # ifndef EADDRINUSE # define EADDRINUSE WSAEADDRINUSE # endif @@ -147,11 +147,11 @@ * The OFException class is the base class for all exceptions in ObjFW, except * the OFAllocFailedException. */ @interface OFException: OFObject { - void *_backtrace[OFBacktraceSize]; + void *_stackTrace[OFStackTraceSize]; OF_RESERVE_IVARS(OFException, 4) } /** * @brief Creates a new, autoreleased exception. @@ -166,16 +166,25 @@ * @return A description of the exception */ - (OFString *)description; /** - * @brief Returns a backtrace of when the exception was created or nil if no - * backtrace is available. + * @brief Returns a stack trace of when the exception was created or `nil` if + * no stack trace is available. The returned array contains OFValues + * with @ref OFValue#pointerValue set to the address. + * + * @return The stack trace as array of addresses + */ +- (nullable OFArray OF_GENERIC(OFValue *) *)stackTraceAddresses; + +/** + * @brief Returns a stack trace of when the exception was created or `nil` if + * no stack trace symbols are available. * - * @return A backtrace of when the exception was created + * @return The stack trace as array of symbols */ -- (nullable OFArray OF_GENERIC(OFString *) *)backtrace; +- (nullable OFArray OF_GENERIC(OFString *) *)stackTraceSymbols; @end #ifdef __cplusplus extern "C" { #endif