Skip to content

Commit

Permalink
Merge pull request #1036 from bugsnag/nickdowell/fix-stackframes-with…
Browse files Browse the repository at this point in the history
…-callstacksymbols

Fix parsing of `callStackSymbols` where the image name contains spaces
  • Loading branch information
nickdowell authored Mar 16, 2021
2 parents c9492d2 + 24c4f30 commit ad62d89
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Bugsnag/Payload/BugsnagStackframe.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ + (BugsnagStackframe *)frameFromDict:(NSDictionary *)dict
+ (NSArray<BugsnagStackframe *> *)stackframesWithCallStackSymbols:(NSArray<NSString *> *)callStackSymbols {
NSString *pattern = (@"^(\\d+)" // Capture the leading frame number
@" +" // Skip whitespace
@"(\\S+)" // Image name
@"([\\S ]+?)" // Image name (may contain spaces)
@" +" // Skip whitespace
@"(0x[0-9a-fA-F]+)" // Capture the frame address
@"(" // Start optional group
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

## TBD

### Bug fixes

* Fix parsing of `callStackSymbols` where the image name contains spaces.
[#1036](https://github.com/bugsnag/bugsnag-cocoa/pull/1036)

## 6.7.1 (2021-03-10)

### Bug fixes
Expand Down
4 changes: 2 additions & 2 deletions Tests/BugsnagStackframeTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ - (void)testDummyCallStackSymbols {
@"4 CoreFoundation 0x00007fff23e41fd1",
@"5 CoreFoundation 0x00007fff23e422a4",
@"6 ReactNativeTest 0x000000010fd76eae",
@"7 ReactNativeTest 0x000000010fd79138"]];
@"7 ReactNative App 0x000000010fd79138"]];

AssertStackframeValues(stackframes[0], @"ReactNativeTest", 0x000000010fda7f1b, @"0x000000010fda7f1b");
AssertStackframeValues(stackframes[1], @"ReactNativeTest", 0x000000010fd76897, @"0x000000010fd76897");
Expand All @@ -179,7 +179,7 @@ - (void)testDummyCallStackSymbols {
AssertStackframeValues(stackframes[4], @"CoreFoundation", 0x00007fff23e41fd1, @"0x00007fff23e41fd1");
AssertStackframeValues(stackframes[5], @"CoreFoundation", 0x00007fff23e422a4, @"0x00007fff23e422a4");
AssertStackframeValues(stackframes[6], @"ReactNativeTest", 0x000000010fd76eae, @"0x000000010fd76eae");
AssertStackframeValues(stackframes[7], @"ReactNativeTest", 0x000000010fd79138, @"0x000000010fd79138");
AssertStackframeValues(stackframes[7], @"ReactNative App", 0x000000010fd79138, @"0x000000010fd79138");
}

- (void)testRealCallStackSymbols {
Expand Down

0 comments on commit ad62d89

Please sign in to comment.