forked from jerrykrinock/ClassesObjC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSSYDebug.h
59 lines (47 loc) · 2.01 KB
/
SSYDebug.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#import <Cocoa/Cocoa.h>
#define SSY_DEBUG_INCLUDED 1
extern id ssyDebugGlobalObject ;
/*!
@brief Define a trace-level debugging macro
@param object An object whose description you want printed
*/
#if 0
#warning Compiling with SSYTRACE macros activated to make NSLogs
#define MIRSKY 1
#define SSYTRACE(identifier,object) { NSString* objectDesc = object ? [NSString stringWithFormat:@" %@", [(id)object shortDescription]] : @"" ; NSLog(@"SSYTrace: %06d (%@)%@", identifier, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] stringByDeletingPathExtension], objectDesc) ; }
#else
#define SSYTRACE(identifier,object)
#endif
/*!
@brief Returns a string containing the complete current backtrace,
beginning with the caller of this function, prefixed by a table of
useful library load addresses (slides).
@details This is the most verbose function in this file, the
one whose output you'll want to include in your error reports.
Slides for system libraries, those in directories
/usr/lib/ or /System/Library, are not included in the table
of slides because they are useless and noise up the result with
many lines of useless text.
*/
NSString* SSYDebugBacktrace(void) ;
/*!
@brief Returns a string containing the current backtrace, to a
given depth.
@param depth Determines what this function will return, per this table…
depth This function will return
----- -------------------------
0 nil
1 1 line of text, containing the caller of the function that called this function
2 2 lines of text, as in (1), plus another line consisting of the caller of the caller
… …
Note that this function never returns the caller of this function, since you
should already know that or can get it by __PRETTY_FUNCTION__.
*/
NSString* SSYDebugBacktraceDepth(int depth) ;
/*!
@brief Returns a string consisting of the symbol name of the
caller of the function that called it.
*/
NSString* SSYDebugCaller(void) ;
void SSYDebugLogBacktrace(void) ;
NSInteger SSYDebugStackDepth(void) ;