aboutsummaryrefslogtreecommitdiff
path: root/src/client/ios/Breakpad.mm
Commit message (Collapse)AuthorAgeFilesLines
* Fix orphaned crash reports.John Z Wu2019-05-151-1/+13
| | | | | | | | | | | The path NSCachesDirectory may change across app updates and sometimes even across app launches. As a result, the Config-XXX files may end up with an outdated path to the associated minidump file. Change-Id: I0befde26b2ac406c154ce7c7e9be0063ee99892d Bug:850379 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1592561 Reviewed-by: Mark Mentovai <mark@chromium.org>
* [Breakpad iOS] Add a callback on report upload completion.Olivier Robin2019-04-231-13/+26
| | | | | | | | | | | | | This CL adds a result callback on report upload completion. On failure, Breakpad deletes the configuration file and does retry to upload a report. Using this callback, the client will be able to log some metrics and to act on upload failure. Bug: 954175 Change-Id: I95a3264b65d4c06ba5d8dde8377440d23f1e2081 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/1572661 Reviewed-by: Mark Mentovai <mark@chromium.org>
* breakpad: Remove semicolons, iOS edition.Nico Weber2019-02-251-1/+1
| | | | | | | Bug: chromium:926235 Change-Id: I237e7b7d89e5746beea80754675a232c881f25f6 Reviewed-on: https://chromium-review.googlesource.com/c/1487336 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Adds method to get the date of the most recent iOS crash report.Evan Bernstein2018-10-081-0/+38
| | | | | | | | Also adds method to determine if breakpad is started. Change-Id: I272765e7ac6bbc07d77ca2d8dcc34d51c205116e Reviewed-on: https://chromium-review.googlesource.com/c/1260625 Reviewed-by: Joshua Peraza <jperaza@chromium.org>
* Fix crash when an NSException is thrown.Adam Harrison2018-02-021-1/+1
| | | | | | | | old_handlers is zeroish whenever an NSException is thrown. This caused PROT_WRITE to never be set and resulted in an EXC_BAD_ACCESS when trying to set the handler to NULL. Change-Id: Ibb7da448204431c7602b1001f3a5216303c4c9d1 Reviewed-on: https://chromium-review.googlesource.com/899907 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Remove duplicate import.Adam Harrison2017-12-051-1/+0
| | | | | | | The mac exception_handler is included in a conditional below. Change-Id: I505fad7ef6731706a39b7aaacc9a948800fc3069 Reviewed-on: https://chromium-review.googlesource.com/809306 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Create LongStringDictionary and replace SimpleStringDictionary on iOSYi Wang2017-11-031-19/+21
| | | | | | | | | | | This relands fd0a0d2b7ae9dd3d8a02b6a12e7941f7189fbb6c which was reverted in 5dad29423e62292c6ff468cabfee4422ba55b18b, with a fix for guarding kMaxSuffixLength which only used in assert()s with macros which breaks chromium.mac/ios-device. Change-Id: I5ee21b7f290517d6e7a0ef90b693b97f92392549 Reviewed-on: https://chromium-review.googlesource.com/751922 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Revert "Create LongStringDictionary and replace SimpleStringDictionary ↵Mark Mentovai2017-11-021-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | usages in client/ios/Breakpad.mm." This reverts commit fd0a0d2b7ae9dd3d8a02b6a12e7941f7189fbb6c. Reason for revert: Build failures reported at https://chromium-review.googlesource.com/c/chromium/src/+/750591#message-cc4f7dd486fa1da7373ad5d83d56f550d607d429 Failed build on chromium.mac/ios-device: https://build.chromium.org/p/chromium.mac/builders/ios-device/builds/73163, https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.mac%2Fios-device%2F73163%2F%2B%2Frecipes%2Fsteps%2Fcompile%2F0%2Fstdout [637/3593] CXX obj/third_party/breakpad/client/long_string_dictionary.o FAILED: obj/third_party/breakpad/client/long_string_dictionary.o […] ../../third_party/breakpad/breakpad/src/common/long_string_dictionary.cc:46:16: error: unused variable 'kMaxSuffixLength' [-Werror,-Wunused-const-variable] const size_t kMaxSuffixLength = 4; ^ 1 error generated. […] [641/3593] CXX ios_clang_arm64/obj/third_party/breakpad/client/long_string_dictionary.o FAILED: ios_clang_arm64/obj/third_party/breakpad/client/long_string_dictionary.o ../../third_party/breakpad/breakpad/src/common/long_string_dictionary.cc:46:16: error: unused variable 'kMaxSuffixLength' [-Werror,-Wunused-const-variable] const size_t kMaxSuffixLength = 4; ^ 1 error generated. Change-Id: I285eaac6abfcb7d173a0d1e4998b92d5c8dd6ecb Reviewed-on: https://chromium-review.googlesource.com/751723 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Create LongStringDictionary and replace SimpleStringDictionary usages in ↵Yi Wang2017-10-271-19/+21
| | | | | | | | | client/ios/Breakpad.mm. Bug: Change-Id: I401028f5d90417d79fb109b510aaa9660a039b44 Reviewed-on: https://chromium-review.googlesource.com/688301 Reviewed-by: Mark Mentovai <mark@chromium.org>
* ios: Adds a no-Mach exception handlerAdam Harrison2017-10-121-0/+7
| | | | | | | | | | This exception_handler_no_mach does not use Mach for exception handling so that clients such as tvOS and watchOS that do not support mach messages can handle POSIX signals. Change-Id: I4a4574e58834bc590e110e6ecd1825f8af1437a2 Reviewed-on: https://chromium-review.googlesource.com/714276 Reviewed-by: Mark Mentovai <mark@chromium.org>
* Only release current_breakpad_ if it is defined.Benjamin Lerman2015-10-141-1/+1
| | | | | | R=mark@chromium.org Review URL: https://codereview.chromium.org/1402453006 .
* Default nil or empty version string to CFBundleVersionchangluo@google.com2015-07-101-1/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1470 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad: Fix build with new clang versions.mark@chromium.org2014-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc has a single exception setting for all languages. Saying -fno-exceptions in gcc disables exceptions and cleanups for cc files, but has no effect for mm files. In clang, -fno-exceptions only disables c++ exceptions, but keeps objective-c exceptions and cleanups enabled. http://llvm.org/viewvc/llvm-project?view=revision&revision=220714 changed __EXCEPTIONS to be defined for clang when cleanups are enabled, independent of if c++ exceptions are enabled. (This was necessary to have clang work with glibc which looks at __EXCEPTIONS to decide if cleanups are enabled.) Breakpad tried to use __EXCEPTIONS to figure out if c++ exceptions are enabled. In cc files, this works: -fno-exceptions will disable c++ exceptions and cleanups. But in mm files, -fno-exceptions will disable c++ exceptions and objective-c exceptions will still be enabled, and so cleanups must run and hence __EXCEPTIONS is defined. To make things work with both old and new compilers, do the try/catch hack in mm files either if __EXCEPTIONS is not defined (for old compilers) or if the compiler is clang and __has_feature(cxx_exceptions) isn't set (which will work for new clangs too, and which cleanly maps to if c++ exceptions are enabled). Patch by Nico Weber <thakis@chromium.org> Review URL: https://breakpad.appspot.com/1774002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1409 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Adding possibility for client to upload the fileblundell@chromium.org2014-09-011-15/+88
| | | | | | | | | | | | | | | | | | This CL adds three features that will allow the client to upload the report file. Three main modifications are made : - Allow upload url to have a file:// scheme, and write the HTTP request to file in that case - Split the request in two parts in case of a file:// scheme, the request time and the response time. A new API [handleNetworkResponse] is added. - Give the opportunity to the client to get the configuration NSDictionary to be able to recreate the breakpad context at response time. Patch by Olivier Robin <olivierrobin@chromium.org> Review URL: https://breakpad.appspot.com/2764002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1368 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Unhook current Breakpad object after handling uncaught NSException.qsr@chromium.org2014-07-071-0/+1
| | | | | | | | | | | | | | | | | | After handling an uncaught NSException, release the Breakpad object so there will not be a second crash dump logged. Prior to this change, for every uncaught NSException handled through the Breakpad::UncaughtExceptionHandler(), a second crash without any useful information (generally __cxa_rethrow and std::__terminate) is recorded. R=qsr@chromium.org Review URL: https://breakpad.appspot.com/9664002 Patch from Peter Lee <pkl@chromium.org>. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1344 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fixing compiler warnings:ivan.penkov@gmail.com2014-02-281-2/+2
| | | | | | | | | | | | - Building Breakpad in Xcode with arm64 architecture. - iOS Patches provided by: Ian Hickson and Greg Vance. R=mark@chromium.org Review URL: https://breakpad.appspot.com/1184003 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1286 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix up ~14 warnings about 'Implicit conversion loses integer precision' on iOS.dmaclach2014-02-181-1/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1281 4c0a9323-5329-0410-9bdc-e9ce6186880e
* When the Breakpad.h header gets compiled by standard C compilersdmaclach2014-02-181-2/+7
| | | | | | | | | | (instead of C++) it gets upset about the default argument. Instead of using a default argument I split the function up into two separate functions. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1280 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add -[BreakpadController setParametersToAddAtUploadTime:] for iOS.blundell@chromium.org2014-01-131-5/+11
| | | | | | | | | | | | | | This provides the ability to add server parameters to a crash report when the report is uploaded. Patch by KiYun Roe <kiyun@chromium.org> BUG=558 R=blundell@chromium.org Review URL: https://breakpad.appspot.com/974002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1271 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Don't do work inside assert(). Ever.mark@chromium.org2014-01-101-16/+13
| | | | | | | | | | | | | | | The Mac crash key manipulation code was intended to be thread-safe through the provision of a mutex. The mutex operations were done inside an assert(). assert() is a no-op in NDEBUG (release) builds. Therefore, in release builds, these operations were occurring without being protected by any mutex at all, and were nowhere near thread-safe. BUG=chromium:331268 R=rsesek@chromium.org Review URL: https://breakpad.appspot.com/1034002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1270 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Remove usage of gDebugLog and DEBUGLOG from Mac and iOS client code.altse@chromium.org2013-12-121-15/+0
| | | | | | | | | | The inconsistent and duplicated references to gDebugLog caused problems building on iOS and the current logging implementation had little utility because it was never activated in debug builds. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1257 4c0a9323-5329-0410-9bdc-e9ce6186880e
* In iOS, BREAKPAD_OUTPUT_DUMP_FILE value contains a malformed full path to ↵qsr@chromium.org2013-11-261-2/+1
| | | | | | | | | | | | | | | | | | | | the dump file. The std::string dumpFilename already contains the full pathname to the dump file. Appending it to the dumpDirAsNSString creates a string with the path portion duplicated, e.g.: /var/mobile/Applications/516BE756-DFD4-4F9B-85D5-85966B0038F7/Library/Caches/Breakpad/var/mobile/Applications/516BE756-DFD4-4F9B-85D5-85966B0038F7/Library/Caches/Breakpad/0A406D28-437D-48EE-9989-23F7F871818E.dmp Instead of this: /var/mobile/Applications/516BE756-DFD4-4F9B-85D5-85966B0038F7/Library/Caches/Breakpad/0A406D28-437D-48EE-9989-23F7F871818E.dmp R=markus@chromium.org, qsr@chromium.org Review URL: https://breakpad.appspot.com/744002 Patch from Akiva <scirsw@gmail.com>. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1237 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Provide BreakpadGetCrashReportCount() and -[BreakpadControllermark@chromium.org2013-11-201-5/+14
| | | | | | | | | | | | | | | | getCrashReportCount:] This provides the ability for clients to query the number of crash reports that are waiting to upload. Patch by KiYun Roe <kiyun@chromium.org> BUG=547 Review URL: https://breakpad.appspot.com/714002/ git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1234 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Fix a memory leak, using stringWithUTF8String instead.yuwu@google.com2013-07-171-1/+1
| | | | git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1202 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Check env var BreakpadMinidumpLocation first, if set, use it as ↵yuwu@google.com2013-07-151-2/+5
| | | | | | BREAKPAD_DUMP_DIRECTORY. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1201 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Rewrite SimpleStringDictionary with NonAllocatingMap.rsesek@chromium.org2013-04-241-6/+4
| | | | | | | | | | | NonAllocatingMap has a near-identical interface, but is significantly less code, more customizable, and has storage that is POD. BUG=http://code.google.com/p/chromium/issues/detail?id=77656 Review URL: https://breakpad.appspot.com/568002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1161 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Move SimpleStringDictionary from common/mac/ to just common/.rsesek@chromium.org2013-04-181-2/+2
| | | | | | | | | | | | This also cleans up some things like the file name, trailing whitespace, and making the test use gtest instead of sentest, since there's nothing Mac specific about this. BUG=https://code.google.com/p/chromium/issues/detail?id=77656 Review URL: https://breakpad.appspot.com/561003 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1154 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Allow the Mac and iOS Breakpad clients to build without exceptions when the ↵mark@chromium.org2012-12-111-7/+19
| | | | | | | | | | | | C++ standard library is not provided by libstdc++. libc++, for example, does not provide its own try and catch replacement macros when exceptions are disabled. BUG=509 Review URL: https://breakpad.appspot.com/503002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1089 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Correct various compilation warnings.qsr@chromium.org2012-03-071-2/+1
| | | | | | | | | | - Cast result of _dyld_image_count to prevent compilation warning: The 2 int in both side of the ? operator should have the same type. - Remove unused variable for return values. - Remove unused NSUserDefaults. Review URL: https://breakpad.appspot.com/354001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@929 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Creating minidump for uncaught exception on iOS.qsr@chromium.org2012-02-141-0/+56
| | | | | | | | | | | This CL adds a minidump_generator that can write a minidump from a NSException on iOS on an ARM cpu. This CL also install an uncaught exception handler on iOS, and use the previous generator to write minidumps for any uncaught exception. Review URL: https://breakpad.appspot.com/347001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@916 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add API on iOS to generate dump on demand.qsr@chromium.org2011-12-091-2/+55
| | | | | | Review URL: http://breakpad.appspot.com/331001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@893 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Correct bug introduced by last commit: Interface on Breakpad is incorrect.qsr@chromium.org2011-11-161-5/+7
| | | | | | | R=mark@chromium.org git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@886 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Add an API to Breakpad to upload custom file to the crash server.qsr@chromium.org2011-11-161-0/+35
| | | | | | | | | | | On iOS, sending logs using the usual breakpad behavior is not possible, because tar is not available. This allow to use Breakpad to send any file to the crash server. R=mark@chromium.org Review URL: http://breakpad.appspot.com/327001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@885 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Correct leak.qsr@chromium.org2011-11-101-2/+2
| | | | | | | Uploaders were never released. Review URL: http://breakpad.appspot.com/326001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@882 4c0a9323-5329-0410-9bdc-e9ce6186880e
* Breakpad implementation for ios.qsr@chromium.org2011-10-121-0/+683
To be noted: 1) All is done in process, as multi-process is not allowed on ios. 2) Dump are saved when a crash occures but are not automatically send to the server. 3) Breakpad.h contains function to check if a dump must be uploaded, and to upload a dump. 4) The code is copy pasting a log of Breakpad implementation for Mac OS. It might be possible to do some refactoring. Review URL: http://breakpad.appspot.com/309003 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@868 4c0a9323-5329-0410-9bdc-e9ce6186880e