Browse Source

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.
elenadoty 5 years ago
parent
commit
5d27fe822f

+ 3 - 0
Crashlytics/CHANGELOG.md

@@ -1,3 +1,6 @@
+# Unreleased
+- [added] Added stackFrameWithAddress API for recording custom errors that are symbolicated on the backend (#5975).
+
 # v4.5.0
 - [fixed] Fixed a compiler warning and removed unused networking code (#6210).
 - [fixed] Fixed a crash that occurred rarely when trying to restart a URL session task without a valid request (#5984).

+ 8 - 8
Crashlytics/Crashlytics/FIRStackFrame.m

@@ -47,6 +47,14 @@
   return self;
 }
 
++ (instancetype)stackFrameWithAddress:(NSUInteger)address {
+  FIRStackFrame *frame = [self stackFrame];
+
+  [frame setAddress:address];
+
+  return frame;
+}
+
 + (instancetype)stackFrameWithSymbol:(NSString *)symbol file:(NSString *)file line:(NSInteger)line {
   return [[FIRStackFrame alloc] initWithSymbol:symbol file:file line:line];
 }
@@ -57,14 +65,6 @@
   return [[self alloc] init];
 }
 
-+ (instancetype)stackFrameWithAddress:(NSUInteger)address {
-  FIRStackFrame *frame = [self stackFrame];
-
-  [frame setAddress:address];
-
-  return frame;
-}
-
 + (instancetype)stackFrameWithSymbol:(NSString *)symbol {
   FIRStackFrame *frame = [self stackFrame];
 

+ 10 - 0
Crashlytics/Crashlytics/Public/FirebaseCrashlytics/FIRStackFrame.h

@@ -36,6 +36,16 @@ NS_SWIFT_NAME(StackFrame)
  */
 - (instancetype)initWithSymbol:(NSString *)symbol file:(NSString *)file line:(NSInteger)line;
 
+/**
+ * Creates a symbolicated Stack Frame from an address. The address will be
+ * symbolicated in the Crashlytics backend for the customer and reported in the
+ * Crahslytics dashboard with the appropriate file name and line number. If an
+ * invalid address is provided it will appear in the dashboard as <missing>.
+ *
+ * @param address - the address where the exception occurred
+ */
++ (instancetype)stackFrameWithAddress:(NSUInteger)address;
+
 /**
  * Creates a symbolicated Stack Frame with the given required fields. Symbolicated
  * Stack Frames will appear in the Crashlytics dashboard as reported in these fields. *