Skip to content

Commit 5d27fe8

Browse files
authored
Made public a method to create a stack frame from address. (#6329)
* Made public a method to create a stack frame from address. * Update CHANGELOG.md * Update CHANGELOG.md * Made public a method to create a stack frame from address.
1 parent 1e5c988 commit 5d27fe8

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

Crashlytics/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Unreleased
2+
- [added] Added stackFrameWithAddress API for recording custom errors that are symbolicated on the backend (#5975).
3+
14
# v4.5.0
25
- [fixed] Fixed a compiler warning and removed unused networking code (#6210).
36
- [fixed] Fixed a crash that occurred rarely when trying to restart a URL session task without a valid request (#5984).

Crashlytics/Crashlytics/FIRStackFrame.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ - (instancetype)initWithSymbol:(NSString *)symbol file:(NSString *)file line:(NS
4747
return self;
4848
}
4949

50+
+ (instancetype)stackFrameWithAddress:(NSUInteger)address {
51+
FIRStackFrame *frame = [self stackFrame];
52+
53+
[frame setAddress:address];
54+
55+
return frame;
56+
}
57+
5058
+ (instancetype)stackFrameWithSymbol:(NSString *)symbol file:(NSString *)file line:(NSInteger)line {
5159
return [[FIRStackFrame alloc] initWithSymbol:symbol file:file line:line];
5260
}
@@ -57,14 +65,6 @@ + (instancetype)stackFrame {
5765
return [[self alloc] init];
5866
}
5967

60-
+ (instancetype)stackFrameWithAddress:(NSUInteger)address {
61-
FIRStackFrame *frame = [self stackFrame];
62-
63-
[frame setAddress:address];
64-
65-
return frame;
66-
}
67-
6868
+ (instancetype)stackFrameWithSymbol:(NSString *)symbol {
6969
FIRStackFrame *frame = [self stackFrame];
7070

Crashlytics/Crashlytics/Public/FirebaseCrashlytics/FIRStackFrame.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ NS_SWIFT_NAME(StackFrame)
3636
*/
3737
- (instancetype)initWithSymbol:(NSString *)symbol file:(NSString *)file line:(NSInteger)line;
3838

39+
/**
40+
* Creates a symbolicated Stack Frame from an address. The address will be
41+
* symbolicated in the Crashlytics backend for the customer and reported in the
42+
* Crahslytics dashboard with the appropriate file name and line number. If an
43+
* invalid address is provided it will appear in the dashboard as <missing>.
44+
*
45+
* @param address - the address where the exception occurred
46+
*/
47+
+ (instancetype)stackFrameWithAddress:(NSUInteger)address;
48+
3949
/**
4050
* Creates a symbolicated Stack Frame with the given required fields. Symbolicated
4151
* Stack Frames will appear in the Crashlytics dashboard as reported in these fields. *

0 commit comments

Comments
 (0)