diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ee144b --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.packages +build/ +**/example/assets/ diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..2bb37ec --- /dev/null +++ b/.metadata @@ -0,0 +1,42 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled. + +version: + revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + channel: stable + +project_type: plugin + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + - platform: android + create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + - platform: ios + create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + - platform: linux + create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + - platform: macos + create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + - platform: windows + create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f39ec37 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,21 @@ +## 0.0.1 + +The following Key Metrics of Flutter Applications are Added in the Alpha Release. + +- Mobile App Performance + - cpu usage + - memory usage + - cold/warm start + - ANR ( android) + - Native slow/frozen frames +- Flutter Errors & Exceptions +- Events + - session start + - route changes + - user interaction +- Http network info + - Load Duration , method , resource/type , request/response size +- Rum Asset Bundle + - Asset Size, Load time +- Custom events, logs, measurement, error +- Offline Caching of Events diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..677c5c9 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# rum_sdk + +* Flutter SDK for Real User Monitoring + +## Getting Started + +[Docs](./docs/Getting%20Started.md) diff --git a/docs/Configurations.md b/docs/Configurations.md new file mode 100644 index 0000000..bbeead3 --- /dev/null +++ b/docs/Configurations.md @@ -0,0 +1,182 @@ +## Configurations + +### Http Tracking +To enable tracking http requests you can override the global HttpOverrides (if you have any other overrides add them before adding RumHttpOverrides) + +```dart + HttpOverrides.global = RumHttpOverrides(HttpOverrides.current); + +``` + +### Mobile Vitals +Mobile Vitals such as cpu usage, memory usage & refresh rate are disabled by default. +The interval for how often the vitals are sent can also be +given (default is set to 60 seconds) + +```dart + RumFlutter().runApp( + optionsConfiguration: RumConfig( + // ... + cpuUsageVitals: true, + memoryUsageVitals: true, + anrTracking: true, + refreshrate: true, + fetchVitalsInterval: const Duration(seconds: 60), + // ... + ), + appRunner: + //... + + ) + +``` + +### Batching Configuration + +The RUM logs can be batched and sent to the server in a single request. The batch size and the interval for sending the batch can be configured. + +```dart + RumFlutter().runApp( + optionsConfiguration: RumConfig( + // ... + batchConfig: BatchConfig( + payloadItemLimit: 30, // default is 30 + sendTimeout: const Duration(milliseconds: 500 ), // default is 500 milliseconds + enabled: true, // default is true + + ), + // ... + ), + appRunner: + //... + + ) + +``` + + +### RateLimiting Configuration + +Limit the number of concurrent requests made to the RUM server + +```dart + RumFlutter().runApp( + optionsConfiguration: RumConfig( + // ... + maxBufferLimit: 30, // default is 30 + // ... + ), + appRunner: + //... + + ) + +``` + +### Enable CrashReporting + +enable capturing of app crashes + +```dart + RumFlutter().runApp( +optionsConfiguration: RumConfig( +// ... +enableCrashReporting: false +// ... +), +appRunner: +//... + +) + +``` + + +RUM Navigator Observer can be added to the list of observers to get view info and also send `view_changed` events when the route changes + +```dart + return MaterialApp( + //... + navigatorObservers: [RumNavigationObserver()], + //... + ), +``` + +### RUM User Interactions Widget + +Add the Rum User Interactions Widget at the root level to enable the tracking of user interactions (click,tap...) + +```dart + RumFlutter().runApp( + optionsConfiguration: RumConfig( + //... + ), + appRunner: () => runApp( + const RumUserInteractionWidget(child: MyApp()) + ), + ); +``` + +### RUM Asset Bundle + +Add the Rum Asset Bundle to track asset load info + +```dart +//.. + appRunner: () => runApp( + DefaultAssetBundle(bundle: RumAssetBundle(), child: const RumUserInteractionWidget(child: MyApp())) + ), + //.. +``` + +### Sending Custom Events + + + +```dart + RumFlutter().pushEvent(String name, {Map? attributes}) + // example + RumFlutter().pushEvent("event_name") + RumFlutter().pushEvent("event_name", attributes:{ + attr1:"value" + }) +``` + + +### Sending Custom Logs +```dart +RumFlutter().pushLog(String message, {String? level ,Map? context,Map? trace}) +//example +RumFlutter().pushLog("log_message",level:"warn") +``` + +### Sending Custom Measurements +- values can only have numeric values +```dart + RumFlutter().pushMeasurement(Map? values, String type) + RumFlutter().pushMeasurement({attr1:13.1, attr2:12},"some_measurements") +``` + +### Sending Custom Errors +```dart + RumFlutter().pushError({required type, required value, StackTrace? stacktrace, String? context}) +``` + +### Capturing Event Duration + +To capture the duration of an event you can use the following methods + +```dart + RumFlutter().markEventStart(String key,String name) + // code + RumFlutter().markEventEnd(String key,String name, {Map? attributes}) +``` + + + +### Adding User Meta +```dart + RumFlutter().setUserMeta({String? userId, String? userName, String? userEmail}); + // example + RumFlutter().addUserMeta(userId:"123",userName:"user",userEmail:"jhondoes@something.com") +``` diff --git a/docs/Features.md b/docs/Features.md new file mode 100644 index 0000000..7cb204f --- /dev/null +++ b/docs/Features.md @@ -0,0 +1,45 @@ +## Rum Features + +## RUM Event metadata + +- view info +- app info (name, version , env) +- device info (os, version) +- user info (id,name) +- dart version +- session info + +## Perfomance + +- cpu usage +- memory usage +- cold/warm start +- ANR + +## Exceptions + +- Flutter Errors & Exceptions + +## Events + +- session start +- route changes +- user interaction + +## Resource Load info + +- http network info + + - load duration + - method + - content/type + - request/ response size + +- Rum Asset Bundle + - asset size + - asset load time + +## More + +- push custom events, logs, measurement, error +- Offline Caching of Events Storage diff --git a/docs/Getting Started.md b/docs/Getting Started.md new file mode 100644 index 0000000..bff0c7f --- /dev/null +++ b/docs/Getting Started.md @@ -0,0 +1,48 @@ +# RUM Flutter - 0.0.1 Alpha + +## Getting Started + +- Installation +- Initialise RUM + +### Onboarding + + +### Installation + +Add the following dependencies to your `pubspec.yaml` + +```yml +rum_sdk: + git: + url: + path: packages/rum_sdk + ref: main +``` + +### Initialise RUM + +Add the following snippet to initialize RUM Monitoring with the default configurations + +```dart + + HttpOverrides.global = RumHttpOverrides(HttpOverrides.current); // enable http tracking + + RumFlutter().runApp( + optionsConfiguration: RumConfig( + appName: "", + appVersion: "1.0.0", + appEnv: "Test", + apiKey: "", + ), + appRunner: () => runApp( + RumUserInteractionWidget(child: MyApp()) + ), + ); + + + +``` + + +See all [configuration](./Configurations.md) options for RUM Flutter diff --git a/docs/OfflineTransport.md b/docs/OfflineTransport.md new file mode 100644 index 0000000..a3c016f --- /dev/null +++ b/docs/OfflineTransport.md @@ -0,0 +1,35 @@ +## Offline Transport + +Add Offline Transport to enable caching of RUM Events when application is offline + +* Add offline transport to pubspec.yaml + +```yaml +offline_transport: + git: + url: + path: packages/offline_transport + ref: main +``` + +* Add following snippet to enable offline transport + +```dart + +import 'package:offline_transport/offline_transport.dart'; + +RumFlutter().transports.add( + OfflineTransport(maxCacheDuration: const Duration(days: 3)) +); + +await RumFlutter().runApp( + optionsConfiguration: + //... + appRunner: () async { + runApp( + //... + ) + ); +} +); +``` \ No newline at end of file diff --git a/melos.yaml b/melos.yaml new file mode 100644 index 0000000..d683cd3 --- /dev/null +++ b/melos.yaml @@ -0,0 +1,5 @@ +name: rum-flutter + +packages: + - apps/** + - packages/** diff --git a/packages/offline_transport/.gitignore b/packages/offline_transport/.gitignore new file mode 100644 index 0000000..93ae689 --- /dev/null +++ b/packages/offline_transport/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +build/ +.flutter-plugins +.flutter-plugins-dependencies diff --git a/packages/offline_transport/.metadata b/packages/offline_transport/.metadata new file mode 100644 index 0000000..7e6d66a --- /dev/null +++ b/packages/offline_transport/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "54e66469a933b60ddf175f858f82eaeb97e48c8d" + channel: "stable" + +project_type: package diff --git a/packages/offline_transport/CHANGELOG.md b/packages/offline_transport/CHANGELOG.md new file mode 100644 index 0000000..41cc7d8 --- /dev/null +++ b/packages/offline_transport/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/packages/offline_transport/LICENSE b/packages/offline_transport/LICENSE new file mode 100644 index 0000000..ba75c69 --- /dev/null +++ b/packages/offline_transport/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/packages/offline_transport/README.md b/packages/offline_transport/README.md new file mode 100644 index 0000000..02fe8ec --- /dev/null +++ b/packages/offline_transport/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/packages/offline_transport/analysis_options.yaml b/packages/offline_transport/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/packages/offline_transport/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/offline_transport/lib/offline_transport.dart b/packages/offline_transport/lib/offline_transport.dart new file mode 100644 index 0000000..c3b5fbb --- /dev/null +++ b/packages/offline_transport/lib/offline_transport.dart @@ -0,0 +1,138 @@ +import 'dart:convert'; + +import 'package:connectivity_plus/connectivity_plus.dart'; +import 'package:path_provider/path_provider.dart'; +import 'package:rum_sdk/rum_flutter.dart'; +import 'package:rum_sdk/src/models/payload.dart'; +import 'package:rum_sdk/src/transport/rum_base_transport.dart'; +import 'dart:io'; + +class OfflineTransport extends BaseTransport { + bool isOnline = true; + Duration? _maxCacheDuration; + OfflineTransport({Duration? maxCacheDuration}) { + _maxCacheDuration = maxCacheDuration; + checkConnectivity(); + monitorConnectivity(); + } + @override + Future send(Payload payload) async { + if (!isOnline) { + if(isPayloadEmpty(payload)){ + return; + } + await writeToFile(payload); + } + } + + Future checkConnectivity() async { + var connectivityResult = await Connectivity().checkConnectivity(); + if (connectivityResult == ConnectivityResult.none) { + isOnline = false; + } else { + isOnline = await _isConnectedToInternet(); + readFromFile(); + } + } + Future? monitorConnectivity() { + Connectivity().onConnectivityChanged.listen((List result) async { + if (result.contains(ConnectivityResult.none)) { + isOnline = false; + } else { + bool isConnected = await _isConnectedToInternet(); + if (isConnected) { + isOnline = true; + readFromFile(); + } else { + isOnline = false; + } + } + }); + return null; + } + + + Future _isConnectedToInternet() async { + try { + final result = await InternetAddress.lookup('example.com'); + return result.isNotEmpty && result[0].rawAddress.isNotEmpty; + } on SocketException catch (_) { + return false; + } + } + + bool isPayloadEmpty(Payload payload){ + return (payload.events.isEmpty && + payload.measurements.isEmpty && + payload.logs.isEmpty && + payload.exceptions.isEmpty) ; + } + + + Future writeToFile(Payload payload) async { + final file = await _getCacheFile(); + var logJson = { + "timestamp": DateTime.now().millisecondsSinceEpoch, + "payload": payload.toJson() + }; + await file.writeAsString(jsonEncode(logJson) + '\n', mode: FileMode.append); + } + + Future readFromFile() async { + final file = await _getCacheFile(); + if (!await file.exists()) { + return; + } + if(file.length() == 0 ){ + return; + } + + final Stream lines = file + .openRead() + .transform(utf8.decoder) // Decode bytes to UTF-8. + .transform(LineSplitter()); // Convert stream to individual lines. + + final List remainingLines = []; + final currentTime = DateTime.now().millisecondsSinceEpoch; + + await for (var line in lines) { + if (line.trim().isEmpty) continue; + + final logJson = jsonDecode(line); + final timestamp = logJson["timestamp"]; + final payload = Payload.fromJson(logJson["payload"]); + + if (_maxCacheDuration != null && + currentTime - timestamp > _maxCacheDuration!.inMilliseconds) { + continue; + } else { + await sendCachedData(payload); + } } + if (remainingLines.isEmpty) { + await file.writeAsString(''); + } else { + await file.writeAsString(remainingLines.join('\n') + '\n'); + } + } + + Future _getCacheFile() async { + final directory = await getApplicationDocumentsDirectory(); + final filepath = '${directory.path}/rum_log.json'; + if(!await File(filepath).exists()){ + return File(filepath).create(recursive: true); + } + return File(filepath); + } + + bool cachedDataExists(){ + return false; + } + Future sendCachedData(Payload payload) async { + for( var transport in RumFlutter().transports){ + if(this != transport){ + transport.send(payload); + } + + } + } +} diff --git a/packages/offline_transport/pubspec.yaml b/packages/offline_transport/pubspec.yaml new file mode 100644 index 0000000..7593bb9 --- /dev/null +++ b/packages/offline_transport/pubspec.yaml @@ -0,0 +1,59 @@ +publish_to: none +name: offline_transport +description: "A new Flutter package project." +version: 1.0.0 +homepage: + +environment: + sdk: '>=3.3.4 <4.0.0' + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + rum_sdk: + path: ../rum_sdk + connectivity_plus: ^6.0.3 + path_provider: ^2.1.3 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^3.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/assets-and-images/#from-packages + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/offline_transport/pubspec_overrides.yaml b/packages/offline_transport/pubspec_overrides.yaml new file mode 100644 index 0000000..cdb5210 --- /dev/null +++ b/packages/offline_transport/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: rum_sdk +dependency_overrides: + rum_sdk: + path: ../rum_sdk diff --git a/packages/offline_transport/test/offline_transport_test.dart b/packages/offline_transport/test/offline_transport_test.dart new file mode 100644 index 0000000..8ae7d1b --- /dev/null +++ b/packages/offline_transport/test/offline_transport_test.dart @@ -0,0 +1,5 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:offline_transport/offline_transport.dart'; + +void main() { +} diff --git a/packages/rum_sdk/CHANGELOG.md b/packages/rum_sdk/CHANGELOG.md new file mode 100644 index 0000000..f39ec37 --- /dev/null +++ b/packages/rum_sdk/CHANGELOG.md @@ -0,0 +1,21 @@ +## 0.0.1 + +The following Key Metrics of Flutter Applications are Added in the Alpha Release. + +- Mobile App Performance + - cpu usage + - memory usage + - cold/warm start + - ANR ( android) + - Native slow/frozen frames +- Flutter Errors & Exceptions +- Events + - session start + - route changes + - user interaction +- Http network info + - Load Duration , method , resource/type , request/response size +- Rum Asset Bundle + - Asset Size, Load time +- Custom events, logs, measurement, error +- Offline Caching of Events diff --git a/packages/rum_sdk/LICENSE b/packages/rum_sdk/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/packages/rum_sdk/README.md b/packages/rum_sdk/README.md new file mode 100644 index 0000000..b73a326 --- /dev/null +++ b/packages/rum_sdk/README.md @@ -0,0 +1,15 @@ +# rum_sdk + +A new Flutter plugin project. + +## Getting Started + +This project is a starting point for a Flutter +[plug-in package](https://flutter.dev/developing-packages/), +a specialized package that includes platform-specific implementation code for +Android and/or iOS. + +For help getting started with Flutter development, view the +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. + diff --git a/packages/rum_sdk/analysis_options.yaml b/packages/rum_sdk/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/packages/rum_sdk/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/rum_sdk/android/.gitignore b/packages/rum_sdk/android/.gitignore new file mode 100644 index 0000000..161bdcd --- /dev/null +++ b/packages/rum_sdk/android/.gitignore @@ -0,0 +1,9 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures +.cxx diff --git a/packages/rum_sdk/android/build.gradle b/packages/rum_sdk/android/build.gradle new file mode 100644 index 0000000..ee4ddc1 --- /dev/null +++ b/packages/rum_sdk/android/build.gradle @@ -0,0 +1,44 @@ +group 'com.example.rum_sdk' +version '1.0' + +buildscript { + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:8.0.2' + } +} + +rootProject.allprojects { + repositories { + google() + mavenCentral() + } +} + +apply plugin: 'com.android.library' + +android { + compileSdkVersion 31 + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + defaultConfig { + minSdkVersion 19 + } + + namespace 'com.example.rum_sdk' +} + +dependencies { + implementation 'androidx.metrics:metrics-performance:1.0.0-beta01' +// implementation 'androidx.annotation:annotation-jvm:1.8.0-beta02' +} + + diff --git a/packages/rum_sdk/android/gradle.properties b/packages/rum_sdk/android/gradle.properties new file mode 100644 index 0000000..8038832 --- /dev/null +++ b/packages/rum_sdk/android/gradle.properties @@ -0,0 +1,15 @@ +## For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx1024m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +# +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +#Fri Dec 29 13:26:00 IST 2023 +android.enableJetifier=true +android.useAndroidX=true diff --git a/packages/rum_sdk/android/gradle/wrapper/gradle-wrapper.jar b/packages/rum_sdk/android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..ccebba7 Binary files /dev/null and b/packages/rum_sdk/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/packages/rum_sdk/android/gradle/wrapper/gradle-wrapper.properties b/packages/rum_sdk/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..42defcc --- /dev/null +++ b/packages/rum_sdk/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip +networkTimeout=10000 +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/packages/rum_sdk/android/gradlew b/packages/rum_sdk/android/gradlew new file mode 100755 index 0000000..79a61d4 --- /dev/null +++ b/packages/rum_sdk/android/gradlew @@ -0,0 +1,244 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/packages/rum_sdk/android/gradlew.bat b/packages/rum_sdk/android/gradlew.bat new file mode 100644 index 0000000..6689b85 --- /dev/null +++ b/packages/rum_sdk/android/gradlew.bat @@ -0,0 +1,92 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/rum_sdk/android/settings.gradle b/packages/rum_sdk/android/settings.gradle new file mode 100644 index 0000000..99d0e6a --- /dev/null +++ b/packages/rum_sdk/android/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'rum_sdk' diff --git a/packages/rum_sdk/android/src/main/AndroidManifest.xml b/packages/rum_sdk/android/src/main/AndroidManifest.xml new file mode 100644 index 0000000..d8b0774 --- /dev/null +++ b/packages/rum_sdk/android/src/main/AndroidManifest.xml @@ -0,0 +1,11 @@ + + + + + + diff --git a/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/ANRTracker.java b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/ANRTracker.java new file mode 100644 index 0000000..d1b6a4e --- /dev/null +++ b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/ANRTracker.java @@ -0,0 +1,79 @@ +package com.example.rum_sdk; + +import android.os.Handler; +import android.os.Looper; +import android.provider.Settings; + +import androidx.annotation.Nullable; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.lang.Exception; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; + +import io.flutter.Log; + + + +public class ANRTracker extends Thread { + + + private final long TIMEOUT = 5000L; // Time interval for checking ANR, in milliseconds + private @Nullable static List ANRs; + private final Handler handler = new Handler(Looper.getMainLooper()); + private final Thread mainThread = Looper.getMainLooper().getThread(); + private final Runnable worker = () -> { + }; + + public static List getANRStatus(){ + return ANRs; + } + public static void resetANR(){ + ANRs=null; + } + + @Override + public void run() { + while (!isInterrupted()) { + handler.postAtFrontOfQueue(worker); + + try { + sleep(TIMEOUT); // Wait for the specified interval + } catch (InterruptedException e) { + e.printStackTrace(); + } + + if (handler.hasMessages(0)) { + // Worker has not finished running, so the UI thread is being held + StackTraceElement[] stackTrace = mainThread.getStackTrace(); + StringBuilder output = new StringBuilder(); + for (StackTraceElement element : stackTrace) { + output.append(element.getClassName()) + .append(" ") + .append(element.getMethodName()) + .append(" ") + .append(element.getLineNumber()) + .append("\n"); + } + JSONObject jsonObject = new JSONObject(); + try { + jsonObject.put("stacktrace", Arrays.toString(stackTrace)); + jsonObject.put("value", "ANR"); + } catch (JSONException e) { + e.printStackTrace(); + } + RumCache rumCache = new RumCache(); + rumCache.writeToCache(jsonObject.toString()); + if(ANRs == null){ + ANRs = new ArrayList(); + } + ANRs.add(String.valueOf(output)); + } + } + } + +} diff --git a/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/CPUInfo.java b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/CPUInfo.java new file mode 100644 index 0000000..66bdb54 --- /dev/null +++ b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/CPUInfo.java @@ -0,0 +1,54 @@ +package com.example.rum_sdk; + +import android.os.Build; +import android.os.SystemClock; +import android.system.Os; +import android.system.OsConstants; +import android.os.Process; + +import androidx.annotation.RequiresApi; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; + + +@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) +public class CPUInfo { + + + private static final long clockSpeedHz = Os.sysconf(OsConstants._SC_CLK_TCK); + private static final File statFile = new File("/proc/"+ Process.myPid() +"/stat"); + private static Double lastCpuTime =null; + private static Double lastProcessTime =null; + + public static Double onGetCpuInfo() { + if (statFile.exists() && statFile.canRead()) { + try { + BufferedReader reader = new BufferedReader(new FileReader(statFile)); + String line = reader.readLine(); + reader.close(); + String []statArray = line.split(" "); + int utime = Integer.parseInt(statArray[13]); + int stime = Integer.parseInt(statArray[14]); + int cutime = Integer.parseInt(statArray[15]); + int cstime = Integer.parseInt(statArray[16]); + Double cpuTime = (double) ((utime+stime+cutime+cstime)/clockSpeedHz); + Double uptime = SystemClock.elapsedRealtime()/1000.0; + Long startTime = Long.parseLong(statArray[21]); + Double processTime = uptime - (startTime / clockSpeedHz); + if(lastCpuTime == null){ + lastCpuTime = cpuTime; + lastProcessTime = processTime; + return 0.0; + } + return 100*((cpuTime - lastCpuTime) / (processTime - lastProcessTime)); + + } catch (IOException e) { + throw new RuntimeException(e); + } + } + return null; + } +} diff --git a/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/ExceptionHandler.java b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/ExceptionHandler.java new file mode 100644 index 0000000..7f29d06 --- /dev/null +++ b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/ExceptionHandler.java @@ -0,0 +1,61 @@ +package com.example.rum_sdk; + +import android.os.StrictMode; + +import androidx.annotation.NonNull; + +import org.json.JSONObject; + +import java.lang.Thread.UncaughtExceptionHandler; +import java.util.Arrays; + +import io.flutter.Log; + +/** + * Provides automatic notification hooks for unhandled exceptions. + */ +class ExceptionHandler implements UncaughtExceptionHandler { + + + + private final UncaughtExceptionHandler originalHandler; + + ExceptionHandler() { + this.originalHandler = Thread.getDefaultUncaughtExceptionHandler(); + } + + void install() { + Thread.setDefaultUncaughtExceptionHandler(this); + } + + void uninstall() { + Thread.setDefaultUncaughtExceptionHandler(originalHandler); + } + + @Override + public void uncaughtException(@NonNull Thread thread, @NonNull Throwable throwable) { + try { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("stacktrace", Arrays.toString(throwable.getStackTrace())); + jsonObject.put("value", throwable.getMessage()); + StrictMode.ThreadPolicy originalThreadPolicy = StrictMode.getThreadPolicy(); + StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.LAX); + RumCache rumCache = new RumCache(); + rumCache.writeToCache(jsonObject.toString()); + StrictMode.setThreadPolicy(originalThreadPolicy); + } catch (Throwable ignored) { + // avoid possible unhandled-exception loops + } finally { + forwardToOriginalHandler(thread, throwable); + } + } + + private void forwardToOriginalHandler(@NonNull Thread thread, @NonNull Throwable throwable) { + // Pass exception on to original exception handler + if (originalHandler != null) { + originalHandler.uncaughtException(thread, throwable); + } else { + System.err.printf("Exception in thread \"%s\" ", thread.getName()); + } + } +} \ No newline at end of file diff --git a/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/ExitInfoHelper.java b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/ExitInfoHelper.java new file mode 100644 index 0000000..05f06c8 --- /dev/null +++ b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/ExitInfoHelper.java @@ -0,0 +1,102 @@ +package com.example.rum_sdk; + +import android.app.ActivityManager; +import android.app.ApplicationExitInfo; +import android.content.Context; +import android.os.Build; + +import androidx.annotation.RequiresApi; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.Arrays; + + +import java.util.List; + + +public class ExitInfoHelper { + + public static List getApplicationExitInfo(Context context) { + ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); + + if (activityManager != null) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + return activityManager.getHistoricalProcessExitReasons(null, 0, 15); + } + } + + return null; + } + + public static JSONObject getExitInfo(ApplicationExitInfo exitInfo) throws JSONException { + JSONObject jsonObject = new JSONObject(); + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) { + int reason = exitInfo.getReason(); + if(getExitReasonsToCapture().contains(reason)){ + long timestamp = exitInfo.getTimestamp(); + int status = exitInfo.getStatus(); + String description = exitInfo.getDescription(); + jsonObject.put("reason", getReasonName(reason)); + jsonObject.put("timestamp", timestamp); + jsonObject.put("status", status); + jsonObject.put("description", description); + // format parse tombstone traces for crash and native crash + // if(reason == ApplicationExitInfo.REASON_CRASH || reason == ApplicationExitInfo.REASON_CRASH_NATIVE){ } + } + } + return jsonObject; + } + + @RequiresApi(api = Build.VERSION_CODES.R) + private static List getExitReasonsToCapture() { + return Arrays.asList( + ApplicationExitInfo.REASON_ANR, + ApplicationExitInfo.REASON_CRASH, + ApplicationExitInfo.REASON_CRASH_NATIVE, + ApplicationExitInfo.REASON_DEPENDENCY_DIED, + ApplicationExitInfo.REASON_EXCESSIVE_RESOURCE_USAGE, + ApplicationExitInfo.REASON_EXIT_SELF, + ApplicationExitInfo.REASON_INITIALIZATION_FAILURE, + ApplicationExitInfo.REASON_LOW_MEMORY, + ApplicationExitInfo.REASON_SIGNALED, + ApplicationExitInfo.REASON_UNKNOWN + ); + } + + private static String getReasonName(int reason) { + switch (reason) { + case ApplicationExitInfo.REASON_ANR: + return "ANR"; + case ApplicationExitInfo.REASON_CRASH: + return "Crash"; + case ApplicationExitInfo.REASON_CRASH_NATIVE: + return "Native Crash"; + case ApplicationExitInfo.REASON_DEPENDENCY_DIED: + return "Dependency Died"; + case ApplicationExitInfo.REASON_EXCESSIVE_RESOURCE_USAGE: + return "Excessive Resource Usage"; + case ApplicationExitInfo.REASON_EXIT_SELF: + return "Exit Self"; + case ApplicationExitInfo.REASON_INITIALIZATION_FAILURE: + return "Initialization Failure"; + case ApplicationExitInfo.REASON_LOW_MEMORY: + return "Low Memory"; + case ApplicationExitInfo.REASON_OTHER: + return "Other"; + case ApplicationExitInfo.REASON_PERMISSION_CHANGE: + return "Permission Change"; + case ApplicationExitInfo.REASON_SIGNALED: + return "Signaled"; + case ApplicationExitInfo.REASON_UNKNOWN: + return "Unknown"; + case ApplicationExitInfo.REASON_USER_REQUESTED: + return "User Requested"; + case ApplicationExitInfo.REASON_USER_STOPPED: + return "User Stopped"; + default: + return "Unknown Reason"; + } + } +} diff --git a/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/MemoryUsageInfo.java b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/MemoryUsageInfo.java new file mode 100644 index 0000000..c00e985 --- /dev/null +++ b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/MemoryUsageInfo.java @@ -0,0 +1,57 @@ +package com.example.rum_sdk; + +import androidx.annotation.Nullable; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +public class MemoryUsageInfo { + + private static final File statFile = new File("/proc/"+android.os.Process.myPid()+"/status"); + private static final Pattern pattern = Pattern.compile("VmRSS:\\s+(\\d+) kB"); + + + public @Nullable static Double onGetMemoryUsageInfo(){ + if (statFile.exists() && statFile.canRead()) { + BufferedReader reader = null; + try { + reader = new BufferedReader(new FileReader(statFile)); + List lines = new ArrayList<>(); + String line; + while ((line = reader.readLine()) != null) { + lines.add(line); + } + + Double memorySizeKb = null; + for (String l : lines) { + Matcher matcher = pattern.matcher(l); + if (matcher.find()) { + String match = matcher.group(1); + if (match != null) { + memorySizeKb = Double.parseDouble(match); + break; + } + } + } + return memorySizeKb; + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (reader != null) { + try { + reader.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } } + return null; + } +} diff --git a/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/RumCache.java b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/RumCache.java new file mode 100644 index 0000000..06b3722 --- /dev/null +++ b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/RumCache.java @@ -0,0 +1,86 @@ +package com.example.rum_sdk; + +import android.content.Context; + +import io.flutter.Log; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Writer; +import java.util.ArrayList; + +public class RumCache { + + private final String lastCrashFileName = "last_crash_file"; + private final String lastCrashInfoFileName = "last_crash_info_file"; + + private static Context context; + + public RumCache() { + } + + + public static void setContext(Context context) { + RumCache.context = context; + } + + public boolean writeToCache(String data) { + if (RumCache.context == null) { + return false; + } + + File cacheDir = RumCache.context.getCacheDir(); + File crashCacheFile = new File(cacheDir, lastCrashFileName); + try { + Writer out = new BufferedWriter(new FileWriter(crashCacheFile,true), 1024); + out.write(data+"\n"); + out.close(); + } catch (IOException e) { + Log.e("RumCache", "Error writing to cache: " + e.getMessage()); + return false; + } + + return true; + } + + public void removeCacheFile(){ + try{ + File cacheFile = new File(RumCache.context.getCacheDir(),lastCrashFileName); + if(cacheFile.exists()){ + cacheFile.delete(); + } + + } catch (Exception e){ + Log.e("RumCache", "Error removing cache file: " + e.getMessage()); + } + + } + + public ArrayList readFromCache() { + // Implement your read logic here + ArrayList lst = new ArrayList<>(); + if(RumCache.context == null){ + return lst; + } + File cacheDir = RumCache.context.getCacheDir(); + File crashCacheFile = new File(cacheDir, lastCrashFileName); + try{ + if(crashCacheFile.exists()){ + BufferedReader br = new BufferedReader(new FileReader(crashCacheFile)); + String line; + while((line = br.readLine()) != null){ + lst.add(line); + } + br.close(); + } + + }catch(Exception e){ + Log.e("RumCache", "Error reading from cache: " + e.getMessage()); + } + return lst; + } +} diff --git a/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/RumSdkPlugin.java b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/RumSdkPlugin.java new file mode 100644 index 0000000..f5c2d8f --- /dev/null +++ b/packages/rum_sdk/android/src/main/java/com/example/rum_sdk/RumSdkPlugin.java @@ -0,0 +1,268 @@ +package com.example.rum_sdk; + +import android.app.Activity; +import android.app.Application; +import android.app.ApplicationExitInfo; +import android.content.Context; +import android.os.Build; +import android.os.Handler; +import android.os.Looper; +import android.os.Process; +import android.os.SystemClock; +import android.view.Choreographer; +import android.view.Window; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import io.flutter.Log; +import io.flutter.embedding.engine.plugins.FlutterPlugin; +import io.flutter.embedding.engine.plugins.activity.ActivityAware; +import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding; +import io.flutter.plugin.common.MethodCall; +import io.flutter.plugin.common.MethodChannel; +import io.flutter.plugin.common.MethodChannel.MethodCallHandler; +import io.flutter.plugin.common.MethodChannel.Result; + +/** RumSdkPlugin */ +public class RumSdkPlugin implements FlutterPlugin, MethodCallHandler, ActivityAware { + /// The MethodChannel that will the communication between Flutter and native Android + /// This local reference serves to register the plugin with the Flutter Engine and unregister it + /// when the Flutter Engine is detached from the Activity + private MethodChannel channel; + private Context context; + private @Nullable WeakReference activity= null; + private ANRTracker anrTracker; + private Window window; + private Application application; + + private FlutterPluginBinding pluginBinding; + private long lastFrameTimeNanos = 0; + final int[] frozenFrameCount = {0}; + + private static final long NANOSECONDS_IN_SECOND = 1_000_000_000L; + + Double refreshRate = 0.0; + private int count = 0; + + private int frameCount = 0; + + private int slowFrames = 0; + + @Override + public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) { + this.pluginBinding = flutterPluginBinding; + channel = new MethodChannel(flutterPluginBinding.getBinaryMessenger(), "rum_sdk"); + channel.setMethodCallHandler(this); + RumCache.setContext(flutterPluginBinding.getApplicationContext()); + ExceptionHandler exceptionHandler = new ExceptionHandler(); + exceptionHandler.install(); + + // StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder(StrictMode.getVmPolicy()) .detectLeakedClosableObjects() .build()); + } + + @Override + public void onAttachedToActivity(ActivityPluginBinding binding){ + anrTracker = new ANRTracker(); + anrTracker.start(); + + startFrameMonitoring(); + activity = new WeakReference<>(binding.getActivity()); + if(activity.get()!=null){ + window = activity.get().getWindow(); + } + context = binding.getActivity(); + RumCache.setContext(activity.get().getApplicationContext()); + RumCache rumCache = new RumCache(); + ArrayList lst = rumCache.readFromCache(); + if(lst.size()>0){ + channel.invokeMethod("lastCrashReport", lst.get(0)); + } + } + @Override + public void onDetachedFromActivityForConfigChanges(){ + stopFrameMonitoring(); + } + + @Override + public void onReattachedToActivityForConfigChanges(ActivityPluginBinding binding){ + startFrameMonitoring(); + } + + @Override + public void onDetachedFromActivity(){ + stopFrameMonitoring(); + if (anrTracker != null) { + anrTracker.interrupt(); + } + } + + @Override + public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { + channel.setMethodCallHandler(null); + } + + // test + @Override + public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { + + if (call.method != null) { + switch (call.method) { + case "initRefreshRate": + this.lastFrameTimeNanos=0; + this.count =0; + startFrameMonitoring(); + result.success(checkFrozenFrames()); + break; + case "getMemoryUsage": + result.success(MemoryUsageInfo.onGetMemoryUsageInfo()); + break; + case "getCpuUsage": + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + result.success(CPUInfo.onGetCpuInfo()); + } + else{ + result.success(null); + } + break; + case "getCrashReport": + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) { + List exitInfo; + try { + exitInfo = getExitInfo(); + } catch (JSONException e) { + result.success(null); + break; + } + result.success(exitInfo); + } + else{ + result.success(null); + } + break; + case "getANRStatus": + List lst = ANRTracker.getANRStatus(); + ANRTracker.resetANR(); + result.success(lst); + break; + case "getAppStart": + Map appStart = new HashMap<>(); + appStart.put("appStartDuration", getAppStart()); + result.success(appStart); + break; + default: + result.notImplemented(); + break; + } + } + } + + + private void startFrameMonitoring() { + if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN) { + Choreographer.getInstance().postFrameCallback(frameTimeNanos -> { + checkFrameDuration(frameTimeNanos); + if(this.count<5){ + startFrameMonitoring(); + } + }); + } else { + new Handler(Looper.getMainLooper()).postDelayed(() -> { + checkFrameDuration(System.nanoTime()); + startFrameMonitoring(); + }, 16); + } + } + + private void stopFrameMonitoring() { + // Cleanup or stop monitoring if needed + Log.d("Cleanup or stop monitoring if needed",""); + } + + private List getExitInfo() throws JSONException { + List exitInfos = ExitInfoHelper.getApplicationExitInfo(context); + List infoList = new ArrayList<>(); + + if (exitInfos != null) { + for (ApplicationExitInfo exitInfo : exitInfos) { + JSONObject info = ExitInfoHelper.getExitInfo(exitInfo); + if(info != null && info.length() > 0){ + String infoString = info.toString(); + infoList.add(infoString); + } + } + return infoList; + } + return null; + } + + + private int checkFrozenFrames() { + return this.frozenFrameCount[0]; + } + + private void checkFrameDuration(long frameTimeNanos) { + long frameDuration = frameTimeNanos - lastFrameTimeNanos; + this.frameCount++; + this.refreshRate = NANOSECONDS_IN_SECOND / (double) frameDuration; + if(lastFrameTimeNanos !=0){ + handleRefreshRate(); + } + double fps = this.frameCount / (frameDuration / (double) NANOSECONDS_IN_SECOND); + // Reset counters for the next second + this.frameCount = 0; + this.count++; + + // Check for slow or frozen frames based on your thresholds + if (fps < 60) { + // Handle slow frames + this.slowFrames++; + handleSlowFrameDrop(); + } + + if (lastFrameTimeNanos != 0 && frameDuration > 100_000_000L) { + this.frozenFrameCount[0]++; + handleFrameDrop(); + } + lastFrameTimeNanos = frameTimeNanos; + } + + private long getAppStart(){ + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + return SystemClock.elapsedRealtime() - Process.getStartElapsedRealtime(); + } + + return 0; + } + + private void handleFrameDrop() { + int frozenFrame = this.frozenFrameCount[0]; + // Handle the frozen frame event, e.g., log, send an event to Dart, etc. + channel.invokeMethod("onFrozenFrame", frozenFrame); + this.frozenFrameCount[0] = 0; + } + + private void handleSlowFrameDrop() { + Object slowFrame = this.slowFrames; + // Handle the frozen frame event, e.g., log, send an event to Dart, etc. + channel.invokeMethod("onSlowFrames", slowFrame); + this.slowFrames = 0; + } + + private void handleRefreshRate() { + Object refreshRates = this.refreshRate; + // Handle the frozen frame event, e.g., log, send an event to Dart, etc. + channel.invokeMethod("onRefreshRate", refreshRates); + this.refreshRate = 0.0; + } +} diff --git a/packages/rum_sdk/coverage/lcov.info b/packages/rum_sdk/coverage/lcov.info new file mode 100644 index 0000000..cc1ef5d --- /dev/null +++ b/packages/rum_sdk/coverage/lcov.info @@ -0,0 +1,1054 @@ +SF:lib/src/transport/rum_transport.dart +DA:16,0 +DA:17,0 +DA:18,0 +DA:19,0 +DA:21,0 +DA:22,0 +DA:24,0 +DA:25,0 +DA:26,0 +DA:27,0 +DA:29,0 +DA:31,0 +DA:32,0 +DA:33,0 +DA:35,0 +DA:38,0 +DA:39,0 +DA:43,0 +DA:44,0 +DA:45,0 +DA:46,0 +DA:50,0 +DA:51,0 +DA:52,0 +DA:53,0 +DA:54,0 +DA:59,0 +DA:60,0 +DA:64,0 +DA:66,0 +DA:67,0 +DA:70,0 +LF:32 +LH:0 +end_of_record +SF:lib/rum_flutter.dart +DA:99,2 +DA:102,6 +DA:104,2 +DA:105,2 +DA:111,2 +DA:113,4 +DA:128,0 +DA:130,1 +DA:132,1 +DA:135,2 +DA:137,2 +DA:140,1 +DA:142,1 +DA:145,1 +DA:147,1 +DA:148,3 +DA:149,1 +DA:150,1 +DA:151,1 +DA:152,1 +DA:154,1 +DA:156,1 +DA:157,1 +DA:160,1 +DA:161,0 +DA:162,0 +DA:163,1 +DA:165,4 +DA:166,2 +DA:167,1 +DA:168,1 +DA:169,1 +DA:171,1 +DA:172,2 +DA:173,1 +DA:175,3 +DA:176,2 +DA:177,0 +DA:178,0 +DA:179,0 +DA:180,0 +DA:181,0 +DA:182,0 +DA:184,2 +DA:185,1 +DA:186,2 +DA:187,3 +DA:188,2 +DA:189,0 +DA:191,3 +DA:195,1 +DA:196,2 +DA:197,1 +DA:198,2 +DA:200,0 +DA:201,0 +DA:202,0 +DA:203,0 +DA:204,0 +DA:205,0 +DA:211,0 +DA:214,0 +DA:215,0 +DA:216,0 +DA:217,0 +DA:220,1 +DA:224,1 +DA:225,2 +DA:226,7 +DA:229,1 +DA:230,1 +DA:231,2 +DA:232,7 +DA:235,1 +DA:236,1 +DA:237,2 +DA:238,7 +DA:241,1 +DA:242,1 +DA:243,3 +DA:244,3 +DA:246,2 +DA:250,1 +DA:254,1 +DA:255,1 +DA:256,2 +DA:258,3 +DA:260,2 +DA:264,2 +DA:269,2 +DA:271,2 +DA:273,2 +DA:274,2 +DA:275,4 +DA:277,6 +DA:279,4 +DA:283,1 +DA:284,1 +DA:285,3 +DA:286,3 +DA:288,2 +DA:292,0 +DA:293,0 +DA:295,0 +DA:299,0 +DA:301,0 +DA:302,0 +DA:303,0 +DA:304,0 +DA:308,0 +DA:311,0 +DA:312,0 +DA:313,0 +DA:314,0 +DA:315,0 +DA:316,0 +DA:318,0 +LF:117 +LH:80 +end_of_record +SF:lib/rum_native_methods.dart +DA:4,0 +DA:5,0 +DA:7,0 +DA:8,0 +DA:10,0 +DA:11,0 +DA:14,0 +DA:15,0 +DA:18,0 +DA:19,0 +DA:23,0 +DA:24,0 +DA:26,0 +DA:27,0 +DA:29,0 +DA:30,0 +DA:32,0 +DA:33,0 +DA:35,0 +DA:36,0 +DA:38,0 +DA:39,0 +DA:41,0 +DA:42,0 +DA:44,0 +DA:45,0 +DA:48,0 +DA:49,0 +LF:28 +LH:0 +end_of_record +SF:lib/src/rum_widgets_binding_observer.dart +DA:6,0 +DA:8,0 +DA:9,0 +DA:10,0 +DA:11,0 +DA:13,0 +DA:22,0 +DA:24,0 +LF:8 +LH:0 +end_of_record +SF:lib/src/integrations/flutter_error_integration.dart +DA:10,1 +DA:11,2 +DA:12,2 +DA:13,1 +DA:14,4 +DA:17,1 +DA:18,2 +DA:21,1 +DA:24,1 +DA:25,1 +LF:10 +LH:10 +end_of_record +SF:lib/src/integrations/native_integration.dart +DA:11,0 +DA:14,0 +DA:15,0 +DA:16,0 +DA:17,0 +DA:20,0 +DA:21,0 +DA:24,0 +DA:25,0 +DA:26,0 +DA:27,0 +DA:31,0 +DA:32,0 +DA:34,0 +DA:35,0 +DA:36,0 +DA:37,0 +DA:44,0 +DA:51,0 +DA:53,0 +DA:56,0 +DA:58,0 +DA:59,0 +DA:62,0 +DA:63,0 +DA:65,0 +DA:73,0 +DA:74,0 +DA:75,0 +DA:77,0 +DA:84,0 +DA:85,0 +DA:86,0 +DA:87,0 +DA:92,0 +DA:93,0 +DA:94,0 +DA:95,0 +DA:96,0 +DA:100,0 +DA:101,0 +DA:102,0 +DA:107,0 +DA:108,0 +DA:109,0 +DA:110,0 +DA:111,0 +DA:113,0 +DA:115,0 +DA:116,0 +DA:117,0 +DA:121,0 +DA:122,0 +DA:123,0 +DA:124,0 +DA:129,0 +DA:130,0 +DA:131,0 +DA:132,0 +LF:59 +LH:0 +end_of_record +SF:lib/src/util/generate_session.dart +DA:3,2 +DA:5,2 +DA:8,4 +DA:9,8 +LF:4 +LH:4 +end_of_record +SF:lib/src/transport/rum_cache_manager.dart +DA:17,0 +DA:18,0 +DA:21,0 +DA:22,0 +DA:23,0 +DA:24,0 +DA:25,0 +DA:27,0 +DA:30,0 +DA:31,0 +DA:32,0 +DA:33,0 +DA:38,0 +DA:39,0 +DA:40,0 +DA:41,0 +DA:43,0 +DA:44,0 +DA:45,0 +DA:51,0 +DA:52,0 +DA:54,0 +DA:57,0 +DA:60,0 +DA:62,0 +DA:63,0 +DA:64,0 +DA:65,0 +DA:66,0 +DA:67,0 +DA:68,0 +DA:72,0 +DA:74,0 +DA:78,0 +DA:79,0 +DA:80,0 +DA:81,0 +DA:82,0 +DA:87,0 +DA:88,0 +DA:89,0 +DA:90,0 +DA:91,0 +DA:92,0 +DA:93,0 +DA:96,0 +DA:97,0 +DA:99,0 +DA:100,0 +DA:101,0 +DA:104,0 +DA:111,0 +DA:112,0 +DA:113,0 +DA:116,0 +DA:117,0 +DA:121,0 +DA:123,0 +DA:124,0 +DA:125,0 +DA:127,0 +DA:128,0 +DA:129,0 +DA:132,0 +DA:133,0 +DA:134,0 +DA:135,0 +DA:137,0 +LF:68 +LH:0 +end_of_record +SF:lib/src/configurations/rum_config.dart +DA:15,1 +DA:28,2 +DA:29,0 +DA:31,2 +DA:32,0 +DA:34,2 +DA:35,0 +LF:7 +LH:4 +end_of_record +SF:lib/rum_sdk_platform_interface.dart +DA:7,0 +DA:9,0 +DA:11,0 +DA:15,0 +DA:17,0 +DA:18,0 +DA:22,0 +DA:23,0 +DA:25,0 +DA:26,0 +DA:29,0 +DA:30,0 +DA:32,0 +DA:33,0 +DA:35,0 +DA:36,0 +DA:38,0 +DA:39,0 +DA:41,0 +DA:42,0 +DA:44,0 +DA:45,0 +DA:47,0 +DA:48,0 +DA:50,0 +DA:51,0 +DA:53,0 +DA:54,0 +DA:56,0 +DA:57,0 +DA:59,0 +DA:60,0 +DA:63,0 +DA:64,0 +DA:66,0 +DA:67,0 +DA:70,0 +DA:71,0 +LF:38 +LH:0 +end_of_record +SF:lib/rum_sdk_method_channel.dart +DA:12,0 +DA:14,0 +DA:17,0 +DA:19,0 +DA:23,0 +DA:25,0 +DA:29,0 +DA:31,0 +DA:35,0 +DA:37,0 +DA:40,0 +DA:42,0 +DA:47,0 +DA:49,0 +DA:53,0 +DA:55,0 +DA:57,0 +DA:59,0 +DA:62,0 +DA:64,0 +DA:68,0 +DA:70,0 +DA:74,0 +DA:76,0 +DA:80,0 +DA:82,0 +DA:86,0 +DA:88,0 +LF:28 +LH:0 +end_of_record +SF:lib/src/rum_navigation_observer.dart +DA:5,0 +DA:7,0 +DA:8,0 +DA:9,0 +DA:10,0 +DA:15,0 +DA:17,0 +DA:18,0 +DA:19,0 +DA:20,0 +DA:24,0 +DA:26,0 +DA:27,0 +DA:28,0 +DA:29,0 +LF:15 +LH:0 +end_of_record +SF:lib/src/rum_asset_bundle.dart +DA:10,0 +DA:12,0 +DA:14,0 +DA:19,0 +DA:20,0 +DA:21,0 +DA:22,0 +DA:23,0 +DA:24,0 +DA:25,0 +DA:26,0 +DA:28,0 +DA:35,0 +DA:40,0 +DA:41,0 +DA:42,0 +DA:43,0 +DA:44,0 +DA:45,0 +DA:46,0 +DA:47,0 +DA:49,0 +DA:58,0 +DA:60,0 +DA:63,0 +DA:64,0 +DA:68,0 +DA:71,0 +DA:73,0 +DA:74,0 +DA:76,0 +DA:77,0 +DA:79,0 +DA:80,0 +LF:34 +LH:0 +end_of_record +SF:lib/src/rum_user_interaction_widget.dart +DA:18,0 +DA:24,0 +DA:26,0 +DA:28,0 +DA:33,0 +DA:35,0 +DA:42,0 +DA:44,0 +DA:46,0 +DA:47,0 +DA:48,0 +DA:52,0 +DA:53,0 +DA:54,0 +DA:57,0 +DA:58,0 +DA:59,0 +DA:60,0 +DA:61,0 +DA:63,0 +DA:64,0 +DA:65,0 +DA:70,0 +DA:71,0 +DA:73,0 +DA:74,0 +DA:75,0 +DA:76,0 +DA:82,0 +DA:84,0 +DA:88,0 +DA:92,0 +DA:97,0 +DA:98,0 +DA:99,0 +DA:100,0 +DA:101,0 +DA:103,0 +DA:105,0 +DA:107,0 +DA:111,0 +DA:115,0 +DA:118,0 +DA:122,0 +DA:125,0 +DA:128,0 +DA:129,0 +DA:130,0 +DA:131,0 +DA:132,0 +DA:136,0 +DA:137,0 +DA:138,0 +DA:141,0 +DA:142,0 +DA:143,0 +DA:149,0 +DA:152,0 +DA:156,0 +DA:157,0 +DA:158,0 +DA:159,0 +DA:160,0 +DA:163,0 +DA:168,0 +DA:169,0 +DA:170,0 +DA:173,0 +DA:177,0 +DA:178,0 +DA:179,0 +DA:182,0 +DA:186,0 +DA:187,0 +DA:188,0 +DA:191,0 +DA:195,0 +DA:196,0 +DA:197,0 +DA:200,0 +DA:204,0 +DA:205,0 +DA:206,0 +DA:209,0 +DA:213,0 +DA:214,0 +DA:215,0 +DA:218,0 +LF:88 +LH:0 +end_of_record +SF:lib/src/integrations/http_tracking_client.dart +DA:12,0 +DA:14,0 +DA:16,0 +DA:17,0 +DA:18,0 +DA:25,0 +DA:29,0 +DA:34,0 +DA:35,0 +DA:36,0 +DA:37,0 +DA:38,0 +DA:41,0 +DA:46,0 +DA:47,0 +DA:48,0 +DA:51,0 +DA:52,0 +DA:55,0 +DA:58,0 +DA:60,0 +DA:61,0 +DA:62,0 +DA:63,0 +DA:64,0 +DA:72,0 +DA:77,0 +DA:79,0 +DA:80,0 +DA:82,0 +DA:83,0 +DA:84,0 +DA:85,0 +DA:87,0 +DA:88,0 +DA:89,0 +DA:91,0 +DA:93,0 +DA:94,0 +DA:95,0 +DA:96,0 +DA:98,0 +DA:99,0 +DA:100,0 +DA:102,0 +DA:104,0 +DA:105,0 +DA:106,0 +DA:107,0 +DA:109,0 +DA:112,0 +DA:115,0 +DA:118,0 +DA:121,0 +DA:124,0 +DA:126,0 +DA:131,0 +DA:133,0 +DA:137,0 +DA:139,0 +DA:141,0 +DA:144,0 +DA:146,0 +DA:149,0 +DA:150,0 +DA:152,0 +DA:153,0 +DA:155,0 +DA:157,0 +DA:159,0 +DA:160,0 +DA:162,0 +DA:164,0 +DA:166,0 +DA:167,0 +DA:169,0 +DA:171,0 +DA:173,0 +DA:175,0 +DA:177,0 +DA:178,0 +DA:180,0 +DA:182,0 +DA:184,0 +DA:185,0 +DA:187,0 +DA:189,0 +DA:191,0 +DA:192,0 +DA:201,0 +DA:208,0 +DA:210,0 +DA:211,0 +DA:213,0 +DA:218,0 +DA:221,0 +DA:222,0 +DA:223,0 +DA:224,0 +DA:225,0 +DA:226,0 +DA:227,0 +DA:228,0 +DA:230,0 +DA:236,0 +DA:237,0 +DA:238,0 +DA:239,0 +DA:241,0 +DA:242,0 +DA:243,0 +DA:244,0 +DA:246,0 +DA:247,0 +DA:248,0 +DA:249,0 +DA:251,0 +DA:252,0 +DA:253,0 +DA:254,0 +DA:256,0 +DA:257,0 +DA:258,0 +DA:259,0 +DA:261,0 +DA:262,0 +DA:263,0 +DA:265,0 +DA:267,0 +DA:269,0 +DA:271,0 +DA:272,0 +DA:274,0 +DA:276,0 +DA:278,0 +DA:280,0 +DA:283,0 +DA:284,0 +DA:286,0 +DA:287,0 +DA:289,0 +DA:290,0 +DA:292,0 +DA:293,0 +DA:295,0 +DA:296,0 +DA:298,0 +DA:299,0 +DA:301,0 +DA:303,0 +DA:306,0 +DA:308,0 +DA:311,0 +DA:313,0 +DA:316,0 +DA:318,0 +DA:329,0 +DA:335,0 +DA:338,0 +DA:341,0 +DA:345,0 +DA:346,0 +DA:347,0 +DA:348,0 +DA:350,0 +DA:353,0 +DA:354,0 +DA:356,0 +DA:362,0 +DA:363,0 +DA:366,0 +DA:367,0 +DA:369,0 +DA:371,0 +DA:373,0 +DA:374,0 +DA:376,0 +DA:377,0 +DA:379,0 +DA:380,0 +DA:382,0 +DA:384,0 +DA:387,0 +DA:388,0 +DA:390,0 +DA:391,0 +DA:393,0 +DA:394,0 +DA:396,0 +DA:397,0 +DA:399,0 +DA:402,0 +DA:405,0 +DA:406,0 +DA:408,0 +DA:409,0 +LF:196 +LH:0 +end_of_record +SF:lib/src/integrations/run_zoned_integration.dart +DA:5,0 +DA:6,0 +LF:2 +LH:0 +end_of_record +SF:lib/src/integrations/on_error_integration.dart +DA:10,0 +DA:11,0 +DA:12,0 +DA:13,0 +DA:14,0 +DA:15,0 +DA:20,0 +DA:22,0 +DA:24,0 +DA:25,0 +LF:10 +LH:0 +end_of_record +SF:lib/src/models/app.dart +DA:6,2 +DA:8,1 +DA:9,2 +DA:10,2 +DA:11,2 +DA:14,2 +DA:15,2 +DA:17,4 +DA:18,4 +DA:19,4 +LF:10 +LH:10 +end_of_record +SF:lib/src/models/browser.dart +DA:9,0 +DA:12,0 +DA:13,0 +DA:14,0 +DA:15,0 +DA:16,0 +DA:17,0 +DA:18,0 +DA:21,0 +DA:22,0 +DA:23,0 +DA:24,0 +DA:25,0 +DA:26,0 +DA:27,0 +DA:28,0 +LF:16 +LH:0 +end_of_record +SF:lib/src/models/event.dart +DA:9,1 +DA:11,0 +DA:12,0 +DA:13,0 +DA:14,0 +DA:15,0 +DA:18,1 +DA:19,1 +DA:21,2 +DA:22,2 +DA:23,2 +DA:24,2 +LF:12 +LH:7 +end_of_record +SF:lib/src/models/exception.dart +DA:10,1 +DA:11,0 +DA:12,0 +DA:13,0 +DA:14,0 +DA:15,0 +DA:17,1 +DA:18,1 +DA:20,2 +DA:21,2 +DA:22,2 +DA:23,2 +DA:36,2 +DA:38,0 +DA:39,0 +DA:40,0 +DA:41,0 +DA:42,0 +DA:45,2 +DA:46,2 +DA:48,4 +DA:49,4 +DA:50,4 +DA:51,4 +DA:55,1 +DA:56,1 +DA:57,2 +DA:58,1 +DA:59,2 +DA:60,1 +DA:62,1 +DA:63,4 +DA:64,1 +DA:65,0 +DA:66,0 +DA:67,8 +LF:36 +LH:24 +end_of_record +SF:lib/src/models/integrations.dart +DA:5,0 +DA:7,0 +DA:8,0 +DA:9,0 +DA:12,0 +DA:13,0 +DA:15,0 +DA:16,0 +LF:8 +LH:0 +end_of_record +SF:lib/src/models/log.dart +DA:10,1 +DA:12,0 +DA:13,0 +DA:14,0 +DA:15,0 +DA:16,0 +DA:17,0 +DA:20,1 +DA:21,1 +DA:23,2 +DA:24,2 +DA:25,2 +DA:26,2 +DA:27,2 +LF:14 +LH:8 +end_of_record +SF:lib/src/models/measurement.dart +DA:5,1 +DA:7,0 +DA:8,0 +DA:9,0 +DA:12,1 +DA:13,1 +DA:14,2 +DA:15,2 +LF:8 +LH:5 +end_of_record +SF:lib/src/models/meta.dart +DA:18,2 +DA:28,1 +DA:29,1 +DA:30,3 +DA:31,4 +DA:32,4 +DA:33,4 +DA:34,1 +DA:35,1 +DA:36,2 +DA:37,4 +DA:40,2 +DA:41,2 +DA:42,2 +DA:43,6 +DA:45,2 +DA:46,6 +DA:48,2 +DA:49,6 +DA:51,6 +DA:52,2 +DA:53,0 +DA:55,2 +DA:56,0 +DA:58,2 +DA:59,3 +LF:26 +LH:24 +end_of_record +SF:lib/src/models/session.dart +DA:5,2 +DA:7,1 +DA:8,2 +DA:9,2 +DA:12,2 +DA:13,2 +DA:14,4 +DA:15,4 +LF:8 +LH:8 +end_of_record +SF:lib/src/models/sdk.dart +DA:8,2 +DA:10,1 +DA:11,2 +DA:12,2 +DA:13,1 +DA:14,2 +DA:15,2 +DA:16,0 +DA:21,2 +DA:22,2 +DA:23,4 +DA:24,4 +DA:25,8 +LF:13 +LH:12 +end_of_record +SF:lib/src/models/view_meta.dart +DA:4,2 +DA:6,1 +DA:7,2 +DA:10,2 +DA:11,2 +DA:13,4 +LF:6 +LH:6 +end_of_record +SF:lib/src/models/user.dart +DA:6,1 +DA:8,1 +DA:9,2 +DA:10,2 +DA:11,2 +DA:14,1 +DA:15,1 +DA:17,2 +DA:18,2 +DA:19,2 +LF:10 +LH:10 +end_of_record +SF:lib/src/models/page.dart +DA:4,0 +DA:6,0 +DA:7,0 +DA:10,0 +DA:11,0 +DA:12,0 +LF:6 +LH:0 +end_of_record +SF:lib/src/models/payload.dart +DA:8,0 +DA:9,0 +DA:12,0 +DA:13,0 +DA:14,0 +DA:15,0 +DA:16,0 +DA:19,0 +DA:23,0 +DA:24,0 +DA:26,0 +DA:28,0 +DA:29,0 +LF:13 +LH:0 +end_of_record diff --git a/packages/rum_sdk/example/.gitignore b/packages/rum_sdk/example/.gitignore new file mode 100644 index 0000000..47d30cf --- /dev/null +++ b/packages/rum_sdk/example/.gitignore @@ -0,0 +1,45 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +*.env +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/packages/rum_sdk/example/README.md b/packages/rum_sdk/example/README.md new file mode 100644 index 0000000..ae210d9 --- /dev/null +++ b/packages/rum_sdk/example/README.md @@ -0,0 +1,16 @@ +# rum_sdk_example + +Demonstrates how to use the rum_sdk plugin. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/packages/rum_sdk/example/analysis_options.yaml b/packages/rum_sdk/example/analysis_options.yaml new file mode 100644 index 0000000..61b6c4d --- /dev/null +++ b/packages/rum_sdk/example/analysis_options.yaml @@ -0,0 +1,29 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/rum_sdk/example/android/.gitignore b/packages/rum_sdk/example/android/.gitignore new file mode 100644 index 0000000..6f56801 --- /dev/null +++ b/packages/rum_sdk/example/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/packages/rum_sdk/example/android/app/build.gradle b/packages/rum_sdk/example/android/app/build.gradle new file mode 100644 index 0000000..6b7e7c7 --- /dev/null +++ b/packages/rum_sdk/example/android/app/build.gradle @@ -0,0 +1,72 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + defaultConfig{ + minSdkVersion flutter.minSdkVersion + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.rum_sdk_example" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +configurations.all { + resolutionStrategy { + eachDependency { + if ((requested.group == "org.jetbrains.kotlin") && (requested.name.startsWith("kotlin-stdlib"))) { + useVersion("1.8.0") + } + } + } +} + + +flutter { + source '../..' +} diff --git a/packages/rum_sdk/example/android/app/src/debug/AndroidManifest.xml b/packages/rum_sdk/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..8de1a84 --- /dev/null +++ b/packages/rum_sdk/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + diff --git a/packages/rum_sdk/example/android/app/src/main/AndroidManifest.xml b/packages/rum_sdk/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..477e8ae --- /dev/null +++ b/packages/rum_sdk/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + diff --git a/packages/rum_sdk/example/android/app/src/main/java/com/example/rum_sdk_example/MainActivity.java b/packages/rum_sdk/example/android/app/src/main/java/com/example/rum_sdk_example/MainActivity.java new file mode 100644 index 0000000..495be61 --- /dev/null +++ b/packages/rum_sdk/example/android/app/src/main/java/com/example/rum_sdk_example/MainActivity.java @@ -0,0 +1,6 @@ +package com.example.rum_sdk_example; + +import io.flutter.embedding.android.FlutterActivity; + +public class MainActivity extends FlutterActivity { +} diff --git a/packages/rum_sdk/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/rum_sdk/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/packages/rum_sdk/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/rum_sdk/example/android/app/src/main/res/drawable/launch_background.xml b/packages/rum_sdk/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/packages/rum_sdk/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/rum_sdk/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/rum_sdk/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..db77bb4 Binary files /dev/null and b/packages/rum_sdk/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/packages/rum_sdk/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/rum_sdk/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..17987b7 Binary files /dev/null and b/packages/rum_sdk/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/packages/rum_sdk/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/rum_sdk/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..09d4391 Binary files /dev/null and b/packages/rum_sdk/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/packages/rum_sdk/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/rum_sdk/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..d5f1c8d Binary files /dev/null and b/packages/rum_sdk/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/packages/rum_sdk/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/rum_sdk/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..4d6372e Binary files /dev/null and b/packages/rum_sdk/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/packages/rum_sdk/example/android/app/src/main/res/values-night/styles.xml b/packages/rum_sdk/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/packages/rum_sdk/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/rum_sdk/example/android/app/src/main/res/values/styles.xml b/packages/rum_sdk/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/packages/rum_sdk/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/rum_sdk/example/android/app/src/profile/AndroidManifest.xml b/packages/rum_sdk/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..8de1a84 --- /dev/null +++ b/packages/rum_sdk/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + diff --git a/packages/rum_sdk/example/android/build.gradle b/packages/rum_sdk/example/android/build.gradle new file mode 100644 index 0000000..713d7f6 --- /dev/null +++ b/packages/rum_sdk/example/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.7.10' + repositories { + google() + mavenCentral() + } + + dependencies { + classpath 'com.android.tools.build:gradle:7.2.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/packages/rum_sdk/example/android/gradle.properties b/packages/rum_sdk/example/android/gradle.properties new file mode 100644 index 0000000..94adc3a --- /dev/null +++ b/packages/rum_sdk/example/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/rum_sdk/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/rum_sdk/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..3c472b9 --- /dev/null +++ b/packages/rum_sdk/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/rum_sdk/example/android/settings.gradle b/packages/rum_sdk/example/android/settings.gradle new file mode 100644 index 0000000..44e62bc --- /dev/null +++ b/packages/rum_sdk/example/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/packages/rum_sdk/example/ios/.gitignore b/packages/rum_sdk/example/ios/.gitignore new file mode 100644 index 0000000..7a7f987 --- /dev/null +++ b/packages/rum_sdk/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/rum_sdk/example/ios/Flutter/AppFrameworkInfo.plist b/packages/rum_sdk/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..7c56964 --- /dev/null +++ b/packages/rum_sdk/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/packages/rum_sdk/example/ios/Flutter/Debug.xcconfig b/packages/rum_sdk/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..ec97fc6 --- /dev/null +++ b/packages/rum_sdk/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/rum_sdk/example/ios/Flutter/Release.xcconfig b/packages/rum_sdk/example/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..c4855bf --- /dev/null +++ b/packages/rum_sdk/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/rum_sdk/example/ios/Podfile b/packages/rum_sdk/example/ios/Podfile new file mode 100644 index 0000000..b2e48e4 --- /dev/null +++ b/packages/rum_sdk/example/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +# target 'RunnerTests' do +# inherit! :search_paths +# end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/packages/rum_sdk/example/ios/Podfile.lock b/packages/rum_sdk/example/ios/Podfile.lock new file mode 100644 index 0000000..9b1e3a8 --- /dev/null +++ b/packages/rum_sdk/example/ios/Podfile.lock @@ -0,0 +1,42 @@ +PODS: + - connectivity_plus (0.0.1): + - Flutter + - FlutterMacOS + - Flutter (1.0.0) + - package_info_plus (0.4.5): + - Flutter + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - rum_sdk (0.0.1): + - Flutter + +DEPENDENCIES: + - connectivity_plus (from `.symlinks/plugins/connectivity_plus/darwin`) + - Flutter (from `Flutter`) + - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) + - rum_sdk (from `.symlinks/plugins/rum_sdk/ios`) + +EXTERNAL SOURCES: + connectivity_plus: + :path: ".symlinks/plugins/connectivity_plus/darwin" + Flutter: + :path: Flutter + package_info_plus: + :path: ".symlinks/plugins/package_info_plus/ios" + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/darwin" + rum_sdk: + :path: ".symlinks/plugins/rum_sdk/ios" + +SPEC CHECKSUMS: + connectivity_plus: ddd7f30999e1faaef5967c23d5b6d503d10434db + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + package_info_plus: 58f0028419748fad15bf008b270aaa8e54380b1c + path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 + rum_sdk: 2cee506ef84f6a892c36dba29379155637637bdf + +PODFILE CHECKSUM: 3765b805c03121794c6d132546df9366f592bc4d + +COCOAPODS: 1.15.2 diff --git a/packages/rum_sdk/example/ios/Runner.xcodeproj/project.pbxproj b/packages/rum_sdk/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..6447d49 --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,552 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 689A236AB206B0DEED12B4C6 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E87B3D449CA8A66D0AF84C6 /* Pods_Runner.framework */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 0C1DD36C2953AD9E90259918 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 5E87B3D449CA8A66D0AF84C6 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 64AE679C69D47E2AB4CD7026 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 81B89DBE1D2FA486444C9F32 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 689A236AB206B0DEED12B4C6 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3FA500CBDF59B27BC58EFA51 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 5E87B3D449CA8A66D0AF84C6 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + DD3BF66714472D65B799557B /* Pods */, + 3FA500CBDF59B27BC58EFA51 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; + DD3BF66714472D65B799557B /* Pods */ = { + isa = PBXGroup; + children = ( + 81B89DBE1D2FA486444C9F32 /* Pods-Runner.debug.xcconfig */, + 0C1DD36C2953AD9E90259918 /* Pods-Runner.release.xcconfig */, + 64AE679C69D47E2AB4CD7026 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 420FA4733DD030299BDDA569 /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + EADA3A9B249301D6C082F4FD /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 420FA4733DD030299BDDA569 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + EADA3A9B249301D6C082F4FD /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.rumSdkExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.rumSdkExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.rumSdkExample; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/rum_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/rum_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/rum_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/rum_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/rum_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/rum_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/rum_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/rum_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..5e31d3d --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/rum_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/rum_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..21a3cc1 --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/rum_sdk/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/rum_sdk/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/rum_sdk/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/rum_sdk/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/rum_sdk/example/ios/Runner/AppDelegate.swift b/packages/rum_sdk/example/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..70693e4 --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000..dc9ada4 Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..7353c41 Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..6ed2d93 Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..4cd7b00 Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..fe73094 Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..321773c Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..797d452 Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..502f463 Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..0ec3034 Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..e9f5fea Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..84ac32a Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..8953cba Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..0467bf1 Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/rum_sdk/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/rum_sdk/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/rum_sdk/example/ios/Runner/Base.lproj/Main.storyboard b/packages/rum_sdk/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..9867a9a --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/rum_sdk/example/ios/Runner/Info.plist b/packages/rum_sdk/example/ios/Runner/Info.plist new file mode 100644 index 0000000..7020f60 --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner/Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Rum Sdk + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + rum_sdk_example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/packages/rum_sdk/example/ios/Runner/Runner-Bridging-Header.h b/packages/rum_sdk/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/packages/rum_sdk/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/packages/rum_sdk/example/ios/RunnerTests/RunnerTests.swift b/packages/rum_sdk/example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/packages/rum_sdk/example/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/packages/rum_sdk/example/lib/main.dart b/packages/rum_sdk/example/lib/main.dart new file mode 100644 index 0000000..aa00f64 --- /dev/null +++ b/packages/rum_sdk/example/lib/main.dart @@ -0,0 +1,233 @@ +import 'dart:convert'; +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:offline_transport/offline_transport.dart'; +import 'package:rum_sdk/rum_sdk.dart'; +import 'package:flutter_dotenv/flutter_dotenv.dart'; +import 'package:http/http.dart' as http; + +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + HttpOverrides.global = RumHttpOverrides(HttpOverrides.current); + await dotenv.load(fileName: ".env"); + RumFlutter().transports.add( + OfflineTransport(maxCacheDuration: const Duration(days: 3)) + ); + await RumFlutter().runApp( optionsConfiguration: + RumConfig( + appName: "example_app", + appVersion: "2.0.1", + appEnv: "Test", + apiKey: "api_key", + anrTracking: true, + cpuUsageVitals: true, + collectorUrl: "http://10.0.2.2:8027/collect", + enableCrashReporting: true, + memoryUsageVitals: true, + refreshRateVitals: true, + fetchVitalsInterval: const Duration(seconds: 30), + ), + appRunner: () async { + runApp( DefaultAssetBundle(bundle: RumAssetBundle(), child: const RumUserInteractionWidget(child: MyApp())) + ); + } + ); +} + + + +class MyApp extends StatefulWidget { + const MyApp({super.key}); + + @override + State createState() => _MyAppState(); +} + +class _MyAppState extends State { + // test + // final _rumSdkPlugin = RumSdkPlatform.instance; + + @override + void initState() { + super.initState(); + setState(() { + }); + } + + + + + @override + Widget build(BuildContext context) { + return MaterialApp( + navigatorObservers: [RumNavigationObserver()], + initialRoute: '/', + routes: { + '/home': (context) => const HomePage(), + '/features': (context) => const FeaturesPage() + }, + home: Scaffold( + appBar: AppBar( + title: const Text('RUM Test App'), + ), + body: + const HomePage() + ) + ); + } +} + +class HomePage extends StatefulWidget{ + const HomePage({Key? key}) : super(key: key); + + @override + _HomePageState createState() => _HomePageState(); +} +class _HomePageState extends State{ + + @override + void initState() { + super.initState(); + } + @override + Widget build(BuildContext context){ + return Center( + child:Column( + mainAxisAlignment: MainAxisAlignment.center, // Center vertically + crossAxisAlignment: CrossAxisAlignment.center, // Center horizontally + children: [ + const Image(image: AssetImage("assets/AppHomeImage.png"),), + ElevatedButton( + child: const Text("Change Route"), + onPressed:(){ + Navigator.pushNamed(context,'/features'); + } + ), + ] + ) + ); + } + +} + +class _FeaturesPageState extends State { + + @override + void initState() { + super.initState(); + RumFlutter().markEventEnd("home_event_start", "home_page_load"); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Features'), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + + ElevatedButton( + onPressed: () async { + final response = await http.post( + Uri.parse('http://10.0.2.2:4000/failpost/'), + body: jsonEncode({ + 'title': "This is a title", + }), + ); + }, + child: const Text('HTTP POST Request - fail'), + ), + ElevatedButton( + onPressed: () async { + final response = await http.post( + Uri.parse('http://10.0.2.2:4000/successpost/'), + body: jsonEncode({ + 'title': "This is a title", + }), + ); + }, + child: const Text('HTTP POST Request - success'), + ), + ElevatedButton( + onPressed: () async { + final response = await http + .get(Uri.parse('http://10.0.2.2:4000/successpath/')); + }, + child: const Text('HTTP GET Request - success'), + ), + ElevatedButton( + onPressed: () async { + final response = await http + .get(Uri.parse('http://10.0.2.2:4000/failpath/')); + }, + child: const Text('HTTP GET Request - fail'), + ), + + ElevatedButton( + onPressed: () { + RumFlutter().pushLog("Custom Log",level: "warn"); + }, + child: const Text('Custom Warn Log'), + ), + + ElevatedButton( + onPressed: () { + RumFlutter().pushMeasurement({'customvalue': 1}, "custom_measurement"); + }, + child: const Text('Custom Measurement'), + ), + + ElevatedButton( + onPressed: () { + RumFlutter().pushEvent("custom_event"); + }, + child: const Text('Custom Event'), + ), + + ElevatedButton( + onPressed: () { + setState(() { + throw Error(); + }); + }, + child: Text('Error'), + ), + ElevatedButton( + onPressed: () { + setState(() { + double a = 0/0; + throw Exception("This is an Exception!"); + }); + }, + child: Text('Exception'), + ), + ElevatedButton( + onPressed: () async { + RumFlutter().markEventStart("event1","event1_duration"); + }, + child: const Text('Mark Event Start'), + ), + ElevatedButton( + onPressed: () async { + RumFlutter().markEventEnd("event1","event1_duration"); + }, + child: const Text('Mark Event End'), + ), + const SizedBox(height: 16), + ], + ), + ), + ); + } +} + +class FeaturesPage extends StatefulWidget { + const FeaturesPage({Key? key}) : super(key: key); + + @override + _FeaturesPageState createState() => _FeaturesPageState(); +} diff --git a/packages/rum_sdk/example/linux/.gitignore b/packages/rum_sdk/example/linux/.gitignore new file mode 100644 index 0000000..d3896c9 --- /dev/null +++ b/packages/rum_sdk/example/linux/.gitignore @@ -0,0 +1 @@ +flutter/ephemeral diff --git a/packages/rum_sdk/example/linux/CMakeLists.txt b/packages/rum_sdk/example/linux/CMakeLists.txt new file mode 100644 index 0000000..e780cc9 --- /dev/null +++ b/packages/rum_sdk/example/linux/CMakeLists.txt @@ -0,0 +1,138 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.10) +project(runner LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "rum_sdk_example") +# The unique GTK application identifier for this application. See: +# https://wiki.gnome.org/HowDoI/ChooseApplicationID +set(APPLICATION_ID "com.example.rum_sdk") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Load bundled libraries from the lib/ directory relative to the binary. +set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") + +# Root filesystem for cross-building. +if(FLUTTER_TARGET_PLATFORM_SYSROOT) + set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() + +# Define build configuration options. +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") +endif() + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_14) + target_compile_options(${TARGET} PRIVATE -Wall -Werror) + target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") + target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) + +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Define the application target. To change its name, change BINARY_NAME above, +# not the value here, or `flutter run` will no longer work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) + +# Only the install-generated bundle's copy of the executable will launch +# correctly, since the resources must in the right relative locations. To avoid +# people trying to run the unbundled copy, put it in a subdirectory instead of +# the default top-level location. +set_target_properties(${BINARY_NAME} + PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" +) + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# By default, "installing" just makes a relocatable bundle in the build +# directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +# Start with a clean build bundle directory every time. +install(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) + install(FILES "${bundled_library}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endforeach(bundled_library) + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") + install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() diff --git a/packages/rum_sdk/example/linux/flutter/CMakeLists.txt b/packages/rum_sdk/example/linux/flutter/CMakeLists.txt new file mode 100644 index 0000000..d5bd016 --- /dev/null +++ b/packages/rum_sdk/example/linux/flutter/CMakeLists.txt @@ -0,0 +1,88 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.10) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. + +# Serves the same purpose as list(TRANSFORM ... PREPEND ...), +# which isn't available in 3.10. +function(list_prepend LIST_NAME PREFIX) + set(NEW_LIST "") + foreach(element ${${LIST_NAME}}) + list(APPEND NEW_LIST "${PREFIX}${element}") + endforeach(element) + set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) +endfunction() + +# === Flutter Library === +# System-level dependencies. +find_package(PkgConfig REQUIRED) +pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) +pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) +pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) + +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "fl_basic_message_channel.h" + "fl_binary_codec.h" + "fl_binary_messenger.h" + "fl_dart_project.h" + "fl_engine.h" + "fl_json_message_codec.h" + "fl_json_method_codec.h" + "fl_message_codec.h" + "fl_method_call.h" + "fl_method_channel.h" + "fl_method_codec.h" + "fl_method_response.h" + "fl_plugin_registrar.h" + "fl_plugin_registry.h" + "fl_standard_message_codec.h" + "fl_standard_method_codec.h" + "fl_string_codec.h" + "fl_value.h" + "fl_view.h" + "flutter_linux.h" +) +list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") +target_link_libraries(flutter INTERFACE + PkgConfig::GTK + PkgConfig::GLIB + PkgConfig::GIO +) +add_dependencies(flutter flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/_phony_ + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} +) diff --git a/packages/rum_sdk/example/linux/flutter/generated_plugin_registrant.cc b/packages/rum_sdk/example/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..675f114 --- /dev/null +++ b/packages/rum_sdk/example/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include + +void fl_register_plugins(FlPluginRegistry* registry) { + g_autoptr(FlPluginRegistrar) rum_sdk_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "RumSdkPlugin"); + rum_sdk_plugin_register_with_registrar(rum_sdk_registrar); +} diff --git a/packages/rum_sdk/example/linux/flutter/generated_plugin_registrant.h b/packages/rum_sdk/example/linux/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..e0f0a47 --- /dev/null +++ b/packages/rum_sdk/example/linux/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void fl_register_plugins(FlPluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/packages/rum_sdk/example/linux/flutter/generated_plugins.cmake b/packages/rum_sdk/example/linux/flutter/generated_plugins.cmake new file mode 100644 index 0000000..a8bd8df --- /dev/null +++ b/packages/rum_sdk/example/linux/flutter/generated_plugins.cmake @@ -0,0 +1,24 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + rum_sdk +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/packages/rum_sdk/example/linux/main.cc b/packages/rum_sdk/example/linux/main.cc new file mode 100644 index 0000000..e7c5c54 --- /dev/null +++ b/packages/rum_sdk/example/linux/main.cc @@ -0,0 +1,6 @@ +#include "my_application.h" + +int main(int argc, char** argv) { + g_autoptr(MyApplication) app = my_application_new(); + return g_application_run(G_APPLICATION(app), argc, argv); +} diff --git a/packages/rum_sdk/example/linux/my_application.cc b/packages/rum_sdk/example/linux/my_application.cc new file mode 100644 index 0000000..e7cdbdb --- /dev/null +++ b/packages/rum_sdk/example/linux/my_application.cc @@ -0,0 +1,104 @@ +#include "my_application.h" + +#include +#ifdef GDK_WINDOWING_X11 +#include +#endif + +#include "flutter/generated_plugin_registrant.h" + +struct _MyApplication { + GtkApplication parent_instance; + char** dart_entrypoint_arguments; +}; + +G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) + +// Implements GApplication::activate. +static void my_application_activate(GApplication* application) { + MyApplication* self = MY_APPLICATION(application); + GtkWindow* window = + GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); + + // Use a header bar when running in GNOME as this is the common style used + // by applications and is the setup most users will be using (e.g. Ubuntu + // desktop). + // If running on X and not using GNOME then just use a traditional title bar + // in case the window manager does more exotic layout, e.g. tiling. + // If running on Wayland assume the header bar will work (may need changing + // if future cases occur). + gboolean use_header_bar = TRUE; +#ifdef GDK_WINDOWING_X11 + GdkScreen* screen = gtk_window_get_screen(window); + if (GDK_IS_X11_SCREEN(screen)) { + const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); + if (g_strcmp0(wm_name, "GNOME Shell") != 0) { + use_header_bar = FALSE; + } + } +#endif + if (use_header_bar) { + GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); + gtk_widget_show(GTK_WIDGET(header_bar)); + gtk_header_bar_set_title(header_bar, "rum_sdk_example"); + gtk_header_bar_set_show_close_button(header_bar, TRUE); + gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); + } else { + gtk_window_set_title(window, "rum_sdk_example"); + } + + gtk_window_set_default_size(window, 1280, 720); + gtk_widget_show(GTK_WIDGET(window)); + + g_autoptr(FlDartProject) project = fl_dart_project_new(); + fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); + + FlView* view = fl_view_new(project); + gtk_widget_show(GTK_WIDGET(view)); + gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); + + gtk_widget_grab_focus(GTK_WIDGET(view)); +} + +// Implements GApplication::local_command_line. +static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { + MyApplication* self = MY_APPLICATION(application); + // Strip out the first argument as it is the binary name. + self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); + + g_autoptr(GError) error = nullptr; + if (!g_application_register(application, nullptr, &error)) { + g_warning("Failed to register: %s", error->message); + *exit_status = 1; + return TRUE; + } + + g_application_activate(application); + *exit_status = 0; + + return TRUE; +} + +// Implements GObject::dispose. +static void my_application_dispose(GObject* object) { + MyApplication* self = MY_APPLICATION(object); + g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); + G_OBJECT_CLASS(my_application_parent_class)->dispose(object); +} + +static void my_application_class_init(MyApplicationClass* klass) { + G_APPLICATION_CLASS(klass)->activate = my_application_activate; + G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; + G_OBJECT_CLASS(klass)->dispose = my_application_dispose; +} + +static void my_application_init(MyApplication* self) {} + +MyApplication* my_application_new() { + return MY_APPLICATION(g_object_new(my_application_get_type(), + "application-id", APPLICATION_ID, + "flags", G_APPLICATION_NON_UNIQUE, + nullptr)); +} diff --git a/packages/rum_sdk/example/linux/my_application.h b/packages/rum_sdk/example/linux/my_application.h new file mode 100644 index 0000000..72271d5 --- /dev/null +++ b/packages/rum_sdk/example/linux/my_application.h @@ -0,0 +1,18 @@ +#ifndef FLUTTER_MY_APPLICATION_H_ +#define FLUTTER_MY_APPLICATION_H_ + +#include + +G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, + GtkApplication) + +/** + * my_application_new: + * + * Creates a new Flutter-based application. + * + * Returns: a new #MyApplication. + */ +MyApplication* my_application_new(); + +#endif // FLUTTER_MY_APPLICATION_H_ diff --git a/packages/rum_sdk/example/macos/.gitignore b/packages/rum_sdk/example/macos/.gitignore new file mode 100644 index 0000000..746adbb --- /dev/null +++ b/packages/rum_sdk/example/macos/.gitignore @@ -0,0 +1,7 @@ +# Flutter-related +**/Flutter/ephemeral/ +**/Pods/ + +# Xcode-related +**/dgph +**/xcuserdata/ diff --git a/packages/rum_sdk/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/rum_sdk/example/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 0000000..4b81f9b --- /dev/null +++ b/packages/rum_sdk/example/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/rum_sdk/example/macos/Flutter/Flutter-Release.xcconfig b/packages/rum_sdk/example/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 0000000..5caa9d1 --- /dev/null +++ b/packages/rum_sdk/example/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/rum_sdk/example/macos/Flutter/GeneratedPluginRegistrant.swift b/packages/rum_sdk/example/macos/Flutter/GeneratedPluginRegistrant.swift new file mode 100644 index 0000000..6be1f8d --- /dev/null +++ b/packages/rum_sdk/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -0,0 +1,18 @@ +// +// Generated file. Do not edit. +// + +import FlutterMacOS +import Foundation + +import connectivity_plus +import package_info_plus +import path_provider_foundation +import rum_sdk + +func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) + FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) + PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) + RumSdkPlugin.register(with: registry.registrar(forPlugin: "RumSdkPlugin")) +} diff --git a/packages/rum_sdk/example/macos/Podfile b/packages/rum_sdk/example/macos/Podfile new file mode 100644 index 0000000..c795730 --- /dev/null +++ b/packages/rum_sdk/example/macos/Podfile @@ -0,0 +1,43 @@ +platform :osx, '10.14' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_macos_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_macos_build_settings(target) + end +end diff --git a/packages/rum_sdk/example/macos/Runner.xcodeproj/project.pbxproj b/packages/rum_sdk/example/macos/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..305f464 --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,573 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXAggregateTarget section */ + 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; + buildPhases = ( + 33CC111E2044C6BF0003C045 /* ShellScript */, + ); + dependencies = ( + ); + name = "Flutter Assemble"; + productName = FLX; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 33CC10E52044A3C60003C045 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 33CC111A2044C6BA0003C045; + remoteInfo = FLX; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 33CC110E2044A8840003C045 /* Bundle Framework */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Bundle Framework"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; + 33CC10ED2044A3C60003C045 /* rum_sdk_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "rum_sdk_example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; + 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; + 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; + 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; + 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 33CC10EA2044A3C60003C045 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 33BA886A226E78AF003329D5 /* Configs */ = { + isa = PBXGroup; + children = ( + 33E5194F232828860026EE4D /* AppInfo.xcconfig */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, + ); + path = Configs; + sourceTree = ""; + }; + 33CC10E42044A3C60003C045 = { + isa = PBXGroup; + children = ( + 33FAB671232836740065AC1E /* Runner */, + 33CEB47122A05771004F2AC0 /* Flutter */, + 33CC10EE2044A3C60003C045 /* Products */, + D73912EC22F37F3D000D13A0 /* Frameworks */, + ); + sourceTree = ""; + }; + 33CC10EE2044A3C60003C045 /* Products */ = { + isa = PBXGroup; + children = ( + 33CC10ED2044A3C60003C045 /* rum_sdk_example.app */, + ); + name = Products; + sourceTree = ""; + }; + 33CC11242044D66E0003C045 /* Resources */ = { + isa = PBXGroup; + children = ( + 33CC10F22044A3C60003C045 /* Assets.xcassets */, + 33CC10F42044A3C60003C045 /* MainMenu.xib */, + 33CC10F72044A3C60003C045 /* Info.plist */, + ); + name = Resources; + path = ..; + sourceTree = ""; + }; + 33CEB47122A05771004F2AC0 /* Flutter */ = { + isa = PBXGroup; + children = ( + 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, + 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, + 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, + 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, + ); + path = Flutter; + sourceTree = ""; + }; + 33FAB671232836740065AC1E /* Runner */ = { + isa = PBXGroup; + children = ( + 33CC10F02044A3C60003C045 /* AppDelegate.swift */, + 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, + 33E51913231747F40026EE4D /* DebugProfile.entitlements */, + 33E51914231749380026EE4D /* Release.entitlements */, + 33CC11242044D66E0003C045 /* Resources */, + 33BA886A226E78AF003329D5 /* Configs */, + ); + path = Runner; + sourceTree = ""; + }; + D73912EC22F37F3D000D13A0 /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 33CC10EC2044A3C60003C045 /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 33CC10E92044A3C60003C045 /* Sources */, + 33CC10EA2044A3C60003C045 /* Frameworks */, + 33CC10EB2044A3C60003C045 /* Resources */, + 33CC110E2044A8840003C045 /* Bundle Framework */, + 3399D490228B24CF009A79C7 /* ShellScript */, + ); + buildRules = ( + ); + dependencies = ( + 33CC11202044C79F0003C045 /* PBXTargetDependency */, + ); + name = Runner; + productName = Runner; + productReference = 33CC10ED2044A3C60003C045 /* rum_sdk_example.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 33CC10E52044A3C60003C045 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 33CC10EC2044A3C60003C045 = { + CreatedOnToolsVersion = 9.2; + LastSwiftMigration = 1100; + ProvisioningStyle = Automatic; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + 33CC111A2044C6BA0003C045 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Manual; + }; + }; + }; + buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 33CC10E42044A3C60003C045; + productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 33CC10EC2044A3C60003C045 /* Runner */, + 33CC111A2044C6BA0003C045 /* Flutter Assemble */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 33CC10EB2044A3C60003C045 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, + 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3399D490228B24CF009A79C7 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; + }; + 33CC111E2044C6BF0003C045 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + Flutter/ephemeral/FlutterInputs.xcfilelist, + ); + inputPaths = ( + Flutter/ephemeral/tripwire, + ); + outputFileListPaths = ( + Flutter/ephemeral/FlutterOutputs.xcfilelist, + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 33CC10E92044A3C60003C045 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, + 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, + 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; + targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 33CC10F52044A3C60003C045 /* Base */, + ); + name = MainMenu.xib; + path = Runner; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 338D0CE9231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Profile; + }; + 338D0CEA231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Profile; + }; + 338D0CEB231458BD00FA5F75 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Profile; + }; + 33CC10F92044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 33CC10FA2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + 33CC10FC2044A3C60003C045 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 33CC10FD2044A3C60003C045 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 33CC111C2044C6BA0003C045 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Manual; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 33CC111D2044C6BA0003C045 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10F92044A3C60003C045 /* Debug */, + 33CC10FA2044A3C60003C045 /* Release */, + 338D0CE9231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC10FC2044A3C60003C045 /* Debug */, + 33CC10FD2044A3C60003C045 /* Release */, + 338D0CEA231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 33CC111C2044C6BA0003C045 /* Debug */, + 33CC111D2044C6BA0003C045 /* Release */, + 338D0CEB231458BD00FA5F75 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 33CC10E52044A3C60003C045 /* Project object */; +} diff --git a/packages/rum_sdk/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/rum_sdk/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/rum_sdk/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/rum_sdk/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..0449f9a --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/rum_sdk/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/packages/rum_sdk/example/macos/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/rum_sdk/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/rum_sdk/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/rum_sdk/example/macos/Runner/AppDelegate.swift b/packages/rum_sdk/example/macos/Runner/AppDelegate.swift new file mode 100644 index 0000000..d53ef64 --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner/AppDelegate.swift @@ -0,0 +1,9 @@ +import Cocoa +import FlutterMacOS + +@NSApplicationMain +class AppDelegate: FlutterAppDelegate { + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return true + } +} diff --git a/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..a2ec33f --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,68 @@ +{ + "images" : [ + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_16.png", + "scale" : "1x" + }, + { + "size" : "16x16", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "2x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_32.png", + "scale" : "1x" + }, + { + "size" : "32x32", + "idiom" : "mac", + "filename" : "app_icon_64.png", + "scale" : "2x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_128.png", + "scale" : "1x" + }, + { + "size" : "128x128", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "2x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_256.png", + "scale" : "1x" + }, + { + "size" : "256x256", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "2x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_512.png", + "scale" : "1x" + }, + { + "size" : "512x512", + "idiom" : "mac", + "filename" : "app_icon_1024.png", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png new file mode 100644 index 0000000..82b6f9d Binary files /dev/null and b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png differ diff --git a/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png new file mode 100644 index 0000000..13b35eb Binary files /dev/null and b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png differ diff --git a/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png new file mode 100644 index 0000000..0a3f5fa Binary files /dev/null and b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png differ diff --git a/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png new file mode 100644 index 0000000..bdb5722 Binary files /dev/null and b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png differ diff --git a/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png new file mode 100644 index 0000000..f083318 Binary files /dev/null and b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png differ diff --git a/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png new file mode 100644 index 0000000..326c0e7 Binary files /dev/null and b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png differ diff --git a/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png new file mode 100644 index 0000000..2f1632c Binary files /dev/null and b/packages/rum_sdk/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png differ diff --git a/packages/rum_sdk/example/macos/Runner/Base.lproj/MainMenu.xib b/packages/rum_sdk/example/macos/Runner/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..80e867a --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner/Base.lproj/MainMenu.xib @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/rum_sdk/example/macos/Runner/Configs/AppInfo.xcconfig b/packages/rum_sdk/example/macos/Runner/Configs/AppInfo.xcconfig new file mode 100644 index 0000000..98358d3 --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner/Configs/AppInfo.xcconfig @@ -0,0 +1,14 @@ +// Application-level settings for the Runner target. +// +// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the +// future. If not, the values below would default to using the project name when this becomes a +// 'flutter create' template. + +// The application's name. By default this is also the title of the Flutter window. +PRODUCT_NAME = rum_sdk_example + +// The application's bundle identifier +PRODUCT_BUNDLE_IDENTIFIER = com.example.rumSdkExample + +// The copyright displayed in application information +PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. diff --git a/packages/rum_sdk/example/macos/Runner/Configs/Debug.xcconfig b/packages/rum_sdk/example/macos/Runner/Configs/Debug.xcconfig new file mode 100644 index 0000000..36b0fd9 --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner/Configs/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Debug.xcconfig" +#include "Warnings.xcconfig" diff --git a/packages/rum_sdk/example/macos/Runner/Configs/Release.xcconfig b/packages/rum_sdk/example/macos/Runner/Configs/Release.xcconfig new file mode 100644 index 0000000..dff4f49 --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner/Configs/Release.xcconfig @@ -0,0 +1,2 @@ +#include "../../Flutter/Flutter-Release.xcconfig" +#include "Warnings.xcconfig" diff --git a/packages/rum_sdk/example/macos/Runner/Configs/Warnings.xcconfig b/packages/rum_sdk/example/macos/Runner/Configs/Warnings.xcconfig new file mode 100644 index 0000000..42bcbf4 --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner/Configs/Warnings.xcconfig @@ -0,0 +1,13 @@ +WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings +GCC_WARN_UNDECLARED_SELECTOR = YES +CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES +CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE +CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +CLANG_WARN_PRAGMA_PACK = YES +CLANG_WARN_STRICT_PROTOTYPES = YES +CLANG_WARN_COMMA = YES +GCC_WARN_STRICT_SELECTOR_MATCH = YES +CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES +CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +GCC_WARN_SHADOW = YES +CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/packages/rum_sdk/example/macos/Runner/DebugProfile.entitlements b/packages/rum_sdk/example/macos/Runner/DebugProfile.entitlements new file mode 100644 index 0000000..dddb8a3 --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner/DebugProfile.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.cs.allow-jit + + com.apple.security.network.server + + + diff --git a/packages/rum_sdk/example/macos/Runner/Info.plist b/packages/rum_sdk/example/macos/Runner/Info.plist new file mode 100644 index 0000000..4789daa --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + $(PRODUCT_COPYRIGHT) + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/packages/rum_sdk/example/macos/Runner/MainFlutterWindow.swift b/packages/rum_sdk/example/macos/Runner/MainFlutterWindow.swift new file mode 100644 index 0000000..2722837 --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner/MainFlutterWindow.swift @@ -0,0 +1,15 @@ +import Cocoa +import FlutterMacOS + +class MainFlutterWindow: NSWindow { + override func awakeFromNib() { + let flutterViewController = FlutterViewController.init() + let windowFrame = self.frame + self.contentViewController = flutterViewController + self.setFrame(windowFrame, display: true) + + RegisterGeneratedPlugins(registry: flutterViewController) + + super.awakeFromNib() + } +} diff --git a/packages/rum_sdk/example/macos/Runner/Release.entitlements b/packages/rum_sdk/example/macos/Runner/Release.entitlements new file mode 100644 index 0000000..852fa1a --- /dev/null +++ b/packages/rum_sdk/example/macos/Runner/Release.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/packages/rum_sdk/example/macos/RunnerTests/RunnerTests.swift b/packages/rum_sdk/example/macos/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..61f3bd1 --- /dev/null +++ b/packages/rum_sdk/example/macos/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Cocoa +import FlutterMacOS +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/packages/rum_sdk/example/pubspec.lock b/packages/rum_sdk/example/pubspec.lock new file mode 100644 index 0000000..7e21f87 --- /dev/null +++ b/packages/rum_sdk/example/pubspec.lock @@ -0,0 +1,472 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + args: + dependency: transitive + description: + name: args + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + url: "https://pub.dev" + source: hosted + version: "2.5.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + connectivity_plus: + dependency: transitive + description: + name: connectivity_plus + sha256: db7a4e143dc72cc3cb2044ef9b052a7ebfe729513e6a82943bc3526f784365b8 + url: "https://pub.dev" + source: hosted + version: "6.0.3" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + sha256: b6a56efe1e6675be240de39107281d4034b64ac23438026355b4234042a35adb + url: "https://pub.dev" + source: hosted + version: "2.0.0" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dbus: + dependency: transitive + description: + name: dbus + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" + url: "https://pub.dev" + source: hosted + version: "0.7.10" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_dotenv: + dependency: "direct main" + description: + name: flutter_dotenv + sha256: "9357883bdd153ab78cbf9ffa07656e336b8bbb2b5a3ca596b0b27e119f7c7d77" + url: "https://pub.dev" + source: hosted + version: "5.1.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + url: "https://pub.dev" + source: hosted + version: "2.0.3" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + http: + dependency: transitive + description: + name: http + sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + intl: + dependency: transitive + description: + name: intl + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + url: "https://pub.dev" + source: hosted + version: "0.19.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + url: "https://pub.dev" + source: hosted + version: "10.0.4" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + url: "https://pub.dev" + source: hosted + version: "3.0.3" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.dev" + source: hosted + version: "0.8.0" + meta: + dependency: transitive + description: + name: meta + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" + source: hosted + version: "0.5.0" + offline_transport: + dependency: "direct main" + description: + path: "../../offline_transport" + relative: true + source: path + version: "1.0.0" + package_info_plus: + dependency: transitive + description: + name: package_info_plus + sha256: cb44f49b6e690fa766f023d5b22cac6b9affe741dd792b6ac7ad4fabe0d7b097 + url: "https://pub.dev" + source: hosted + version: "6.0.0" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 + url: "https://pub.dev" + source: hosted + version: "2.1.3" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d + url: "https://pub.dev" + source: hosted + version: "2.2.4" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: f234384a3fdd67f989b4d54a5d73ca2a6c422fa55ae694381ae0f4375cd1ea16 + url: "https://pub.dev" + source: hosted + version: "2.4.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + url: "https://pub.dev" + source: hosted + version: "6.0.2" + platform: + dependency: transitive + description: + name: platform + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" + url: "https://pub.dev" + source: hosted + version: "3.1.4" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + rum_sdk: + dependency: "direct main" + description: + path: ".." + relative: true + source: path + version: "1.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + uuid: + dependency: transitive + description: + name: uuid + sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8" + url: "https://pub.dev" + source: hosted + version: "4.4.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + url: "https://pub.dev" + source: hosted + version: "14.2.1" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" + win32: + dependency: transitive + description: + name: win32 + sha256: "0a989dc7ca2bb51eac91e8fd00851297cfffd641aa7538b165c62637ca0eaa4a" + url: "https://pub.dev" + source: hosted + version: "5.4.0" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d + url: "https://pub.dev" + source: hosted + version: "1.0.4" + xml: + dependency: transitive + description: + name: xml + sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + url: "https://pub.dev" + source: hosted + version: "6.5.0" +sdks: + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.19.0" diff --git a/packages/rum_sdk/example/pubspec.yaml b/packages/rum_sdk/example/pubspec.yaml new file mode 100644 index 0000000..587b8b4 --- /dev/null +++ b/packages/rum_sdk/example/pubspec.yaml @@ -0,0 +1,85 @@ +name: rum_sdk_example +description: Demonstrates how to use the rum_sdk plugin. +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +environment: + sdk: '>=2.19.6 <3.0.0' + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + rum_sdk: + path: ../ + offline_transport: + path: ../../offline_transport + flutter_dotenv: ^5.1.0 +# path: ../../rum_dart + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^2.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + assets: + - assets/ + - .env + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/rum_sdk/example/pubspec_overrides.yaml b/packages/rum_sdk/example/pubspec_overrides.yaml new file mode 100644 index 0000000..9148c30 --- /dev/null +++ b/packages/rum_sdk/example/pubspec_overrides.yaml @@ -0,0 +1,6 @@ +# melos_managed_dependency_overrides: rum_sdk,offline_transport +dependency_overrides: + offline_transport: + path: ../../offline_transport + rum_sdk: + path: .. diff --git a/packages/rum_sdk/example/test/widget_test.dart b/packages/rum_sdk/example/test/widget_test.dart new file mode 100644 index 0000000..d51cc83 --- /dev/null +++ b/packages/rum_sdk/example/test/widget_test.dart @@ -0,0 +1,27 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:rum_sdk_example/main.dart'; + +void main() { + testWidgets('Verify Platform version', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(const MyApp()); + + // Verify that platform version is retrieved. + expect( + find.byWidgetPredicate( + (Widget widget) => widget is Text && + widget.data!.startsWith('Running on:'), + ), + findsOneWidget, + ); + }); +} diff --git a/packages/rum_sdk/example/web/favicon.png b/packages/rum_sdk/example/web/favicon.png new file mode 100644 index 0000000..8aaa46a Binary files /dev/null and b/packages/rum_sdk/example/web/favicon.png differ diff --git a/packages/rum_sdk/example/web/icons/Icon-192.png b/packages/rum_sdk/example/web/icons/Icon-192.png new file mode 100644 index 0000000..b749bfe Binary files /dev/null and b/packages/rum_sdk/example/web/icons/Icon-192.png differ diff --git a/packages/rum_sdk/example/web/icons/Icon-512.png b/packages/rum_sdk/example/web/icons/Icon-512.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/packages/rum_sdk/example/web/icons/Icon-512.png differ diff --git a/packages/rum_sdk/example/web/icons/Icon-maskable-192.png b/packages/rum_sdk/example/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000..eb9b4d7 Binary files /dev/null and b/packages/rum_sdk/example/web/icons/Icon-maskable-192.png differ diff --git a/packages/rum_sdk/example/web/icons/Icon-maskable-512.png b/packages/rum_sdk/example/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000..d69c566 Binary files /dev/null and b/packages/rum_sdk/example/web/icons/Icon-maskable-512.png differ diff --git a/packages/rum_sdk/example/web/index.html b/packages/rum_sdk/example/web/index.html new file mode 100644 index 0000000..1aa025d --- /dev/null +++ b/packages/rum_sdk/example/web/index.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + example + + + + + + diff --git a/packages/rum_sdk/example/web/manifest.json b/packages/rum_sdk/example/web/manifest.json new file mode 100644 index 0000000..096edf8 --- /dev/null +++ b/packages/rum_sdk/example/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "example", + "short_name": "example", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +} diff --git a/packages/rum_sdk/example/windows/.gitignore b/packages/rum_sdk/example/windows/.gitignore new file mode 100644 index 0000000..d492d0d --- /dev/null +++ b/packages/rum_sdk/example/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ephemeral/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/packages/rum_sdk/example/windows/CMakeLists.txt b/packages/rum_sdk/example/windows/CMakeLists.txt new file mode 100644 index 0000000..5e3ede2 --- /dev/null +++ b/packages/rum_sdk/example/windows/CMakeLists.txt @@ -0,0 +1,101 @@ +# Project-level configuration. +cmake_minimum_required(VERSION 3.14) +project(rum_sdk_example LANGUAGES CXX) + +# The name of the executable created for the application. Change this to change +# the on-disk name of your application. +set(BINARY_NAME "rum_sdk_example") + +# Explicitly opt in to modern CMake behaviors to avoid warnings with recent +# versions of CMake. +cmake_policy(SET CMP0063 NEW) + +# Define build configuration option. +get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" + CACHE STRING "" FORCE) +else() + if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + set(CMAKE_BUILD_TYPE "Debug" CACHE + STRING "Flutter build mode" FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + "Debug" "Profile" "Release") + endif() +endif() +# Define settings for the Profile build mode. +set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") +set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") +set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") +set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") + +# Use Unicode for all projects. +add_definitions(-DUNICODE -D_UNICODE) + +# Compilation settings that should be applied to most targets. +# +# Be cautious about adding new options here, as plugins use this function by +# default. In most cases, you should add new options to specific targets instead +# of modifying this function. +function(APPLY_STANDARD_SETTINGS TARGET) + target_compile_features(${TARGET} PUBLIC cxx_std_17) + target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") + target_compile_options(${TARGET} PRIVATE /EHsc) + target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") + target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") +endfunction() + +# Flutter library and tool build rules. +set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") +add_subdirectory(${FLUTTER_MANAGED_DIR}) + +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") + +# Generated plugin build rules, which manage building the plugins and adding +# them to the application. +include(flutter/generated_plugins.cmake) + + +# === Installation === +# Support files are copied into place next to the executable, so that it can +# run in place. This is done instead of making a separate bundle (as on Linux) +# so that building and running from within Visual Studio will work. +set(BUILD_BUNDLE_DIR "$") +# Make the "install" step default, as it's required to run. +set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) +endif() + +set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") +set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") + +install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + COMPONENT Runtime) + +install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) + +if(PLUGIN_BUNDLED_LIBRARIES) + install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" + DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" + COMPONENT Runtime) +endif() + +# Fully re-copy the assets directory on each build to avoid having stale files +# from a previous install. +set(FLUTTER_ASSET_DIR_NAME "flutter_assets") +install(CODE " + file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") + " COMPONENT Runtime) +install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" + DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) + +# Install the AOT library on non-Debug builds only. +install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" + CONFIGURATIONS Profile;Release + COMPONENT Runtime) diff --git a/packages/rum_sdk/example/windows/flutter/CMakeLists.txt b/packages/rum_sdk/example/windows/flutter/CMakeLists.txt new file mode 100644 index 0000000..930d207 --- /dev/null +++ b/packages/rum_sdk/example/windows/flutter/CMakeLists.txt @@ -0,0 +1,104 @@ +# This file controls Flutter-level build steps. It should not be edited. +cmake_minimum_required(VERSION 3.14) + +set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") + +# Configuration provided via flutter tool. +include(${EPHEMERAL_DIR}/generated_config.cmake) + +# TODO: Move the rest of this into files in ephemeral. See +# https://github.com/flutter/flutter/issues/57146. +set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") + +# === Flutter Library === +set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") + +# Published to parent scope for install step. +set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) +set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) +set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) +set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) + +list(APPEND FLUTTER_LIBRARY_HEADERS + "flutter_export.h" + "flutter_windows.h" + "flutter_messenger.h" + "flutter_plugin_registrar.h" + "flutter_texture_registrar.h" +) +list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") +add_library(flutter INTERFACE) +target_include_directories(flutter INTERFACE + "${EPHEMERAL_DIR}" +) +target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") +add_dependencies(flutter flutter_assemble) + +# === Wrapper === +list(APPEND CPP_WRAPPER_SOURCES_CORE + "core_implementations.cc" + "standard_codec.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_PLUGIN + "plugin_registrar.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") +list(APPEND CPP_WRAPPER_SOURCES_APP + "flutter_engine.cc" + "flutter_view_controller.cc" +) +list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") + +# Wrapper sources needed for a plugin. +add_library(flutter_wrapper_plugin STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} +) +apply_standard_settings(flutter_wrapper_plugin) +set_target_properties(flutter_wrapper_plugin PROPERTIES + POSITION_INDEPENDENT_CODE ON) +set_target_properties(flutter_wrapper_plugin PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) +target_include_directories(flutter_wrapper_plugin PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_plugin flutter_assemble) + +# Wrapper sources needed for the runner. +add_library(flutter_wrapper_app STATIC + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_APP} +) +apply_standard_settings(flutter_wrapper_app) +target_link_libraries(flutter_wrapper_app PUBLIC flutter) +target_include_directories(flutter_wrapper_app PUBLIC + "${WRAPPER_ROOT}/include" +) +add_dependencies(flutter_wrapper_app flutter_assemble) + +# === Flutter tool backend === +# _phony_ is a non-existent file to force this command to run every time, +# since currently there's no way to get a full input/output list from the +# flutter tool. +set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") +set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) +add_custom_command( + OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} + ${PHONY_OUTPUT} + COMMAND ${CMAKE_COMMAND} -E env + ${FLUTTER_TOOL_ENVIRONMENT} + "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" + windows-x64 $ + VERBATIM +) +add_custom_target(flutter_assemble DEPENDS + "${FLUTTER_LIBRARY}" + ${FLUTTER_LIBRARY_HEADERS} + ${CPP_WRAPPER_SOURCES_CORE} + ${CPP_WRAPPER_SOURCES_PLUGIN} + ${CPP_WRAPPER_SOURCES_APP} +) diff --git a/packages/rum_sdk/example/windows/flutter/generated_plugin_registrant.cc b/packages/rum_sdk/example/windows/flutter/generated_plugin_registrant.cc new file mode 100644 index 0000000..0337288 --- /dev/null +++ b/packages/rum_sdk/example/windows/flutter/generated_plugin_registrant.cc @@ -0,0 +1,17 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + +#include +#include + +void RegisterPlugins(flutter::PluginRegistry* registry) { + ConnectivityPlusWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); + RumSdkPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("RumSdkPluginCApi")); +} diff --git a/packages/rum_sdk/example/windows/flutter/generated_plugin_registrant.h b/packages/rum_sdk/example/windows/flutter/generated_plugin_registrant.h new file mode 100644 index 0000000..dc139d8 --- /dev/null +++ b/packages/rum_sdk/example/windows/flutter/generated_plugin_registrant.h @@ -0,0 +1,15 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#ifndef GENERATED_PLUGIN_REGISTRANT_ +#define GENERATED_PLUGIN_REGISTRANT_ + +#include + +// Registers Flutter plugins. +void RegisterPlugins(flutter::PluginRegistry* registry); + +#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/packages/rum_sdk/example/windows/flutter/generated_plugins.cmake b/packages/rum_sdk/example/windows/flutter/generated_plugins.cmake new file mode 100644 index 0000000..cced197 --- /dev/null +++ b/packages/rum_sdk/example/windows/flutter/generated_plugins.cmake @@ -0,0 +1,25 @@ +# +# Generated file, do not edit. +# + +list(APPEND FLUTTER_PLUGIN_LIST + connectivity_plus + rum_sdk +) + +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + +set(PLUGIN_BUNDLED_LIBRARIES) + +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) + target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) + list(APPEND PLUGIN_BUNDLED_LIBRARIES $) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) +endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/packages/rum_sdk/example/windows/runner/CMakeLists.txt b/packages/rum_sdk/example/windows/runner/CMakeLists.txt new file mode 100644 index 0000000..394917c --- /dev/null +++ b/packages/rum_sdk/example/windows/runner/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 3.14) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} WIN32 + "flutter_window.cpp" + "main.cpp" + "utils.cpp" + "win32_window.cpp" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" + "Runner.rc" + "runner.exe.manifest" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the build version. +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") +target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") + +# Disable Windows macros that collide with C++ standard library functions. +target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") + +# Add dependency libraries and include directories. Add any application-specific +# dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) +target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") + +# Run the Flutter tool portions of the build. This must not be removed. +add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/packages/rum_sdk/example/windows/runner/Runner.rc b/packages/rum_sdk/example/windows/runner/Runner.rc new file mode 100644 index 0000000..ade6776 --- /dev/null +++ b/packages/rum_sdk/example/windows/runner/Runner.rc @@ -0,0 +1,121 @@ +// Microsoft Visual C++ generated resource script. +// +#pragma code_page(65001) +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (United States) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APP_ICON ICON "resources\\app_icon.ico" + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) +#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD +#else +#define VERSION_AS_NUMBER 1,0,0,0 +#endif + +#if defined(FLUTTER_VERSION) +#define VERSION_AS_STRING FLUTTER_VERSION +#else +#define VERSION_AS_STRING "1.0.0" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION VERSION_AS_NUMBER + PRODUCTVERSION VERSION_AS_NUMBER + FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#ifdef _DEBUG + FILEFLAGS VS_FF_DEBUG +#else + FILEFLAGS 0x0L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_APP + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "com.example" "\0" + VALUE "FileDescription", "rum_sdk_example" "\0" + VALUE "FileVersion", VERSION_AS_STRING "\0" + VALUE "InternalName", "rum_sdk_example" "\0" + VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" + VALUE "OriginalFilename", "rum_sdk_example.exe" "\0" + VALUE "ProductName", "rum_sdk_example" "\0" + VALUE "ProductVersion", VERSION_AS_STRING "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1252 + END +END + +#endif // English (United States) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/packages/rum_sdk/example/windows/runner/flutter_window.cpp b/packages/rum_sdk/example/windows/runner/flutter_window.cpp new file mode 100644 index 0000000..b25e363 --- /dev/null +++ b/packages/rum_sdk/example/windows/runner/flutter_window.cpp @@ -0,0 +1,66 @@ +#include "flutter_window.h" + +#include + +#include "flutter/generated_plugin_registrant.h" + +FlutterWindow::FlutterWindow(const flutter::DartProject& project) + : project_(project) {} + +FlutterWindow::~FlutterWindow() {} + +bool FlutterWindow::OnCreate() { + if (!Win32Window::OnCreate()) { + return false; + } + + RECT frame = GetClientArea(); + + // The size here must match the window dimensions to avoid unnecessary surface + // creation / destruction in the startup path. + flutter_controller_ = std::make_unique( + frame.right - frame.left, frame.bottom - frame.top, project_); + // Ensure that basic setup of the controller was successful. + if (!flutter_controller_->engine() || !flutter_controller_->view()) { + return false; + } + RegisterPlugins(flutter_controller_->engine()); + SetChildContent(flutter_controller_->view()->GetNativeWindow()); + + flutter_controller_->engine()->SetNextFrameCallback([&]() { + this->Show(); + }); + + return true; +} + +void FlutterWindow::OnDestroy() { + if (flutter_controller_) { + flutter_controller_ = nullptr; + } + + Win32Window::OnDestroy(); +} + +LRESULT +FlutterWindow::MessageHandler(HWND hwnd, UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + // Give Flutter, including plugins, an opportunity to handle window messages. + if (flutter_controller_) { + std::optional result = + flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, + lparam); + if (result) { + return *result; + } + } + + switch (message) { + case WM_FONTCHANGE: + flutter_controller_->engine()->ReloadSystemFonts(); + break; + } + + return Win32Window::MessageHandler(hwnd, message, wparam, lparam); +} diff --git a/packages/rum_sdk/example/windows/runner/flutter_window.h b/packages/rum_sdk/example/windows/runner/flutter_window.h new file mode 100644 index 0000000..6da0652 --- /dev/null +++ b/packages/rum_sdk/example/windows/runner/flutter_window.h @@ -0,0 +1,33 @@ +#ifndef RUNNER_FLUTTER_WINDOW_H_ +#define RUNNER_FLUTTER_WINDOW_H_ + +#include +#include + +#include + +#include "win32_window.h" + +// A window that does nothing but host a Flutter view. +class FlutterWindow : public Win32Window { + public: + // Creates a new FlutterWindow hosting a Flutter view running |project|. + explicit FlutterWindow(const flutter::DartProject& project); + virtual ~FlutterWindow(); + + protected: + // Win32Window: + bool OnCreate() override; + void OnDestroy() override; + LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, + LPARAM const lparam) noexcept override; + + private: + // The project to run. + flutter::DartProject project_; + + // The Flutter instance hosted by this window. + std::unique_ptr flutter_controller_; +}; + +#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/packages/rum_sdk/example/windows/runner/main.cpp b/packages/rum_sdk/example/windows/runner/main.cpp new file mode 100644 index 0000000..92735a4 --- /dev/null +++ b/packages/rum_sdk/example/windows/runner/main.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +#include "flutter_window.h" +#include "utils.h" + +int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, + _In_ wchar_t *command_line, _In_ int show_command) { + // Attach to console when present (e.g., 'flutter run') or create a + // new console when running with a debugger. + if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { + CreateAndAttachConsole(); + } + + // Initialize COM, so that it is available for use in the library and/or + // plugins. + ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); + + flutter::DartProject project(L"data"); + + std::vector command_line_arguments = + GetCommandLineArguments(); + + project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); + + FlutterWindow window(project); + Win32Window::Point origin(10, 10); + Win32Window::Size size(1280, 720); + if (!window.Create(L"rum_sdk_example", origin, size)) { + return EXIT_FAILURE; + } + window.SetQuitOnClose(true); + + ::MSG msg; + while (::GetMessage(&msg, nullptr, 0, 0)) { + ::TranslateMessage(&msg); + ::DispatchMessage(&msg); + } + + ::CoUninitialize(); + return EXIT_SUCCESS; +} diff --git a/packages/rum_sdk/example/windows/runner/resource.h b/packages/rum_sdk/example/windows/runner/resource.h new file mode 100644 index 0000000..66a65d1 --- /dev/null +++ b/packages/rum_sdk/example/windows/runner/resource.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Runner.rc +// +#define IDI_APP_ICON 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/packages/rum_sdk/example/windows/runner/resources/app_icon.ico b/packages/rum_sdk/example/windows/runner/resources/app_icon.ico new file mode 100644 index 0000000..c04e20c Binary files /dev/null and b/packages/rum_sdk/example/windows/runner/resources/app_icon.ico differ diff --git a/packages/rum_sdk/example/windows/runner/runner.exe.manifest b/packages/rum_sdk/example/windows/runner/runner.exe.manifest new file mode 100644 index 0000000..a42ea76 --- /dev/null +++ b/packages/rum_sdk/example/windows/runner/runner.exe.manifest @@ -0,0 +1,20 @@ + + + + + PerMonitorV2 + + + + + + + + + + + + + + + diff --git a/packages/rum_sdk/example/windows/runner/utils.cpp b/packages/rum_sdk/example/windows/runner/utils.cpp new file mode 100644 index 0000000..f5bf9fa --- /dev/null +++ b/packages/rum_sdk/example/windows/runner/utils.cpp @@ -0,0 +1,64 @@ +#include "utils.h" + +#include +#include +#include +#include + +#include + +void CreateAndAttachConsole() { + if (::AllocConsole()) { + FILE *unused; + if (freopen_s(&unused, "CONOUT$", "w", stdout)) { + _dup2(_fileno(stdout), 1); + } + if (freopen_s(&unused, "CONOUT$", "w", stderr)) { + _dup2(_fileno(stdout), 2); + } + std::ios::sync_with_stdio(); + FlutterDesktopResyncOutputStreams(); + } +} + +std::vector GetCommandLineArguments() { + // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. + int argc; + wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); + if (argv == nullptr) { + return std::vector(); + } + + std::vector command_line_arguments; + + // Skip the first argument as it's the binary name. + for (int i = 1; i < argc; i++) { + command_line_arguments.push_back(Utf8FromUtf16(argv[i])); + } + + ::LocalFree(argv); + + return command_line_arguments; +} + +std::string Utf8FromUtf16(const wchar_t* utf16_string) { + if (utf16_string == nullptr) { + return std::string(); + } + int target_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, nullptr, 0, nullptr, nullptr); + std::string utf8_string; + if (target_length == 0 || target_length > utf8_string.max_size()) { + return utf8_string; + } + utf8_string.resize(target_length); + int converted_length = ::WideCharToMultiByte( + CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, + -1, utf8_string.data(), + target_length, nullptr, nullptr); + if (converted_length == 0) { + return std::string(); + } + return utf8_string; +} diff --git a/packages/rum_sdk/example/windows/runner/utils.h b/packages/rum_sdk/example/windows/runner/utils.h new file mode 100644 index 0000000..3879d54 --- /dev/null +++ b/packages/rum_sdk/example/windows/runner/utils.h @@ -0,0 +1,19 @@ +#ifndef RUNNER_UTILS_H_ +#define RUNNER_UTILS_H_ + +#include +#include + +// Creates a console for the process, and redirects stdout and stderr to +// it for both the runner and the Flutter library. +void CreateAndAttachConsole(); + +// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string +// encoded in UTF-8. Returns an empty std::string on failure. +std::string Utf8FromUtf16(const wchar_t* utf16_string); + +// Gets the command line arguments passed in as a std::vector, +// encoded in UTF-8. Returns an empty std::vector on failure. +std::vector GetCommandLineArguments(); + +#endif // RUNNER_UTILS_H_ diff --git a/packages/rum_sdk/example/windows/runner/win32_window.cpp b/packages/rum_sdk/example/windows/runner/win32_window.cpp new file mode 100644 index 0000000..041a385 --- /dev/null +++ b/packages/rum_sdk/example/windows/runner/win32_window.cpp @@ -0,0 +1,288 @@ +#include "win32_window.h" + +#include +#include + +#include "resource.h" + +namespace { + +/// Window attribute that enables dark mode window decorations. +/// +/// Redefined in case the developer's machine has a Windows SDK older than +/// version 10.0.22000.0. +/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + +constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; + +/// Registry key for app theme preference. +/// +/// A value of 0 indicates apps should use dark mode. A non-zero or missing +/// value indicates apps should use light mode. +constexpr const wchar_t kGetPreferredBrightnessRegKey[] = + L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; +constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; + +// The number of Win32Window objects that currently exist. +static int g_active_window_count = 0; + +using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); + +// Scale helper to convert logical scaler values to physical using passed in +// scale factor +int Scale(int source, double scale_factor) { + return static_cast(source * scale_factor); +} + +// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. +// This API is only needed for PerMonitor V1 awareness mode. +void EnableFullDpiSupportIfAvailable(HWND hwnd) { + HMODULE user32_module = LoadLibraryA("User32.dll"); + if (!user32_module) { + return; + } + auto enable_non_client_dpi_scaling = + reinterpret_cast( + GetProcAddress(user32_module, "EnableNonClientDpiScaling")); + if (enable_non_client_dpi_scaling != nullptr) { + enable_non_client_dpi_scaling(hwnd); + } + FreeLibrary(user32_module); +} + +} // namespace + +// Manages the Win32Window's window class registration. +class WindowClassRegistrar { + public: + ~WindowClassRegistrar() = default; + + // Returns the singleton registar instance. + static WindowClassRegistrar* GetInstance() { + if (!instance_) { + instance_ = new WindowClassRegistrar(); + } + return instance_; + } + + // Returns the name of the window class, registering the class if it hasn't + // previously been registered. + const wchar_t* GetWindowClass(); + + // Unregisters the window class. Should only be called if there are no + // instances of the window. + void UnregisterWindowClass(); + + private: + WindowClassRegistrar() = default; + + static WindowClassRegistrar* instance_; + + bool class_registered_ = false; +}; + +WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; + +const wchar_t* WindowClassRegistrar::GetWindowClass() { + if (!class_registered_) { + WNDCLASS window_class{}; + window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); + window_class.lpszClassName = kWindowClassName; + window_class.style = CS_HREDRAW | CS_VREDRAW; + window_class.cbClsExtra = 0; + window_class.cbWndExtra = 0; + window_class.hInstance = GetModuleHandle(nullptr); + window_class.hIcon = + LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); + window_class.hbrBackground = 0; + window_class.lpszMenuName = nullptr; + window_class.lpfnWndProc = Win32Window::WndProc; + RegisterClass(&window_class); + class_registered_ = true; + } + return kWindowClassName; +} + +void WindowClassRegistrar::UnregisterWindowClass() { + UnregisterClass(kWindowClassName, nullptr); + class_registered_ = false; +} + +Win32Window::Win32Window() { + ++g_active_window_count; +} + +Win32Window::~Win32Window() { + --g_active_window_count; + Destroy(); +} + +bool Win32Window::Create(const std::wstring& title, + const Point& origin, + const Size& size) { + Destroy(); + + const wchar_t* window_class = + WindowClassRegistrar::GetInstance()->GetWindowClass(); + + const POINT target_point = {static_cast(origin.x), + static_cast(origin.y)}; + HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); + UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); + double scale_factor = dpi / 96.0; + + HWND window = CreateWindow( + window_class, title.c_str(), WS_OVERLAPPEDWINDOW, + Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), + Scale(size.width, scale_factor), Scale(size.height, scale_factor), + nullptr, nullptr, GetModuleHandle(nullptr), this); + + if (!window) { + return false; + } + + UpdateTheme(window); + + return OnCreate(); +} + +bool Win32Window::Show() { + return ShowWindow(window_handle_, SW_SHOWNORMAL); +} + +// static +LRESULT CALLBACK Win32Window::WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + if (message == WM_NCCREATE) { + auto window_struct = reinterpret_cast(lparam); + SetWindowLongPtr(window, GWLP_USERDATA, + reinterpret_cast(window_struct->lpCreateParams)); + + auto that = static_cast(window_struct->lpCreateParams); + EnableFullDpiSupportIfAvailable(window); + that->window_handle_ = window; + } else if (Win32Window* that = GetThisFromHandle(window)) { + return that->MessageHandler(window, message, wparam, lparam); + } + + return DefWindowProc(window, message, wparam, lparam); +} + +LRESULT +Win32Window::MessageHandler(HWND hwnd, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept { + switch (message) { + case WM_DESTROY: + window_handle_ = nullptr; + Destroy(); + if (quit_on_close_) { + PostQuitMessage(0); + } + return 0; + + case WM_DPICHANGED: { + auto newRectSize = reinterpret_cast(lparam); + LONG newWidth = newRectSize->right - newRectSize->left; + LONG newHeight = newRectSize->bottom - newRectSize->top; + + SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, + newHeight, SWP_NOZORDER | SWP_NOACTIVATE); + + return 0; + } + case WM_SIZE: { + RECT rect = GetClientArea(); + if (child_content_ != nullptr) { + // Size and position the child window. + MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, + rect.bottom - rect.top, TRUE); + } + return 0; + } + + case WM_ACTIVATE: + if (child_content_ != nullptr) { + SetFocus(child_content_); + } + return 0; + + case WM_DWMCOLORIZATIONCOLORCHANGED: + UpdateTheme(hwnd); + return 0; + } + + return DefWindowProc(window_handle_, message, wparam, lparam); +} + +void Win32Window::Destroy() { + OnDestroy(); + + if (window_handle_) { + DestroyWindow(window_handle_); + window_handle_ = nullptr; + } + if (g_active_window_count == 0) { + WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); + } +} + +Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { + return reinterpret_cast( + GetWindowLongPtr(window, GWLP_USERDATA)); +} + +void Win32Window::SetChildContent(HWND content) { + child_content_ = content; + SetParent(content, window_handle_); + RECT frame = GetClientArea(); + + MoveWindow(content, frame.left, frame.top, frame.right - frame.left, + frame.bottom - frame.top, true); + + SetFocus(child_content_); +} + +RECT Win32Window::GetClientArea() { + RECT frame; + GetClientRect(window_handle_, &frame); + return frame; +} + +HWND Win32Window::GetHandle() { + return window_handle_; +} + +void Win32Window::SetQuitOnClose(bool quit_on_close) { + quit_on_close_ = quit_on_close; +} + +bool Win32Window::OnCreate() { + // No-op; provided for subclasses. + return true; +} + +void Win32Window::OnDestroy() { + // No-op; provided for subclasses. +} + +void Win32Window::UpdateTheme(HWND const window) { + DWORD light_mode; + DWORD light_mode_size = sizeof(light_mode); + LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, + kGetPreferredBrightnessRegValue, + RRF_RT_REG_DWORD, nullptr, &light_mode, + &light_mode_size); + + if (result == ERROR_SUCCESS) { + BOOL enable_dark_mode = light_mode == 0; + DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, + &enable_dark_mode, sizeof(enable_dark_mode)); + } +} diff --git a/packages/rum_sdk/example/windows/runner/win32_window.h b/packages/rum_sdk/example/windows/runner/win32_window.h new file mode 100644 index 0000000..c86632d --- /dev/null +++ b/packages/rum_sdk/example/windows/runner/win32_window.h @@ -0,0 +1,102 @@ +#ifndef RUNNER_WIN32_WINDOW_H_ +#define RUNNER_WIN32_WINDOW_H_ + +#include + +#include +#include +#include + +// A class abstraction for a high DPI-aware Win32 Window. Intended to be +// inherited from by classes that wish to specialize with custom +// rendering and input handling +class Win32Window { + public: + struct Point { + unsigned int x; + unsigned int y; + Point(unsigned int x, unsigned int y) : x(x), y(y) {} + }; + + struct Size { + unsigned int width; + unsigned int height; + Size(unsigned int width, unsigned int height) + : width(width), height(height) {} + }; + + Win32Window(); + virtual ~Win32Window(); + + // Creates a win32 window with |title| that is positioned and sized using + // |origin| and |size|. New windows are created on the default monitor. Window + // sizes are specified to the OS in physical pixels, hence to ensure a + // consistent size this function will scale the inputted width and height as + // as appropriate for the default monitor. The window is invisible until + // |Show| is called. Returns true if the window was created successfully. + bool Create(const std::wstring& title, const Point& origin, const Size& size); + + // Show the current window. Returns true if the window was successfully shown. + bool Show(); + + // Release OS resources associated with window. + void Destroy(); + + // Inserts |content| into the window tree. + void SetChildContent(HWND content); + + // Returns the backing Window handle to enable clients to set icon and other + // window properties. Returns nullptr if the window has been destroyed. + HWND GetHandle(); + + // If true, closing this window will quit the application. + void SetQuitOnClose(bool quit_on_close); + + // Return a RECT representing the bounds of the current client area. + RECT GetClientArea(); + + protected: + // Processes and route salient window messages for mouse handling, + // size change and DPI. Delegates handling of these to member overloads that + // inheriting classes can handle. + virtual LRESULT MessageHandler(HWND window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Called when CreateAndShow is called, allowing subclass window-related + // setup. Subclasses should return false if setup fails. + virtual bool OnCreate(); + + // Called when Destroy is called. + virtual void OnDestroy(); + + private: + friend class WindowClassRegistrar; + + // OS callback called by message pump. Handles the WM_NCCREATE message which + // is passed when the non-client area is being created and enables automatic + // non-client DPI scaling so that the non-client area automatically + // responsponds to changes in DPI. All other messages are handled by + // MessageHandler. + static LRESULT CALLBACK WndProc(HWND const window, + UINT const message, + WPARAM const wparam, + LPARAM const lparam) noexcept; + + // Retrieves a class instance pointer for |window| + static Win32Window* GetThisFromHandle(HWND const window) noexcept; + + // Update the window frame's theme to match the system theme. + static void UpdateTheme(HWND const window); + + bool quit_on_close_ = false; + + // window handle for top level window. + HWND window_handle_ = nullptr; + + // window handle for hosted content. + HWND child_content_ = nullptr; +}; + +#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/packages/rum_sdk/ios/.gitignore b/packages/rum_sdk/ios/.gitignore new file mode 100644 index 0000000..0c88507 --- /dev/null +++ b/packages/rum_sdk/ios/.gitignore @@ -0,0 +1,38 @@ +.idea/ +.vagrant/ +.sconsign.dblite +.svn/ + +.DS_Store +*.swp +profile + +DerivedData/ +build/ +GeneratedPluginRegistrant.h +GeneratedPluginRegistrant.m + +.generated/ + +*.pbxuser +*.mode1v3 +*.mode2v3 +*.perspectivev3 + +!default.pbxuser +!default.mode1v3 +!default.mode2v3 +!default.perspectivev3 + +xcuserdata + +*.moved-aside + +*.pyc +*sync/ +Icon? +.tags* + +/Flutter/Generated.xcconfig +/Flutter/ephemeral/ +/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/packages/rum_sdk/ios/Assets/.gitkeep b/packages/rum_sdk/ios/Assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/packages/rum_sdk/ios/Classes/AppStart.swift b/packages/rum_sdk/ios/Classes/AppStart.swift new file mode 100644 index 0000000..b3ae0ad --- /dev/null +++ b/packages/rum_sdk/ios/Classes/AppStart.swift @@ -0,0 +1,81 @@ +import Foundation + +class AppStart { + + private static let instance = AppStart() + + private static let MAX_APP_START_DURATION: Double = 60000.0 + + private static var appStartMillis: Double? + private static var appStartEndMillis: Double = 0.0 + + private static var warmStartMillis: Double? + + + private init() {} + + // MARK: - Getter + static func getInstance() -> AppStart { + return instance + } + + + static func getAppStartMillis() -> Double? { + return appStartMillis + } + + static func getAppStartEndMillis() -> Double? { + return appStartEndMillis + } + + static func getWarmStartMillis() -> Double? { + return warmStartMillis + } + + static func getAppStartDuration() -> Double { + var appStartDuration: Double = 0.0 + var kinfo = kinfo_proc() + var size = MemoryLayout.stride + var mib: [Int32] = [CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()] + sysctl(&mib, u_int(mib.count), &kinfo, &size, nil, 0) + + let start_time = kinfo.kp_proc.p_starttime + var time: timeval = timeval(tv_sec: 0, tv_usec: 0) + gettimeofday(&time, nil) + + let currentTimeMilliseconds = Double(Int64(time.tv_sec) * 1000) + Double(time.tv_usec) / 1000.0 + let processTimeMilliseconds = Double(Int64(start_time.tv_sec) * 1000) + Double(start_time.tv_usec) / 1000.0 + + appStartDuration = (currentTimeMilliseconds - processTimeMilliseconds) + + let AppStartEndMillis = getAppStartEndMillis()! + if let appStartMillis = getAppStartEndMillis() { + let appStartDuration = Double(appStartMillis) - (ProcessInfo.processInfo.systemUptime * 1000) + } + + return appStartDuration + } + + static func getColdStartDuration() -> Double { + let coldStartDuration: Double = 0.0 + return coldStartDuration + } + + static func setWarmStartMillis(_ warmStartMillis: Double) { + self.warmStartMillis = warmStartMillis + } + + static func setAppStartMillis(_ appStartMillis: Double) { + self.appStartMillis = appStartMillis + } + + static func setAppStartEndMillis(_ appStartEndMillis: Double) { + self.appStartEndMillis = appStartEndMillis + } + + static func clear() { + appStartMillis = nil + appStartEndMillis = 0.0 + } +} + diff --git a/packages/rum_sdk/ios/Classes/CPUInfo.swift b/packages/rum_sdk/ios/Classes/CPUInfo.swift new file mode 100644 index 0000000..c8664cc --- /dev/null +++ b/packages/rum_sdk/ios/Classes/CPUInfo.swift @@ -0,0 +1,71 @@ +import Foundation + +public class CPUInfo { + private static let clockSpeedHz: Double = { + var clockSpeed = sysconf(_SC_CLK_TCK) + if clockSpeed == -1 { + perror("sysconf") + clockSpeed = 100 // Default value if sysconf fails (you can adjust as needed) + } + return Double(clockSpeed) + }() + + + private static var lastCpuTime: Double? = nil + private static var lastProcessTime: Double? = nil + private static var loadPrevious : host_cpu_load_info? = nil; + + + static func hostCPULoadInfo() -> host_cpu_load_info? { + let HOST_CPU_LOAD_INFO_COUNT = MemoryLayout.stride/MemoryLayout.stride + var size = mach_msg_type_number_t(HOST_CPU_LOAD_INFO_COUNT) + var cpuLoadInfo = host_cpu_load_info() + + let result = withUnsafeMutablePointer(to: &cpuLoadInfo) { + $0.withMemoryRebound(to: integer_t.self, capacity: HOST_CPU_LOAD_INFO_COUNT) { + host_statistics(mach_host_self(), HOST_CPU_LOAD_INFO, $0, &size) + } + } + if result != KERN_SUCCESS{ + print("Error - \(#file): \(#function) - kern_result_t = \(result)") + return nil + } + return cpuLoadInfo + } + static func measureAppStartUpTime() -> Double { + var kinfo = kinfo_proc() + var size = MemoryLayout.stride + var mib : [Int32] = [CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()] + sysctl(&mib, u_int(mib.count), &kinfo, &size, nil, 0) + let start_time = kinfo.kp_proc.p_starttime + var time : timeval = timeval(tv_sec: 0, tv_usec: 0) + gettimeofday(&time, nil) + let currentTimeMilliseconds = Double(Int64(time.tv_sec) * 1000) + Double(time.tv_usec) / 1000.0 + let processTimeMilliseconds = Double(Int64(start_time.tv_sec) * 1000) + Double(start_time.tv_usec) / 1000.0 + return currentTimeMilliseconds - processTimeMilliseconds + + } + + + + public static func getCpuInfo() -> Double? { + if let load = hostCPULoadInfo(){ + let usrDiff: Double = Double(load.cpu_ticks.0); + let sysDiff: Double = Double(load.cpu_ticks.1); + let idleDiff: Double = Double(load.cpu_ticks.2); + let niceDiff: Double = Double(load.cpu_ticks.3); + let cpuTime = (usrDiff + sysDiff + niceDiff + idleDiff ) / clockSpeedHz + let processTime = measureAppStartUpTime() + if lastCpuTime == nil || lastProcessTime == nil { + lastCpuTime = cpuTime + lastProcessTime = processTime + return 0.0 + } + let relCpuUsage = 100*(cpuTime - lastCpuTime!) / (processTime - lastProcessTime!) + lastCpuTime = cpuTime + lastProcessTime = processTime + return relCpuUsage + } + return 0.0 + } +} diff --git a/packages/rum_sdk/ios/Classes/CrashReportingIntegration.swift b/packages/rum_sdk/ios/Classes/CrashReportingIntegration.swift new file mode 100644 index 0000000..6a25543 --- /dev/null +++ b/packages/rum_sdk/ios/Classes/CrashReportingIntegration.swift @@ -0,0 +1,336 @@ +import CrashReporter + +class CrashReportingIntegration { + init(crashReporterConfig: [String: Any]) throws { + //if (!isDebuggerAttached()) { + + // It is strongly recommended that local symbolication only be enabled for non-release builds. + // Use [] for release versions. + guard let cache = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first else { + throw CrashReportException(description: "Cannot obtain `/Library/Caches/` url.") + } + + // Add Cache Directory + let directory = cache.appendingPathComponent("com.rumflutter.crash-reporting", isDirectory: true) + let config = PLCrashReporterConfig(signalHandlerType: .BSD, symbolicationStrategy:[],basePath: directory.path ) + guard let crashReporter = PLCrashReporter(configuration: config) else { + print("Could not create an instance of PLCrashReporter") + return + } + + // Enable the Crash Reporter. + do { + try crashReporter.enableAndReturnError() + } catch let error { + print("Warning: Could not enable crash reporter: \(error)") + } + // Try loading the crash report. + if crashReporter.hasPendingCrashReport() { + do { + let data = try crashReporter.loadPendingCrashReportDataAndReturnError() + + // Retrieving crash reporter data. + let report = try PLCrashReport(data: data) + var crashReport = try CrashReport(from: report) + + let minifier = CrashReportMinifier() + minifier.minify(crashReport: &crashReport) + let exporter = CrashReportExporter() + // format crash report to send to grafana / send to separate storage + sendCrashReport(crash: exporter.export(crashReport: crashReport), config: crashReporterConfig) + } catch let error { + print("CrashReporter failed to load and parse with error: \(error)") + } + } + + crashReporter.purgePendingCrashReport() + + } + func sendCrashReport(crash:Dictionary, config: Dictionary){ + let meta = [ + "app":config["app"], + "session": config["session"], + ] + var crashPayload:Dictionary = [:] + crashPayload["exceptions"] = [crash] + crashPayload["meta"] = meta + sendPostRequest(collector: config["collectorUrl"] as! String,apiToken: config["apiKey"] as! String, payload: crashPayload) { (error) in + if let error = error { + print("Error: \(error)") + } else { + print("Request successful") + } + } + + + } + func sendPostRequest(collector: String, apiToken: String, payload: [String: Any], completion: @escaping (Error?) -> Void) { + + guard let url = URL(string: collector) else { + print("Invalid URL") + return + } + + // Convert the payload dictionary to JSON data + do { + let jsonData = try JSONSerialization.data(withJSONObject: payload, options: []) + + let jsonString = String(data: jsonData, encoding: .utf8) + var request = URLRequest(url: url) + request.httpMethod = "POST" + + request.addValue(apiToken, forHTTPHeaderField: "x-api-token") + request.addValue("application/json", forHTTPHeaderField: "Content-Type") + + request.httpBody = jsonData + + let task = URLSession.shared.dataTask(with: request) { (data, response, error) in + if let error = error { + completion(error) + return + } + + + completion(nil) + } + + task.resume() + + } catch { + completion(error) + } + } + + +} + +internal struct RumMeta{ + init(){} + func asDictionary(){} +} +internal struct RumExceptionFormat{ + let type: String? + let value: String? + let stacktrace: Dictionary + let timestamp: String +// let context: Dictionary? + + var jsonAbbreviation : [String: Any] { + return [ + "type": type ?? "", + "value": value ?? "", + "stacktrace": stacktrace, + "timestamp": timestamp, +// "context": context ?? "" + ] + } + init(type: String?, value: String?, stacktrace: Dictionary, timestamp: String) { + self.type = type + self.value = value + self.stacktrace = stacktrace + self.timestamp = timestamp +// self.context = context + } + +} +internal struct CrashReportMinifier{ + + private let stackFramesLimit: Int + init(){ + self.stackFramesLimit = 150 + } + + func minify(crashReport: inout CrashReport){ + var truncated = false + + if let exceptionStackFrames = crashReport.exceptionInfo?.stackFrames { + let reducedStackFrames = limit(stackFrames: exceptionStackFrames) + truncated = truncated || (reducedStackFrames.count != exceptionStackFrames.count) + crashReport.exceptionInfo?.stackFrames = reducedStackFrames + } + + // Keep thread stack traces under limit: + crashReport.threads = crashReport.threads.map { thread in + var thread = thread + let reducedStackFrames = limit(stackFrames: thread.stackFrames) + truncated = truncated || (reducedStackFrames.count != thread.stackFrames.count) + thread.stackFrames = reducedStackFrames + return thread + } + + crashReport.wasTruncated = truncated + + crashReport.binaryImages = remove( + crashReport: crashReport, binaryImages: crashReport.binaryImages + ) + + } + func limit(stackFrames: [StackFrame]) -> [StackFrame]{ + + if stackFrames.count > stackFramesLimit { + var frames = stackFrames + + let numberOfFramesToRemove = stackFrames.count - stackFramesLimit + let middleFrameIndex = stackFrames.count / 2 + let lowerBound = middleFrameIndex - numberOfFramesToRemove / 2 + let upperBound = lowerBound + numberOfFramesToRemove + + frames.removeSubrange(lowerBound.. [BinaryImageInfo]{ + var imageNamesFromStackFrames: Set = [] + + if let exceptionStackFrames = crashReport.exceptionInfo?.stackFrames { + imageNamesFromStackFrames.formUnion(exceptionStackFrames.compactMap { $0.libraryName }) + } + + crashReport.threads.forEach { thread in + imageNamesFromStackFrames.formUnion(thread.stackFrames.compactMap { $0.libraryName }) + } + + return binaryImages.filter { image in + return imageNamesFromStackFrames.contains(image.imageName) // if it's referenced in the stack trace + } + } + + +} + +internal struct CrashReportExporter{ + + private let unknown = "" + private let signalDescription = [ + "SIGSIGNAL 0": "Signal 0", + "SIGHUP": "Hangup", + "SIGINT": "Interrupt", + "SIGQUIT": "Quit", + "SIGILL": "Illegal instruction", + "SIGTRAP": "Trace/BPT trap", + "SIGABRT": "Abort trap", + "SIGEMT": "EMT trap", + "SIGFPE": "Floating point exception", + "SIGKILL": "Killed", + "SIGBUS": "Bus error", + "SIGSEGV": "Segmentation fault", + "SIGSYS": "Bad system call", + "SIGPIPE": "Broken pipe", + "SIGALRM": "Alarm clock", + "SIGTERM": "Terminated", + "SIGURG": "Urgent I/O condition", + "SIGSTOP": "Suspended (signal)", + "SIGTSTP": "Suspended", + "SIGCONT": "Continued", + "SIGCHLD": "Child exited", + "SIGTTIN": "Stopped (tty input)", + "SIGTTOU": "Stopped (tty output)", + "SIGIO": "I/O possible", + "SIGXCPU": "Cputime limit exceeded", + "SIGXFSZ": "Filesize limit exceeded", + "SIGVTALRM": "Virtual timer expired", + "SIGPROF": "Profiling timer expired", + "SIGWINCH": "Window size changes", + "SIGINFO": "Information request", + "SIGUSR1": "User defined signal 1", + "SIGUSR2": "User defined signal 2", + ] + func export(crashReport: CrashReport) -> Dictionary{ + let dateFormatter = DateFormatter() + dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'" + dateFormatter.timeZone = TimeZone(abbreviation: "UTC") + + return (RumExceptionFormat(type: formattedType(for: crashReport), value: formattedValue(for: crashReport), stacktrace: ["frames":formattedStack(for: crashReport)], + timestamp: dateFormatter.string(from: crashReport.systemInfo?.timestamp ?? Date()) + // TODO: add context: binaryImages, ThreadInfo,contextData, Meta,truncation + // context: [ + // "binaryImages": "", + // "threads": "", + // "wasTruncated": "" + // ] + ).jsonAbbreviation) + + } + + private func formattedType(for crashReport: CrashReport) -> String { + return "\(crashReport.signalInfo?.name ?? unknown) (\(crashReport.signalInfo?.code ?? unknown))" + } + + private func formattedValue(for crashReport: CrashReport) -> String { + if let exception = crashReport.exceptionInfo { + let exceptionName = exception.name ?? unknown + let exceptionReason = exception.reason ?? unknown + return "Terminating app due to uncaught exception '\(exceptionName)', reason: '\(exceptionReason)'." + } else { + guard let signalName = crashReport.signalInfo?.name else { + return "Application crash: \(unknown)" + } + + if let signalDescription = signalDescription[signalName] { + return "Application crash: \(signalName) (\(signalDescription))" + } else { + return "Application crash: \(unknown)" + } + } + } + + + private func formattedStack(for crashReport: CrashReport) -> [Dictionary] { + let crashedThread = crashReport.threads.first { $0.crashed } + let exception = crashReport.exceptionInfo + + // Consider most meaningful stack trace in this order: + // - uncaught exception stack trace (if available) + // - crashed thread stack trace (must be available) + // - first thread stack trace (sanity fallback) + let mostMeaningfulStackFrames = exception?.stackFrames + ?? crashedThread?.stackFrames + ?? crashReport.threads.first?.stackFrames + + guard let stackFrames = mostMeaningfulStackFrames else { + return [] + } + + return sanitized(stackFrames: stackFrames).map { stackframe in + return stackframe.jsonRepresentation + } + } + + // MARK: - Exporting meta information + private func formattedMeta(for crashReport: CrashReport) -> String { + let process = crashReport.processInfo.map { info in + info.processName.map { "\($0) [\(info.processID)]" } ?? "[\(info.processID)]" + } + + let parentProcess = crashReport.processInfo.map { info in + info.parentProcessName.map { "\($0) [\(info.parentProcessID)]" } ?? "[\(info.parentProcessID)]" + } + + let anyBinaryImageWithKnownArchitecture = crashReport.binaryImages.first { $0.codeType?.architectureName != nil } + let cpuArchitecture = anyBinaryImageWithKnownArchitecture?.codeType?.architectureName + + return """ + "incidentIdentifier": \(crashReport.incidentIdentifier ?? ""), + "process": \(process ?? ""), + "parentProcess": \(parentProcess ?? ""), + "path": \(crashReport.processInfo?.processPath ?? ""), + "codeType": \(cpuArchitecture ?? ""), + """ + } + + // MARK: - Sanitizing + + private func sanitized(stackFrames: [StackFrame]) -> [StackFrame] { + guard let _ = stackFrames.last else { + return stackFrames + } + return [] + func asDictionary(){ + + } + } + +} diff --git a/packages/rum_sdk/ios/Classes/RefreshRateVitals.swift b/packages/rum_sdk/ios/Classes/RefreshRateVitals.swift new file mode 100644 index 0000000..f81fed6 --- /dev/null +++ b/packages/rum_sdk/ios/Classes/RefreshRateVitals.swift @@ -0,0 +1,124 @@ +import Foundation +import UIKit +import os + +// let logging = Logger(subsystem: "com.example.rumsdk", category: "refresh_vitals") + + +public class RefreshRateVitals{ + private var displayLink: CADisplayLink? + private var lastFrameTimestamp: CFTimeInterval? + private var nextFrameDuration: CFTimeInterval? + private static var backendSupportedFrameRate = 60.0 + public static var lastRefreshRate: Double? = nil + + init() { + start() + } + + deinit { + stop() + } + + // MARK: - Internal + + func framesPerSecond(provider: FrameInfoProvider) -> Double? { + var fps: Double? = nil + + if let lastFrameTimestamp = self.lastFrameTimestamp { + let currentFrameDuration = provider.currentFrameTimestamp - lastFrameTimestamp + guard currentFrameDuration > 0 else { + return nil + } + let currentFPS = 1.0 / currentFrameDuration + + // ProMotion displays (e.g. iPad Pro and newer iPhone Pro) can have refresh rate higher than 60 FPS. + + if let expectedCurrentFrameDuration = self.nextFrameDuration, provider.adaptiveFrameRateSupported { + guard expectedCurrentFrameDuration > 0 else { + return nil + } + let expectedFPS = 1.0 / expectedCurrentFrameDuration + fps = currentFPS * (Self.backendSupportedFrameRate / expectedFPS) + } else { + fps = currentFPS + } + } + + self.lastFrameTimestamp = provider.currentFrameTimestamp + self.nextFrameDuration = provider.nextFrameTimestamp - provider.currentFrameTimestamp + + return fps + } + + + + + // MARK: - Private + + @objc + private func displayTick(link: CADisplayLink) { + guard let fps = framesPerSecond(provider: link) else { + return + } + RefreshRateVitals.lastRefreshRate = fps + + } + + func start() { + guard displayLink == nil else { + return + } + + NSLog("start in cpuinfo") + + displayLink = CADisplayLink(target: self, selector: #selector(displayTick(link:))) + displayLink?.add(to: .main, forMode: .common) + } + + private func stop() { + displayLink?.invalidate() + displayLink = nil + lastFrameTimestamp = nil + } + + @objc + private func appWillResignActive() { + stop() + } + + @objc + private func appDidBecomeActive() { + start() + } +} + +internal protocol FrameInfoProvider { + var currentFrameTimestamp: CFTimeInterval { get } + + var nextFrameTimestamp: CFTimeInterval { get } + + var maximumDeviceFramesPerSecond: Int { get } +} + +private let adaptiveFrameRateThreshold = 60 +extension FrameInfoProvider { + var adaptiveFrameRateSupported: Bool { + maximumDeviceFramesPerSecond > adaptiveFrameRateThreshold + } +} + +extension CADisplayLink: FrameInfoProvider { + + var maximumDeviceFramesPerSecond: Int { + UIScreen.main.maximumFramesPerSecond + } + + var currentFrameTimestamp: CFTimeInterval { + timestamp + } + + var nextFrameTimestamp: CFTimeInterval { + targetTimestamp + } +} diff --git a/packages/rum_sdk/ios/Classes/RumCrashReport.swift b/packages/rum_sdk/ios/Classes/RumCrashReport.swift new file mode 100644 index 0000000..04c6d28 --- /dev/null +++ b/packages/rum_sdk/ios/Classes/RumCrashReport.swift @@ -0,0 +1,331 @@ +import CrashReporter +import Foundation + +internal struct CrashReport { + /// A client-generated 16-byte UUID of the incident. + var incidentIdentifier: String? + /// System information from the moment of crash. + var systemInfo: SystemInfo? + /// Information about the process that crashed. + var processInfo: CrashedProcessInfo? + /// Information about the fatal signal. + var signalInfo: SignalInfo? + /// Uncaught exception information. Only available if a crash was caused by an uncaught exception, otherwise `nil`. + var exceptionInfo: ExceptionInfo? + /// Information about all threads running at the moment of crash. + var threads: [ThreadInfo] + /// Information about binary images loaded by the process. + var binaryImages: [BinaryImageInfo] + /// Custom user data injected before the crash occurred. + var contextData: Data? + /// Additional flag (for telemetry) meaning if any of the stack traces was truncated due to minification. + var wasTruncated: Bool +} + +/// Intermediate representation of `PLCrashReportSystemInfo`. +internal struct SystemInfo { + /// Date and time when the crash report was generated. + var timestamp: Date? +} + +/// Intermediate representation of `PLCrashReportProcessInfo`. +internal struct CrashedProcessInfo { + /// The name of the process. + var processName: String? + /// The process ID. + var processID: UInt + /// The path to the process executable. + var processPath: String? + /// The parent process ID. + var parentProcessID: UInt + /// The parent process name + var parentProcessName: String? +} + +/// Intermediate representation of `PLCrashReportSignalInfo`. +internal struct SignalInfo { + /// The name of the corresponding BSD termination signal, e.g. `SIGTRAP`. + /// This corresponds to _"Exception Type"_ in Apple Crash Report format. + var name: String? + /// Termination signal code, e.g. `"#0`. Together with `address` it can be used for giving more + /// context, e.g. `"#0 at 0x1b0ad6aa8"`. + /// This corresponds to _"Exception Codes"_ in Apple Crash Report format. + var code: String? + /// The faulting instruction address. + var address: UInt64 +} + +/// Intermediate representation of `PLCrashReportExceptionInfo`. +internal struct ExceptionInfo { + /// The exception name, e.g. `NSInternalInconsistencyException`. + var name: String? + /// The exception reason, e.g. `unable to dequeue a cell with identifier foo - (...)`. + var reason: String? + /// The stack trace of this exception. + var stackFrames: [StackFrame] +} + +/// Intermediate representation of `PLCrashReportThreadInfo`. +internal struct ThreadInfo { + /// Application thread number. + var threadNumber: Int + /// If this thread crashed. + var crashed: Bool + /// The stack trace of this thread. + var stackFrames: [StackFrame] +} + +/// Intermediate representation of `PLCrashReportBinaryImageInfo`. +internal struct BinaryImageInfo { + internal struct CodeType { + /// The name of CPU architecture. + var architectureName: String? + } + + /// The UUID of this image. + var uuid: String? + /// The name of this image (referenced by "library name" in the stack frame). + var imageName: String + /// If its a system library image. + var isSystemImage: Bool + /// Image code type (code architecture information). + var codeType: CodeType? + /// The load address of this image. + var imageBaseAddress: UInt64 + /// The size of this image segment. + var imageSize: UInt64 + + var jsonRepresentation: [String: Any] { + return [ + "uuid": uuid, + "imageName": imageName, + "isSystemImage": isSystemImage, + "codeType": codeType?.architectureName, + "imageBaseAddress": imageBaseAddress, + "imageSize": imageSize + + ] + } +} + +/// Intermediate representation of `PLCrashReportStackFrameInfo`. +internal struct StackFrame : Codable{ + /// The number of this frame in the stack trace. + /// This must be recorded as less meaningful stack frames might be removed when minifying the `CrashReport`. + var number: Int + /// The name of the library that produced this frame (the "image name" from binary image). + var libraryName: String? + /// The load address of the library that produced this frame (the "image base address" from binary image). + var libraryBaseAddress: UInt64? + /// The instruction pointer of this frame. + var instructionPointer: UInt64 + + var jsonRepresentation: [String: Any] { + return [ + "lineno":number, + "colno":0, + "filename": libraryName ?? "", + "function": "\(libraryBaseAddress) \(instructionPointer)" + ] + } +} + +// MARK: - Reading intermediate values from PLCR types + +internal struct CrashReportException: Error { + let description: String +} + +extension CrashReport { + init(from plcr: PLCrashReport) throws { + guard let threads = plcr.threads, + let images = plcr.images else { + // Sanity check - this shouldn't be reachable. + // The crash report must specify some threads and some binary images. + throw CrashReportException( + description: "Received inconsistent `PLCrashReport` # has threads = \(plcr.threads != nil), has images = \(plcr.images != nil)" + ) + } + + if let uuid = plcr.uuidRef, let uuidString = CFUUIDCreateString(nil, uuid) { + self.incidentIdentifier = uuidString as String + } else { + self.incidentIdentifier = nil + } + + self.systemInfo = SystemInfo(from: plcr) + self.processInfo = CrashedProcessInfo(from: plcr) + self.signalInfo = SignalInfo(from: plcr) + self.exceptionInfo = ExceptionInfo(from: plcr) + + self.threads = threads + .compactMap { $0 as? PLCrashReportThreadInfo } + .map { ThreadInfo(from: $0, in: plcr) } + + self.binaryImages = images + .compactMap { $0 as? PLCrashReportBinaryImageInfo } + .compactMap { BinaryImageInfo(from: $0) } + + self.contextData = plcr.customData + self.wasTruncated = false + } +} + +extension SystemInfo { + init?(from plcr: PLCrashReport) { + guard let systemInfo = plcr.systemInfo else { + return nil + } + + self.timestamp = systemInfo.timestamp + } +} + +extension CrashedProcessInfo { + init?(from plcr: PLCrashReport) { + guard plcr.hasProcessInfo, let processInfo = plcr.processInfo else { + return nil + } + + self.processName = processInfo.processName + self.processID = processInfo.processID + self.processPath = processInfo.processPath + self.parentProcessID = processInfo.parentProcessID + self.parentProcessName = processInfo.parentProcessName + } +} + +extension SignalInfo { + init?(from plcr: PLCrashReport) { + guard let signalInfo = plcr.signalInfo else { + return nil + } + + self.name = signalInfo.name + self.code = signalInfo.code + self.address = signalInfo.address + } +} + +extension ExceptionInfo { + init?(from plcr: PLCrashReport) { + guard plcr.hasExceptionInfo, let exceptionInfo = plcr.exceptionInfo else { + // The crash was not caused by an uncaught exception. + return nil + } + + self.name = exceptionInfo.exceptionName + self.reason = exceptionInfo.exceptionReason + + if let stackFrames = exceptionInfo.stackFrames { + self.stackFrames = stackFrames + .compactMap { $0 as? PLCrashReportStackFrameInfo } + .enumerated() + .map { number, frame in StackFrame(from: frame, number: number, in: plcr) } + } else { + self.stackFrames = [] + } + } +} + +extension ThreadInfo { + init(from threadInfo: PLCrashReportThreadInfo, in crashReport: PLCrashReport) { + self.threadNumber = threadInfo.threadNumber + self.crashed = threadInfo.crashed + + if let stackFrames = threadInfo.stackFrames { + self.stackFrames = stackFrames + .compactMap { $0 as? PLCrashReportStackFrameInfo } + .enumerated() + .map { number, frame in StackFrame(from: frame, number: number, in: crashReport) } + } else { + self.stackFrames = [] + } + } +} + +extension BinaryImageInfo { + init?(from imageInfo: PLCrashReportBinaryImageInfo) { + guard let imagePath = imageInfo.imageName else { + // We can drop this image as it won't be useful for symbolication + return nil + } + + self.uuid = imageInfo.imageUUID + self.imageName = URL(fileURLWithPath: imagePath).lastPathComponent + + #if targetEnvironment(simulator) + self.isSystemImage = Self.isPathSystemImageInSimulator(imagePath) + #else + self.isSystemImage = Self.isPathSystemImageInDevice(imagePath) + #endif + + if let codeType = imageInfo.codeType { + self.codeType = CodeType(from: codeType) + } else { + // The architecture name of this image is unknown, but symbolication will be possible. + self.codeType = nil + } + + self.imageBaseAddress = imageInfo.imageBaseAddress + self.imageSize = imageInfo.imageSize + } + + static func isPathSystemImageInSimulator(_ path: String) -> Bool { + // in simulator, example system image path: ~/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/... + return path.contains("/Contents/Developer/Platforms/") + } + + static func isPathSystemImageInDevice(_ path: String) -> Bool { + // in device, example user image path: .../containers/Bundle/Application/0000/Runner.app/Frameworks/... + let isUserImage = path.contains("/Bundle/Application/") + return !isUserImage + } +} + +extension BinaryImageInfo.CodeType { + init?(from processorInfo: PLCrashReportProcessorInfo) { + guard processorInfo.typeEncoding == PLCrashReportProcessorTypeEncodingMach else { + // Unknown processor type - skip. + return nil + } + + let type = processorInfo.type + let subtype = processorInfo.subtype + let subtypeMask = UInt64(CPU_SUBTYPE_MASK) + + // Ref. for this check: + // https://github.com/microsoft/plcrashreporter/blob/dbb05c0bc883bde1cfcad83e7add25862c95d11f/Source/PLCrashReportTextFormatter.m#L371 + switch type { + case UInt64(CPU_TYPE_X86): self.architectureName = "i386" + case UInt64(CPU_TYPE_X86_64): self.architectureName = "x86_64" + case UInt64(CPU_TYPE_ARM): self.architectureName = "arm" + case UInt64(CPU_TYPE_ARM64): + switch subtype & ~subtypeMask { + case UInt64(CPU_SUBTYPE_ARM64_ALL): self.architectureName = "arm64" + case UInt64(CPU_SUBTYPE_ARM64_V8): self.architectureName = "armv8" + case UInt64(CPU_SUBTYPE_ARM64E): self.architectureName = "arm64e" + default: self.architectureName = "arm64-unknown" + } + default: + self.architectureName = nil + } + } +} + +extension StackFrame { + init(from stackFrame: PLCrashReportStackFrameInfo, number: Int, in crashReport: PLCrashReport) { + self.number = number + self.instructionPointer = stackFrame.instructionPointer + + // Without "library name" and its "base address" symbolication will not be possible, + // but the presence of this frame in the stack will be still relevant. + let image = crashReport.image(forAddress: stackFrame.instructionPointer) + + self.libraryBaseAddress = image?.imageBaseAddress + + if let imagePath = image?.imageName { + self.libraryName = URL(fileURLWithPath: imagePath).lastPathComponent + } + } +} diff --git a/packages/rum_sdk/ios/Classes/RumSdkPlugin.swift b/packages/rum_sdk/ios/Classes/RumSdkPlugin.swift new file mode 100644 index 0000000..94f3a60 --- /dev/null +++ b/packages/rum_sdk/ios/Classes/RumSdkPlugin.swift @@ -0,0 +1,108 @@ +import Flutter +import UIKit +import Foundation +import CrashReporter + + +public class RumSdkPlugin: NSObject, FlutterPlugin { + public static func register(with registrar: FlutterPluginRegistrar) { + let channel = FlutterMethodChannel(name: "rum_sdk", binaryMessenger: registrar.messenger()) + let instance = RumSdkPlugin() + +// if(isCrashReportAutoEnabled() == true){ +// let crashreporter = CrashReportingIntegration() +// } + registrar.addMethodCallDelegate(instance, channel: channel) + NotificationCenter.default.addObserver(instance, selector: #selector(applicationDidBecomeActive), name: UIApplication.didBecomeActiveNotification, object: nil) + + } + + private static func isCrashReportAutoEnabled() -> Bool{ + return false + } + + deinit { + // Remove observers or perform other cleanup here + AppStart.clear() + NotificationCenter.default.removeObserver(self) + } + + @objc private func applicationDidBecomeActive() { + // Handle the app becoming active + var time: timeval = timeval(tv_sec: 0, tv_usec: 0) + gettimeofday(&time, nil) + + let currentTimeMilliseconds = Double(Int64(time.tv_sec) * 1000) + Double(time.tv_usec) / 1000.0 + AppStart.setAppStartEndMillis(currentTimeMilliseconds) + + } + + public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { + switch call.method { + case "enableCrashReporter": + do{ + let crashReporter = try CrashReportingIntegration(crashReporterConfig: call.arguments as! [String: Any]) + } catch { + print("crash reporter not initialized") + } + case "getPlatformVersion": + result("iOS " + UIDevice.current.systemVersion); + case "uptimeUI": + result(CACurrentMediaTime()); + case "initMobileApp": + result("IOS init"); + case "getAppStart": + let appStart = Int64(AppStart.getAppStartDuration()) + let appStartMetrics: [String: Any] = [ + "appStartDuration": appStart, + ] + result(appStartMetrics); + case "getCpuUsage": + result(CPUInfo.getCpuInfo()); + case "initRefreshRate": + let _ = RefreshRateVitals() + result(nil) + case "getRefreshRate": + result(RefreshRateVitals.lastRefreshRate) + case "getANRStatus": + result("ANRStatus"); + case "getMemoryUsage": + print("getMemoryUsage"); + var _:[String] = []; + var lastEventTime = CACurrentMediaTime(); + var memory = getMemoryUsage()/1024 + result( memory); + default: + result(FlutterMethodNotImplemented); + } + + } + func getMemoryUsage() -> Double { + let task_vm_info_count = MemoryLayout.size / MemoryLayout.size + + var vmInfo = task_vm_info() + var vmInfoSize = mach_msg_type_size_t(task_vm_info_count) + + let kern: kern_return_t = withUnsafeMutablePointer(to: &vmInfo) { + $0.withMemoryRebound(to: integer_t.self, capacity: 1) { + task_info( + mach_task_self_, + task_flavor_t(TASK_VM_INFO), + $0, + &vmInfoSize + ) + } + } + + if kern == KERN_SUCCESS { + // print(vmInfo.resident_size); + return Double(vmInfo.resident_size) + } else { + //print("kern size undefined"); + return 0.0 + } + } + + +} + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/Info.plist b/packages/rum_sdk/ios/CrashReporter.xcframework/Info.plist new file mode 100644 index 0000000..788774c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/Info.plist @@ -0,0 +1,96 @@ + + + + + AvailableLibraries + + + LibraryIdentifier + tvos-arm64_x86_64-simulator + LibraryPath + CrashReporter.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + tvos + SupportedPlatformVariant + simulator + + + LibraryIdentifier + ios-arm64_x86_64-maccatalyst + LibraryPath + CrashReporter.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + maccatalyst + + + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + CrashReporter.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + LibraryIdentifier + macos-arm64_x86_64 + LibraryPath + CrashReporter.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + macos + + + LibraryIdentifier + tvos-arm64 + LibraryPath + CrashReporter.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + tvos + + + LibraryIdentifier + ios-arm64_arm64e + LibraryPath + CrashReporter.framework + SupportedArchitectures + + arm64 + arm64e + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/CrashReporter b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/CrashReporter new file mode 100644 index 0000000..0dfc653 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/CrashReporter differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/CrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/CrashReporter.h new file mode 100644 index 0000000..99878d3 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/CrashReporter.h @@ -0,0 +1,366 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifdef __APPLE__ +#import +#endif + +#if __has_include() + +// This must be included before any other PLCrashReporter includes, as +// it redefines symbol names +#import + +/* Library Imports */ +#import +#import +#import +#else +#import "PLCrashNamespace.h" +#import "PLCrashReporter.h" +#import "PLCrashReport.h" +#import "PLCrashReportTextFormatter.h" +#endif + +/** + * @defgroup functions Crash Reporter Functions Reference + */ + +/** + * @defgroup types Crash Reporter Data Types Reference + */ + +/** + * @defgroup constants Crash Reporter Constants Reference + */ + +/** + * @internal + * @defgroup plcrash_internal Crash Reporter Internal Documentation + */ + +/** + * @defgroup enums Enumerations + * @ingroup constants + */ + +/** + * @defgroup globals Global Variables + * @ingroup constants + */ + +/** + * @defgroup exceptions Exceptions + * @ingroup constants + */ + +/* Exceptions */ +extern NSString *PLCrashReporterException; + +/* Error Domain and Codes */ +extern NSString *PLCrashReporterErrorDomain; + +/** + * NSError codes in the Plausible Crash Reporter error domain. + * @ingroup enums + */ +typedef enum { + /** An unknown error has occured. If this + * code is received, it is a bug, and should be reported. */ + PLCrashReporterErrorUnknown = 0, + + /** An Mach or POSIX operating system error has occured. The underlying NSError cause may be fetched from the userInfo + * dictionary using the NSUnderlyingErrorKey key. */ + PLCrashReporterErrorOperatingSystem = 1, + + /** The crash report log file is corrupt or invalid */ + PLCrashReporterErrorCrashReportInvalid = 2, + + /** An attempt to use a resource which was in use at the time in a manner which would have conflicted with the request. */ + PLCrashReporterErrorResourceBusy = 3 +} PLCrashReporterError; + +/** + * @mainpage Plausible Crash Reporter + * + * @section intro_sec Introduction + * + * Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X. + * + * The following features are supported: + * + * - Implemented as an in-process signal handler. + * - Does not interfer with debugging in gdb.. + * - Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc). + * - Full thread state for all active threads (backtraces, register dumps) is provided. + * + * If your application crashes, a crash report will be written. When the application is next run, you may check for a + * pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the + * report locally. + * + * @section intro_encoding Crash Report Format + * + * Crash logs are encoded using google protobuf, and may be decoded + * using the provided PLCrashReport API. Additionally, the include plcrashutil handles conversion of binary crash reports to the + * symbolicate-compatible iPhone text format. + * + * @section doc_sections Documentation Sections + * - @subpage example_usage_iphone + * - @subpage error_handling + * - @subpage async_safety + */ + +/** + * @page example_usage_iphone Example iPhone Usage + * + * @code + * // + * // Called to handle a pending crash report. + * // + * - (void) handleCrashReport { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSData *crashData; + * NSError *error; + * + * // Try loading the crash report + * crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error]; + * if (crashData == nil) { + * NSLog(@"Could not load crash report: %@", error); + * goto finish; + * } + * + * // We could send the report from here, but we'll just print out + * // some debugging info instead + * PLCrashReport *report = [[[PLCrashReport alloc] initWithData: crashData error: &error] autorelease]; + * if (report == nil) { + * NSLog(@"Could not parse crash report"); + * goto finish; + * } + * + * NSLog(@"Crashed on %@", report.systemInfo.timestamp); + * NSLog(@"Crashed with signal %@ (code %@, address=0x%" PRIx64 ")", report.signalInfo.name, + * report.signalInfo.code, report.signalInfo.address); + * + * // Purge the report + * finish: + * [crashReporter purgePendingCrashReport]; + * return; + * } + * + * // from UIApplicationDelegate protocol + * - (void) applicationDidFinishLaunching: (UIApplication *) application { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSError *error; + * + * // Check if we previously crashed + * if ([crashReporter hasPendingCrashReport]) + * [self handleCrashReport]; + + * // Enable the Crash Reporter + * if (![crashReporter enableCrashReporterAndReturnError: &error]) + * NSLog(@"Warning: Could not enable crash reporter: %@", error); + * + * } + * @endcode + * + */ + +/** + * @page error_handling Error Handling Programming Guide + * + * Where a method may return an error, Plausible Crash Reporter provides access to the underlying + * cause via an optional NSError argument. + * + * All returned errors will be a member of one of the below defined domains, however, new domains and + * error codes may be added at any time. If you do not wish to report on the error cause, many methods + * support a simple form that requires no NSError argument. + * + * @section error_domains Error Domains, Codes, and User Info + * + * @subsection crashreporter_errors Crash Reporter Errors + * + * Any errors in Plausible Crash Reporter use the #PLCrashReporterErrorDomain error domain, and and one + * of the error codes defined in #PLCrashReporterError. + */ + +/** + * @page async_safety Async-Safe Programming Guide + * + * Plausible CrashReporter provides support for executing an application specified function in the context of the + * crash reporter's signal handler, after the crash report has been written to disk. This was a regularly requested + * feature, and provides the ability to implement application finalization in the event of a crash. However, writing + * code intended for execution inside of a signal handler is exceptionally difficult, and is not recommended. + * + * @section program_flow Program Flow and Signal Handlers + * + * When the signal handler is called the normal flow of the program is interrupted, and your program is an unknown + * state. Locks may be held, the heap may be corrupt (or in the process of being updated), and your signal + * handler may invoke a function that was being executed at the time of the signal. This may result in deadlocks, + * data corruption, and program termination. + * + * @section functions Async-Safe Functions + * + * A subset of functions are defined to be async-safe by the OS, and are safely callable from within a signal handler. If + * you do implement a custom post-crash handler, it must be async-safe. A table of POSIX-defined async-safe functions + * and additional information is available from the + * CERT programming guide - SIG30-C + * + * Most notably, the Objective-C runtime itself is not async-safe, and Objective-C may not be used within a signal + * handler. + * + * @sa PLCrashReporter::setCrashCallbacks: + */ + +/** + * @page mach_exceptions Mach Exceptions on Mac OS X and iOS + * + * PLCrashReporter includes support for monitoring crashes via an in-process Mach exception handler. There are a small + * number of crash cases that will not be caught with via a POSIX signal handler, but can be caught via a Mach + * exception handler: + * + * - Stack overflow. sigaltstack() is broken in later iOS releases, and even if functional, must be configured + * on a per-thread basis. + * - Internal Apple assertions that call libSystem's __assert. These include compiler-checked constraints + * for built-in functions, such as strcpy_chk(). The __abort() implementation actually disables the SIGABRT + * signal handler (resetting it to SIG_DFL) prior to to issueing a SIGABRT, bypassing signal-based crash + * reporters entirely. + * + * Unfortunately, the latter issue (__assert) can not be handled on iOS; trapping abort requires that + * a Mach exception handler operate out-of-process, which is impossible on iOS. On Mac OS X, this will + * only be handled once we've implemented fully out-of-process crash excution. + * + * On Mac OS X, the Mach exception implementation is fully supported using entirely public API. On iOS, + * the APIs required are not fully public -- more details on the implications of this for exception handling on + * iOS may be found in @ref mach_exceptions_ios below. It is worth noting that even where the Mach exception APIs + * are fully supported, kernel-internal constants, as well + * as architecture-specific trap information, may be required to fully interpret a Mach exception's root cause. + * + * For example, the EXC_SOFTWARE exception is dispatched for four different failure types, using the exception + * code to differentiate failure types: + * - Non-existent system call invoked (SIGSYS) + * - Write on a pipe with no reader (SIGPIPE) + * - Abort program (SIGABRT -- unused) + * - Kill program (SIGKILL) + * + * Of those four types, only the constant required to interpret the SIGKILL behavior (EXC_SOFT_SIGNAL) is publicly defined. + * Of the remaining three failure types, the constant values are kernel implementation-private, defined only in the available + * kernel sources. On iOS, these sources are unavailable, and while they generally do match the Mac OS X implementation, there + * are no gaurantees that this is -- or will remain -- the case in the future. + * + * Likewise, interpretation of particular fault types requires information regarding the underlying machine traps + * that triggered the Mach exceptions. For example, a floating point trap on x86/x86-64 will trigger an EXC_ARITHMETIC, + * with a subcode value containing the value of the FPU status register. Determining the exact FPU cause requires + * extracting the actual exception flags from status register as per the x86 architecture documentation. The exact format + * of this subcode value is not actually documented outside the kernel, and may change in future releases. + * + * While we have the advantage of access to the x86 kernel sources, the situation on ARM is even less clear. The actual + * use of the Mach exception codes and subcodes is largely undefined by both headers and publicly available documentation, + * and the available x86 kernel sources are of little use in interpreting this data. + * + * As such, while Mach exceptions may catch some cases that BSD signals can not, they are not a perfect solution, + * and may also provide less insight into the actual failures that occur. By comparison, the BSD signal interface + * is both fully defined and architecture independent, with any necessary interpretation of the Mach exception + * codes handled in-kernel at the time of exception dispatch. It is generally recommended by Apple as the preferred + * interface, and should generally be preferred by PLCrashReporter API clients. + * + * @section mach_exceptions_compatibility Compatibility Issues + * + * @subsection Debuggers + * + * Enabling in-process Mach exception handlers will conflict with any attached debuggers; the debugger + * may suspend the processes Mach exception handling thread, which will result in any exception messages + * sent via the debugger being lost, as the in-process handler will be unable to receive and forward + * the messages. + * + * @subsection Managed Runtimes (Xamarin, Unity) + * + * A Mach exception handler may conflict with any managed runtime that registers a BSD signal handler that + * can safely handle otherwise fatal signals, allowing execution to proceed. This includes products + * such as Xamarin for iOS. + * + * In such a case, PLCrashReporter will write a crash report for non-fatal signals, as there is no + * immediate mechanism for determining whether a signal handler exists and that it can safely + * handle the failure. This can result in unexpected delays in application execution, increased I/O to + * disk, and other undesirable operations. + * + * @section mach_exceptions_ios Mach Exceptions on iOS + * + * The APIs required for Mach exception handling are not fully public on iOS. After filing a request with + * Apple DTS to clarify the status of the Mach exception APIs on iOS, and implementing a Mach Exception + * handler using only supported API, they provided the following guidance: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited undefined API on iOS. The reporter + * may be excluded entirely at build time by modifying the PLCRASH_FEATURE_MACH_EXCEPTIONS build configuration; it + * may also be disabled at runtime by configuring the PLCrashReporter instance appropriately via PLCrashReporterConfig. + * + * The iOS implementation is implemented almost entirely using public API, and links against no actual private symbols; + * the use of undocumented functionality is limited to assuming the use of specific msgh_id values (see below + * for details). As a result, it may be considered perfectly safe to include the Mach Exception code in the + * standard build, and enable/disable it at runtime. + * + * The following issues exist in the iOS implementation: + * - The msgh_id values required for an exception reply message are not available from the available + * headers and must be hard-coded. This prevents one from safely replying to exception messages, which + * means that it is impossible to (correctly) inform the server that an exception has *not* been + * handled. + * + * Impact: + * This can lead to the process locking up and not dispatching to the host exception handler (eg, Apple's + * crash reporter), depending on the behavior of the kernel exception code. + * + * - The mach_* structure/type variants required by MACH_EXCEPTION_CODES are not publicly defined (on Mac OS X, + * these are provided by mach_exc.defs). This prevents one from forwarding exception messages to an existing + * handler that was registered with a MACH_EXCEPTION_CODES behavior (eg, forwarding is entirely non-functional + * on ARM64 devices). + * + * Impact: + * This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES, + * including other handlers registered within the current process, eg, by a managed runtime. This could + * also result in misinterpretation of a Mach exception message, in the case where the message format is + * modified by Apple to be incompatible with the existing 32-bit format. + * + * This is the case with LLDB; it will register a task exception handler with MACH_EXCEPTION_CODES set. Failure + * to correctly forward these exceptions will result in the debugger breaking in interesting ways; for example, + * changes to the set of dyld-loaded images are detected by setting a breakpoint on the dyld image registration + * funtions, and this functionality will break if the exception is not correctly forwarded. + * + * Since Mach exception handling is important for a fully functional crash reporter, we have also filed a radar + * to request that the API be made public: + * Radar: rdar://12939497 RFE: Provide mach_exc.defs for iOS + * + * At the time of this writing, the radar remains open/unresolved. + */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashFeatureConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashFeatureConfig.h new file mode 100644 index 0000000..7bcaebf --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashFeatureConfig.h @@ -0,0 +1,108 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_FEATURE_CONFIG_H +#define PLCRASH_FEATURE_CONFIG_H + +#include + +/** + * @internal + * + * Build-time configuration for PLCrashReporter. + * + * This is used to automatically enable/disable features on a per-platform and per-configuration + * basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter. + * + * @defgroup build_config Build Configuration + * @ingroup constants + * @{ + */ + +/* + * Defaults + */ + +/* + * For release builds, disable unused unwind implementations on targets that do not use them. For non-release + * builds, we include the unwind implementations to allow testing on a broader range of targets. + */ +#ifdef PLCF_RELEASE_BUILD +# if defined(__arm__) +# ifndef PLCRASH_FEATURE_UNWIND_DWARF +# define PLCRASH_FEATURE_UNWIND_DWARF 0 +# endif +# ifndef PLCRASH_FEATURE_UNWIND_COMPACT +# define PLCRASH_FEATURE_UNWIND_COMPACT 0 +# endif +# endif +#endif + +/* + * Configuration Flags + */ + + +#ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS +/** + * If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported, + * using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a + * popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either + * they've received special dispensation to use private APIs / private structures, they've found another way to do + * it, or they're just using undocumented functionality and hoping for the best. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled + * Mach exception handling by default, and provided both build-time and runtime configuration + * to disable its use. + * + * For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions. + */ +#if TARGET_OS_TV +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 0 +#else +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 1 +#endif +#endif + +#ifndef PLCRASH_FEATURE_UNWIND_DWARF +/** If true, enable DWARF unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_DWARF 1 +#endif + + +#ifndef PLCRASH_FEATURE_UNWIND_COMPACT +/** If true, enable compact unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_COMPACT 1 +#endif + +/* + * @} + */ + +#endif /* PLCRASH_FEATURE_CONFIG_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashMacros.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashMacros.h new file mode 100644 index 0000000..556e1c2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashMacros.h @@ -0,0 +1,143 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_CONSTANTS_H +#define PLCRASH_CONSTANTS_H + +#include +#include + +#if defined(__cplusplus) +# define PLCR_EXPORT extern "C" +# define PLCR_C_BEGIN_DECLS extern "C" { +# define PLCR_C_END_DECLS } +#else +# define PLCR_EXPORT extern +# define PLCR_C_BEGIN_DECLS +# define PLCR_C_END_DECLS +#endif + +#if defined(__cplusplus) +# define NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ +# define IS_EMPTY_(name) defined(NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ ## name) +# define IS_EMPTY(name) IS_EMPTY_(name) +# if defined(PLCRASHREPORTER_PREFIX) && !IS_EMPTY(PLCRASHREPORTER_PREFIX) + /** @internal Define the plcrash namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ +# define PLCR_CPP_BEGIN_NS namespace plcrash { inline namespace PLCRASHREPORTER_PREFIX { + + /** @internal Close the definition of the `plcrash` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ +# define PLCR_CPP_END_NS }} +# else +# define PLCR_CPP_BEGIN_NS namespace plcrash { +# define PLCR_CPP_END_NS } +# endif +#endif + +#ifdef __clang__ +# define PLCR_PRAGMA_CLANG(_p) _Pragma(_p) +#else +# define PLCR_PRAGMA_CLANG(_p) +#endif + +#ifdef __clang__ +# define PLCR_DEPRECATED __attribute__((deprecated)) +#else +# define PLCR_DEPRECATED +#endif + +#if defined(__clang__) || defined(__GNUC__) +# define PLCR_UNUSED __attribute__((unused)) +#else +# define PLCR_UNUSED +#endif + +#ifdef PLCR_PRIVATE +/** + * Marks a definition as deprecated only for for external clients, allowing + * uses of it internal fo the framework. + */ +# define PLCR_EXTERNAL_DEPRECATED + +/** + * @internal + * A macro to put above a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() \ + PLCR_PRAGMA_CLANG("clang diagnostic push"); \ + PLCR_PRAGMA_CLANG("clang diagnostic ignored \"-Wdocumentation-deprecated-sync\"") + +/** + * @internal + * A macro to put below a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_POP() PLCR_PRAGMA_CLANG("clang diagnostic pop") + +#else + +# define PLCR_EXTERNAL_DEPRECATED PLCR_DEPRECATED +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() + +#endif /* PLCR_PRIVATE */ + +#ifdef PLCR_PRIVATE +# if defined(__clang__) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") +# define PLCR_FALLTHROUGH [[clang::fallthrough]] +# else +# define PLCR_FALLTHROUGH do {} while (0) +# endif +#endif + +#ifdef PLCR_PRIVATE +/** + * @internal + * Static compile-time assertion. + * + * @param name The assertion name; must be valid for use within a C identifier. + * @param cond Assertion condition + */ +# define PLCR_ASSERT_STATIC(name, cond) PLCR_ASSERT_STATIC_(name, cond, __LINE__) +/* + * C++11 and C11 both provide a static_assert(). + * + * Otherwise, we have to use typedef-based static assertions. + */ +# if (defined(__cplusplus) && __cplusplus >= 201103L) || (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(#name, cond) +# define PLCR_ASSERT_STATIC__(name, cond) static_assert(cond, #name) +# else +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(name, cond, line) +# define PLCR_ASSERT_STATIC__(name, cond, line) typedef int plcf_static_assert_##name##_##line [(cond) ? 1 : -1] PLCR_UNUSED +# endif +#endif /* PLCR_PRIVATE */ + +#endif /* PLCRASH_CONSTANTS_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashNamespace.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashNamespace.h new file mode 100644 index 0000000..f4c263c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashNamespace.h @@ -0,0 +1,320 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +// #define PLCRASHREPORTER_PREFIX AcmeCo + + +// We need two extra layers of indirection to make CPP substitute +// the PLCRASHREPORTER_PREFIX define. +#define PLNS_impl2(prefix, symbol) prefix ## symbol +#define PLNS_impl(prefix, symbol) PLNS_impl2(prefix, symbol) +#define PLNS(symbol) PLNS_impl(PLCRASHREPORTER_PREFIX, symbol) + + +/* + * Rewrite all ObjC/C symbols. + * + * For C++ symbol handling, refer to the PLCR_CPP_BEGIN_NS and PLCR_CPP_END_NS + * macros. + */ +#ifdef PLCRASHREPORTER_PREFIX + +/* Objective-C Classes */ +#define PLCrashMachExceptionServer PLNS(PLCrashMachExceptionServer) +#define PLCrashReport PLNS(PLCrashReport) +#define PLCrashReportApplicationInfo PLNS(PLCrashReportApplicationInfo) +#define PLCrashReportBinaryImageInfo PLNS(PLCrashReportBinaryImageInfo) +#define PLCrashReportExceptionInfo PLNS(PLCrashReportExceptionInfo) +#define PLCrashReportMachExceptionInfo PLNS(PLCrashReportMachExceptionInfo) +#define PLCrashReportMachineInfo PLNS(PLCrashReportMachineInfo) +#define PLCrashReportProcessInfo PLNS(PLCrashReportProcessInfo) +#define PLCrashReportProcessorInfo PLNS(PLCrashReportProcessorInfo) +#define PLCrashReportRegisterInfo PLNS(PLCrashReportRegisterInfo) +#define PLCrashReportSignalInfo PLNS(PLCrashReportSignalInfo) +#define PLCrashReportStackFrameInfo PLNS(PLCrashReportStackFrameInfo) +#define PLCrashReportSymbolInfo PLNS(PLCrashReportSymbolInfo) +#define PLCrashReportSystemInfo PLNS(PLCrashReportSystemInfo) +#define PLCrashReportTextFormatter PLNS(PLCrashReportTextFormatter) +#define PLCrashReportThreadInfo PLNS(PLCrashReportThreadInfo) +#define PLCrashReporter PLNS(PLCrashReporter) +#define PLCrashSignalHandler PLNS(PLCrashSignalHandler) +#define PLCrashHostInfo PLNS(PLCrashHostInfo) +#define PLCrashMachExceptionPort PLNS(PLCrashMachExceptionPort) +#define PLCrashMachExceptionPortSet PLNS(PLCrashMachExceptionPortSet) +#define PLCrashProcessInfo PLNS(PLCrashProcessInfo) +#define PLCrashReporterConfig PLNS(PLCrashReporterConfig) +#define PLCrashUncaughtExceptionHandler PLNS(PLCrashUncaughtExceptionHandler) +#define PLCrashReportFormatter PLNS(PLCrashReportFormatter) + +/* Public C functions */ +#define PLCrashMachExceptionForward PLNS(PLCrashMachExceptionForward) +#define PLCrashSignalHandlerForward PLNS(PLCrashSignalHandlerForward) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) + + +/* Public C global symbols */ +#define PLCrashReporterErrorDomain PLNS(PLCrashReporterErrorDomain) +#define PLCrashReportHostArchitecture PLNS(PLCrashReportHostArchitecture) +#define PLCrashReportHostOperatingSystem PLNS(PLCrashReportHostOperatingSystem) +#define PLCrashReporterException PLNS(PLCrashReporterException) + +/* For backwards compatibility, plcrash_async_byteorder vends C++ methods when included under C++. We have + * to handle this distinctly from our PLCR_CPP_BEGIN_NS C++ namespacing mechanism. */ +#define plcrash_async_byteorder PLNS(plcrash_async_byteorder) + +/* + * All private C symbols. Once these are migrated to C++, we'll be able to use the much simpler + * PLCR_CPP_BEGIN_NS machinery. + * + * This list was automatically generated (and can be updated) by setting PLCRASHREPORTER_PREFIX to 'AcmeCo', + * building the library, and executing the following: + * nm -g -U | grep '^[0-9]' | c++filt | grep -v AcmeCo | grep -E '_pl|_PL' | awk '{print $3}' | cut -c 2- | sort | uniq | awk '{print "#define",$1,"PLNS("$1")"}' + */ +#define pl_mach_thread_self PLNS(pl_mach_thread_self) +#define plcrash__architecture__descriptor PLNS(plcrash__architecture__descriptor) +#define plcrash__crash_report__application_info__descriptor PLNS(plcrash__crash_report__application_info__descriptor) +#define plcrash__crash_report__application_info__init PLNS(plcrash__crash_report__application_info__init) +#define plcrash__crash_report__binary_image__descriptor PLNS(plcrash__crash_report__binary_image__descriptor) +#define plcrash__crash_report__binary_image__init PLNS(plcrash__crash_report__binary_image__init) +#define plcrash__crash_report__descriptor PLNS(plcrash__crash_report__descriptor) +#define plcrash__crash_report__exception__descriptor PLNS(plcrash__crash_report__exception__descriptor) +#define plcrash__crash_report__exception__init PLNS(plcrash__crash_report__exception__init) +#define plcrash__crash_report__free_unpacked PLNS(plcrash__crash_report__free_unpacked) +#define plcrash__crash_report__get_packed_size PLNS(plcrash__crash_report__get_packed_size) +#define plcrash__crash_report__init PLNS(plcrash__crash_report__init) +#define plcrash__crash_report__machine_info__descriptor PLNS(plcrash__crash_report__machine_info__descriptor) +#define plcrash__crash_report__machine_info__init PLNS(plcrash__crash_report__machine_info__init) +#define plcrash__crash_report__pack PLNS(plcrash__crash_report__pack) +#define plcrash__crash_report__pack_to_buffer PLNS(plcrash__crash_report__pack_to_buffer) +#define plcrash__crash_report__process_info__descriptor PLNS(plcrash__crash_report__process_info__descriptor) +#define plcrash__crash_report__process_info__init PLNS(plcrash__crash_report__process_info__init) +#define plcrash__crash_report__processor__descriptor PLNS(plcrash__crash_report__processor__descriptor) +#define plcrash__crash_report__processor__init PLNS(plcrash__crash_report__processor__init) +#define plcrash__crash_report__processor__type_encoding__descriptor PLNS(plcrash__crash_report__processor__type_encoding__descriptor) +#define plcrash__crash_report__report_info__descriptor PLNS(plcrash__crash_report__report_info__descriptor) +#define plcrash__crash_report__report_info__init PLNS(plcrash__crash_report__report_info__init) +#define plcrash__crash_report__signal__descriptor PLNS(plcrash__crash_report__signal__descriptor) +#define plcrash__crash_report__signal__init PLNS(plcrash__crash_report__signal__init) +#define plcrash__crash_report__signal__mach_exception__descriptor PLNS(plcrash__crash_report__signal__mach_exception__descriptor) +#define plcrash__crash_report__signal__mach_exception__init PLNS(plcrash__crash_report__signal__mach_exception__init) +#define plcrash__crash_report__symbol__descriptor PLNS(plcrash__crash_report__symbol__descriptor) +#define plcrash__crash_report__symbol__init PLNS(plcrash__crash_report__symbol__init) +#define plcrash__crash_report__system_info__descriptor PLNS(plcrash__crash_report__system_info__descriptor) +#define plcrash__crash_report__system_info__init PLNS(plcrash__crash_report__system_info__init) +#define plcrash__crash_report__system_info__operating_system__descriptor PLNS(plcrash__crash_report__system_info__operating_system__descriptor) +#define plcrash__crash_report__thread__descriptor PLNS(plcrash__crash_report__thread__descriptor) +#define plcrash__crash_report__thread__init PLNS(plcrash__crash_report__thread__init) +#define plcrash__crash_report__thread__register_value__descriptor PLNS(plcrash__crash_report__thread__register_value__descriptor) +#define plcrash__crash_report__thread__register_value__init PLNS(plcrash__crash_report__thread__register_value__init) +#define plcrash__crash_report__thread__stack_frame__descriptor PLNS(plcrash__crash_report__thread__stack_frame__descriptor) +#define plcrash__crash_report__thread__stack_frame__init PLNS(plcrash__crash_report__thread__stack_frame__init) +#define plcrash__crash_report__unpack PLNS(plcrash__crash_report__unpack) +#define plcrash_async_address_apply_offset PLNS(plcrash_async_address_apply_offset) +#define plcrash_async_byteorder_big_endian PLNS(plcrash_async_byteorder_big_endian) +#define plcrash_async_byteorder_direct PLNS(plcrash_async_byteorder_direct) +#define plcrash_async_byteorder_little_endian PLNS(plcrash_async_byteorder_little_endian) +#define plcrash_async_byteorder_swapped PLNS(plcrash_async_byteorder_swapped) +#define plcrash_async_cfe_entry_apply PLNS(plcrash_async_cfe_entry_apply) +#define plcrash_async_cfe_entry_free PLNS(plcrash_async_cfe_entry_free) +#define plcrash_async_cfe_entry_init PLNS(plcrash_async_cfe_entry_init) +#define plcrash_async_cfe_entry_register_count PLNS(plcrash_async_cfe_entry_register_count) +#define plcrash_async_cfe_entry_register_list PLNS(plcrash_async_cfe_entry_register_list) +#define plcrash_async_cfe_entry_return_address_register PLNS(plcrash_async_cfe_entry_return_address_register) +#define plcrash_async_cfe_entry_stack_adjustment PLNS(plcrash_async_cfe_entry_stack_adjustment) +#define plcrash_async_cfe_entry_stack_offset PLNS(plcrash_async_cfe_entry_stack_offset) +#define plcrash_async_cfe_entry_type PLNS(plcrash_async_cfe_entry_type) +#define plcrash_async_cfe_reader_find_pc PLNS(plcrash_async_cfe_reader_find_pc) +#define plcrash_async_cfe_reader_free PLNS(plcrash_async_cfe_reader_free) +#define plcrash_async_cfe_reader_init PLNS(plcrash_async_cfe_reader_init) +#define plcrash_async_cfe_register_decode PLNS(plcrash_async_cfe_register_decode) +#define plcrash_async_cfe_register_encode PLNS(plcrash_async_cfe_register_encode) +#define plcrash_async_file_close PLNS(plcrash_async_file_close) +#define plcrash_async_file_flush PLNS(plcrash_async_file_flush) +#define plcrash_async_file_init PLNS(plcrash_async_file_init) +#define plcrash_async_file_write PLNS(plcrash_async_file_write) +#define plcrash_async_find_symbol PLNS(plcrash_async_find_symbol) +#define plcrash_async_image_containing_address PLNS(plcrash_async_image_containing_address) +#define plcrash_async_image_list_next PLNS(plcrash_async_image_list_next) +#define plcrash_async_image_list_set_reading PLNS(plcrash_async_image_list_set_reading) +#define plcrash_async_mach_exception_get_siginfo PLNS(plcrash_async_mach_exception_get_siginfo) +#define plcrash_async_macho_byteorder PLNS(plcrash_async_macho_byteorder) +#define plcrash_async_macho_contains_address PLNS(plcrash_async_macho_contains_address) +#define plcrash_async_macho_cpu_subtype PLNS(plcrash_async_macho_cpu_subtype) +#define plcrash_async_macho_cpu_type PLNS(plcrash_async_macho_cpu_type) +#define plcrash_async_macho_find_command PLNS(plcrash_async_macho_find_command) +#define plcrash_async_macho_find_segment_cmd PLNS(plcrash_async_macho_find_segment_cmd) +#define plcrash_async_macho_find_symbol_by_name PLNS(plcrash_async_macho_find_symbol_by_name) +#define plcrash_async_macho_find_symbol_by_pc PLNS(plcrash_async_macho_find_symbol_by_pc) +#define plcrash_async_macho_header PLNS(plcrash_async_macho_header) +#define plcrash_async_macho_header_size PLNS(plcrash_async_macho_header_size) +#define plcrash_async_macho_map_section PLNS(plcrash_async_macho_map_section) +#define plcrash_async_macho_map_segment PLNS(plcrash_async_macho_map_segment) +#define plcrash_async_macho_mapped_segment_free PLNS(plcrash_async_macho_mapped_segment_free) +#define plcrash_async_macho_next_command PLNS(plcrash_async_macho_next_command) +#define plcrash_async_macho_next_command_type PLNS(plcrash_async_macho_next_command_type) +#define plcrash_async_macho_string_free PLNS(plcrash_async_macho_string_free) +#define plcrash_async_macho_string_get_length PLNS(plcrash_async_macho_string_get_length) +#define plcrash_async_macho_string_get_pointer PLNS(plcrash_async_macho_string_get_pointer) +#define plcrash_async_macho_string_init PLNS(plcrash_async_macho_string_init) +#define plcrash_async_macho_symtab_reader_free PLNS(plcrash_async_macho_symtab_reader_free) +#define plcrash_async_macho_symtab_reader_init PLNS(plcrash_async_macho_symtab_reader_init) +#define plcrash_async_macho_symtab_reader_read PLNS(plcrash_async_macho_symtab_reader_read) +#define plcrash_async_macho_symtab_reader_symbol_name PLNS(plcrash_async_macho_symtab_reader_symbol_name) +#define plcrash_async_memcpy PLNS(plcrash_async_memcpy) +#define plcrash_async_memset PLNS(plcrash_async_memset) +#define plcrash_async_mobject_base_address PLNS(plcrash_async_mobject_base_address) +#define plcrash_async_mobject_free PLNS(plcrash_async_mobject_free) +#define plcrash_async_mobject_init PLNS(plcrash_async_mobject_init) +#define plcrash_async_mobject_length PLNS(plcrash_async_mobject_length) +#define plcrash_async_mobject_read_uint16 PLNS(plcrash_async_mobject_read_uint16) +#define plcrash_async_mobject_read_uint32 PLNS(plcrash_async_mobject_read_uint32) +#define plcrash_async_mobject_read_uint64 PLNS(plcrash_async_mobject_read_uint64) +#define plcrash_async_mobject_read_uint8 PLNS(plcrash_async_mobject_read_uint8) +#define plcrash_async_mobject_remap_address PLNS(plcrash_async_mobject_remap_address) +#define plcrash_async_mobject_task PLNS(plcrash_async_mobject_task) +#define plcrash_async_mobject_verify_local_pointer PLNS(plcrash_async_mobject_verify_local_pointer) +#define plcrash_async_objc_cache_free PLNS(plcrash_async_objc_cache_free) +#define plcrash_async_objc_cache_init PLNS(plcrash_async_objc_cache_init) +#define plcrash_async_objc_find_method PLNS(plcrash_async_objc_find_method) +#define plcrash_async_signal_sigcode PLNS(plcrash_async_signal_sigcode) +#define plcrash_async_signal_signame PLNS(plcrash_async_signal_signame) +#define plcrash_async_strcmp PLNS(plcrash_async_strcmp) +#define plcrash_async_strerror PLNS(plcrash_async_strerror) +#define plcrash_async_strncmp PLNS(plcrash_async_strncmp) +#define plcrash_async_symbol_cache_free PLNS(plcrash_async_symbol_cache_free) +#define plcrash_async_symbol_cache_init PLNS(plcrash_async_symbol_cache_init) +#define plcrash_async_task_memcpy PLNS(plcrash_async_task_memcpy) +#define plcrash_async_task_read_uint16 PLNS(plcrash_async_task_read_uint16) +#define plcrash_async_task_read_uint32 PLNS(plcrash_async_task_read_uint32) +#define plcrash_async_task_read_uint64 PLNS(plcrash_async_task_read_uint64) +#define plcrash_async_task_read_uint8 PLNS(plcrash_async_task_read_uint8) +#define plcrash_async_thread_state_clear_all_regs PLNS(plcrash_async_thread_state_clear_all_regs) +#define plcrash_async_thread_state_clear_reg PLNS(plcrash_async_thread_state_clear_reg) +#define plcrash_async_thread_state_clear_volatile_regs PLNS(plcrash_async_thread_state_clear_volatile_regs) +#define plcrash_async_thread_state_copy PLNS(plcrash_async_thread_state_copy) +#define plcrash_async_thread_state_current PLNS(plcrash_async_thread_state_current) +#define plcrash_async_thread_state_current_stub PLNS(plcrash_async_thread_state_current_stub) +#define plcrash_async_thread_state_get_greg_size PLNS(plcrash_async_thread_state_get_greg_size) +#define plcrash_async_thread_state_get_reg PLNS(plcrash_async_thread_state_get_reg) +#define plcrash_async_thread_state_get_reg_count PLNS(plcrash_async_thread_state_get_reg_count) +#define plcrash_async_thread_state_get_reg_name PLNS(plcrash_async_thread_state_get_reg_name) +#define plcrash_async_thread_state_get_stack_direction PLNS(plcrash_async_thread_state_get_stack_direction) +#define plcrash_async_thread_state_has_reg PLNS(plcrash_async_thread_state_has_reg) +#define plcrash_async_thread_state_init PLNS(plcrash_async_thread_state_init) +#define plcrash_async_thread_state_mach_thread_init PLNS(plcrash_async_thread_state_mach_thread_init) +#define plcrash_async_thread_state_map_dwarf_to_reg PLNS(plcrash_async_thread_state_map_dwarf_to_reg) +#define plcrash_async_thread_state_map_reg_to_dwarf PLNS(plcrash_async_thread_state_map_reg_to_dwarf) +#define plcrash_async_thread_state_mcontext_init PLNS(plcrash_async_thread_state_mcontext_init) +#define plcrash_async_thread_state_set_reg PLNS(plcrash_async_thread_state_set_reg) +#define plcrash_async_writen PLNS(plcrash_async_writen) +#define plcrash_log_writer_close PLNS(plcrash_log_writer_close) +#define plcrash_log_writer_free PLNS(plcrash_log_writer_free) +#define plcrash_log_writer_init PLNS(plcrash_log_writer_init) +#define plcrash_log_writer_set_exception PLNS(plcrash_log_writer_set_exception) +#define plcrash_log_writer_write PLNS(plcrash_log_writer_write) +#define plcrash_log_writer_set_custom_data PLNS(plcrash_log_writer_set_custom_data) +#define plcrash_nasync_image_list_append PLNS(plcrash_nasync_image_list_append) +#define plcrash_nasync_image_list_free PLNS(plcrash_nasync_image_list_free) +#define plcrash_nasync_image_list_init PLNS(plcrash_nasync_image_list_init) +#define plcrash_nasync_image_list_remove PLNS(plcrash_nasync_image_list_remove) +#define plcrash_nasync_macho_free PLNS(plcrash_nasync_macho_free) +#define plcrash_nasync_macho_init PLNS(plcrash_nasync_macho_init) +#define plcrash_populate_error PLNS(plcrash_populate_error) +#define plcrash_populate_mach_error PLNS(plcrash_populate_mach_error) +#define plcrash_populate_posix_error PLNS(plcrash_populate_posix_error) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) +#define plcrash_sysctl_int PLNS(plcrash_sysctl_int) +#define plcrash_sysctl_string PLNS(plcrash_sysctl_string) +#define plcrash_sysctl_valid_utf8_bytes PLNS(plcrash_sysctl_valid_utf8_bytes) +#define plcrash_sysctl_valid_utf8_bytes_max PLNS(plcrash_sysctl_valid_utf8_bytes_max) +#define plcrash_writer_pack PLNS(plcrash_writer_pack) +#define plframe_cursor_free PLNS(plframe_cursor_free) +#define plframe_cursor_get_reg PLNS(plframe_cursor_get_reg) +#define plframe_cursor_get_regcount PLNS(plframe_cursor_get_regcount) +#define plframe_cursor_get_regname PLNS(plframe_cursor_get_regname) +#define plframe_cursor_init PLNS(plframe_cursor_init) +#define plframe_cursor_next PLNS(plframe_cursor_next) +#define plframe_cursor_next_with_readers PLNS(plframe_cursor_next_with_readers) +#define plframe_cursor_read_compact_unwind PLNS(plframe_cursor_read_compact_unwind) +#define plframe_cursor_read_dwarf_unwind PLNS(plframe_cursor_read_dwarf_unwind) +#define plframe_cursor_read_frame_ptr PLNS(plframe_cursor_read_frame_ptr) +#define plframe_cursor_thread_init PLNS(plframe_cursor_thread_init) +#define plframe_strerror PLNS(plframe_strerror) + +#endif + +/* + * The following symbols are exported by the protobuf-c library. When building + * a shared library, we can hide these as private symbols. + * + * However, when building a static library, we can only do so if we use + * MH_OBJECT "single object prelink". The MH_OBJECT approach allows us to apply + * symbol hiding/aliasing/etc similar to that supported by dylibs, but because it is + * seemingly unused within Apple, the use thereof regularly introduces linking bugs + * and errors in new Xcode releases. + * + * Rather than fighting the linker, we use the namespacing machinery to rewrite these + * symbols, but only when explicitly compiling PLCrashReporter. Since protobuf-c is a library + * that may be used elsewhere, we don't want to rewrite these symbols if they're used + * independently by PLCrashReporter API clients. + */ +#ifdef PLCR_PRIVATE + /* If no prefix has been defined, we need to specify our own private prefix */ +# ifndef PLCRASHREPORTER_PREFIX +# define PLCRASHREPORTER_PREFIX PL_ +# endif + +# define protobuf_c_buffer_simple_append PLNS(protobuf_c_buffer_simple_append) +# define protobuf_c_empty_string PLNS(protobuf_c_empty_string) +# define protobuf_c_enum_descriptor_get_value PLNS(protobuf_c_enum_descriptor_get_value) +# define protobuf_c_enum_descriptor_get_value_by_name PLNS(protobuf_c_enum_descriptor_get_value_by_name) +# define protobuf_c_message_check PLNS(protobuf_c_message_check) +# define protobuf_c_message_descriptor_get_field PLNS(protobuf_c_message_descriptor_get_field) +# define protobuf_c_message_descriptor_get_field_by_name PLNS(protobuf_c_message_descriptor_get_field_by_name) +# define protobuf_c_message_free_unpacked PLNS(protobuf_c_message_free_unpacked) +# define protobuf_c_message_get_packed_size PLNS(protobuf_c_message_get_packed_size) +# define protobuf_c_message_init PLNS(protobuf_c_message_init) +# define protobuf_c_message_pack PLNS(protobuf_c_message_pack) +# define protobuf_c_message_pack_to_buffer PLNS(protobuf_c_message_pack_to_buffer) +# define protobuf_c_message_unpack PLNS(protobuf_c_message_unpack) +# define protobuf_c_service_descriptor_get_method_by_name PLNS(protobuf_c_service_descriptor_get_method_by_name) +# define protobuf_c_service_destroy PLNS(protobuf_c_service_destroy) +# define protobuf_c_service_generated_init PLNS(protobuf_c_service_generated_init) +# define protobuf_c_service_invoke_internal PLNS(protobuf_c_service_invoke_internal) +# define protobuf_c_version PLNS(protobuf_c_version) +# define protobuf_c_version_number PLNS(protobuf_c_version_number) +#endif /* PLCR_PRIVATE */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReport.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReport.h new file mode 100644 index 0000000..f710c3f --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReport.h @@ -0,0 +1,230 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_H +#define PLCRASH_REPORT_H + +#if __has_include() +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#else +#import "PLCrashReportApplicationInfo.h" +#import "PLCrashReportBinaryImageInfo.h" +#import "PLCrashReportExceptionInfo.h" +#import "PLCrashReportMachineInfo.h" +#import "PLCrashReportMachExceptionInfo.h" +#import "PLCrashReportProcessInfo.h" +#import "PLCrashReportProcessorInfo.h" +#import "PLCrashReportRegisterInfo.h" +#import "PLCrashReportSignalInfo.h" +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportSymbolInfo.h" +#import "PLCrashReportSystemInfo.h" +#import "PLCrashReportThreadInfo.h" +#endif + +/** + * @ingroup constants + * Crash file magic identifier */ +#define PLCRASH_REPORT_FILE_MAGIC "plcrash" + +/** + * @ingroup constants + * Crash format version byte identifier. Will not change outside of the introduction of + * an entirely new crash log format. */ +#define PLCRASH_REPORT_FILE_VERSION 1 + +/** + * @ingroup types + * Crash log file header format. + * + * Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC), + * followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION). + * The crash log message format itself is extensible, so this version number will only + * be incremented in the event of an incompatible encoding or format change. + */ +struct PLCrashReportFileHeader { + /** Crash log magic identifier, not NULL terminated */ + const char magic[7]; + + /** Crash log encoding/format version */ + const uint8_t version; + + /** File data */ + const uint8_t data[]; +} __attribute__((packed)); + + +/** + * @internal + * Private decoder instance variables (used to hide the underlying protobuf parser). + */ +typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; + +@interface PLCrashReport : NSObject { +@private + /** Private implementation variables (used to hide the underlying protobuf parser) */ + _PLCrashReportDecoder *_decoder; + + /** System info */ + __strong PLCrashReportSystemInfo *_systemInfo; + + /** Machine info */ + __strong PLCrashReportMachineInfo *_machineInfo; + + /** Application info */ + __strong PLCrashReportApplicationInfo *_applicationInfo; + + /** Process info */ + __strong PLCrashReportProcessInfo *_processInfo; + + /** Signal info */ + __strong PLCrashReportSignalInfo *_signalInfo; + + /** Mach exception info */ + __strong PLCrashReportMachExceptionInfo *_machExceptionInfo; + + /** Thread info (PLCrashReportThreadInfo instances) */ + __strong NSArray *_threads; + + /** Binary images (PLCrashReportBinaryImageInfo instances */ + __strong NSArray *_images; + + /** Exception information (may be nil) */ + __strong PLCrashReportExceptionInfo *_exceptionInfo; + + /** User defined information (may be nil) */ + __strong NSData *_customData; + + /** Report UUID */ + CFUUIDRef _uuid; +} + +- (id) initWithData: (NSData *) encodedData error: (NSError **) outError; + +- (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address; + +/** + * System information. + */ +@property(nonatomic, readonly, strong) PLCrashReportSystemInfo *systemInfo; + +/** + * YES if machine information is available. + */ +@property(nonatomic, readonly) BOOL hasMachineInfo; + +/** + * Machine information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachineInfo *machineInfo; + +/** + * Application information. + */ +@property(nonatomic, readonly, strong) PLCrashReportApplicationInfo *applicationInfo; + +/** + * YES if process information is available. + */ +@property(nonatomic, readonly) BOOL hasProcessInfo; + +/** + * Process information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessInfo *processInfo; + +/** + * Signal information. This provides the signal and signal code of the fatal signal. + */ +@property(nonatomic, readonly, strong) PLCrashReportSignalInfo *signalInfo; + +/** + * Mach exception information, if available. This will only be included in the + * case that encoding crash reporter's exception-based reporting was enabled, and a Mach + * exception was caught. + * + * @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this + * s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the + * Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal + * mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachExceptionInfo *machExceptionInfo; + +/** + * Thread information. Returns a list of PLCrashReportThreadInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *threads; + +/** + * Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *images; + +/** + * YES if exception information is available. + */ +@property(nonatomic, readonly) BOOL hasExceptionInfo; + +/** + * Exception information. Only available if a crash was caused by an uncaught exception, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportExceptionInfo *exceptionInfo; + +/** + * Custom user data. Only available if user explicitly assigned it before crash happened, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) NSData *customData; + +/** + * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated + * by a single client. Only available in later (v1.2+) crash report format versions. If not available, + * will be NULL. + */ +@property(nonatomic, readonly) CFUUIDRef uuidRef; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h new file mode 100644 index 0000000..787a286 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h @@ -0,0 +1,62 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportApplicationInfo : NSObject { +@private + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; +} + +- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier + applicationVersion: (NSString *) applicationVersion + applicationMarketingVersion: (NSString *) applicationMarketingVersion; + +/** + * The application identifier. This is usually the application's CFBundleIdentifier value. + */ +@property(nonatomic, readonly, strong) NSString *applicationIdentifier; + +/** + * The application version. This is usually the application's CFBundleVersion value. + */ +@property(nonatomic, readonly, strong) NSString *applicationVersion; + +/** + * The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil. + */ +@property(nonatomic, readonly, strong) NSString *applicationMarketingVersion; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h new file mode 100644 index 0000000..1a75051 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h @@ -0,0 +1,95 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportBinaryImageInfo : NSObject { +@private + /** Code type */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /** Base image address */ + uint64_t _baseAddress; + + /** Image segment size */ + uint64_t _imageSize; + + /** Name of binary image */ + __strong NSString *_imageName; + + /** If the UUID is available */ + BOOL _hasImageUUID; + + /** 128-bit object UUID. May be nil. */ + __strong NSString *_imageUUID; +} + +- (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo + baseAddress: (uint64_t) baseAddress + size: (uint64_t) imageSize + name: (NSString *) imageName + uuid: (NSData *) uuid; + +/** + * Image code type, or nil if unavailable. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *codeType; + +/** + * Image base address. + */ +@property(nonatomic, readonly) uint64_t imageBaseAddress; + +/** + * Segment size. + */ +@property(nonatomic, readonly) uint64_t imageSize; + +/** + * Image name (absolute path) + */ +@property(nonatomic, readonly, strong) NSString *imageName; + + +/** + * YES if this image has an associated UUID. + */ +@property(nonatomic, readonly) BOOL hasImageUUID; + +/** + * 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable. + */ +@property(nonatomic, readonly, strong) NSString *imageUUID; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h new file mode 100644 index 0000000..7423ca9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h @@ -0,0 +1,69 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportThreadInfo.h" +#endif + +@interface PLCrashReportExceptionInfo : NSObject { +@private + /** Name */ + __strong NSString *_name; + + /** Reason */ + __strong NSString *_reason; + + /** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */ + __strong NSArray *_stackFrames; +} + +- (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason; + +- (id) initWithExceptionName: (NSString *) name + reason: (NSString *) reason + stackFrames: (NSArray *) stackFrames; + +/** + * The exception name. + */ +@property(nonatomic, readonly, strong) NSString *exceptionName; + +/** + * The exception reason. + */ +@property(nonatomic, readonly, strong) NSString *exceptionReason; + +/* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable. + * This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportFormatter.h new file mode 100644 index 0000000..5cdf01b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportFormatter.h @@ -0,0 +1,55 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReport.h" +#endif + +/** + * A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules, + * (such as implementing text output support), and returns the result. + */ +@protocol PLCrashReportFormatter + +/** + * Format the provided @a report. + * + * @param report Report to be formatted. + * @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error + * object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will + * be left unmodified. You may specify nil for this parameter, and no error information will be provided. + * + * @return Returns the formatted report data on success, or nil on failure. + */ +- (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h new file mode 100644 index 0000000..19461a5 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h @@ -0,0 +1,48 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportMachExceptionInfo : NSObject { +@private + /** The Mach exception type. */ + uint64_t _type; + + /** The Mach exception codes, represented as an ordered array of NSNumber instances. */ + __strong NSArray *_codes; +} + +- (id) initWithType: (uint64_t) type codes: (NSArray *) codes; + +/** The Mach exception type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */ +@property(nonatomic, readonly, strong) NSArray *codes; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h new file mode 100644 index 0000000..ab6fee9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h @@ -0,0 +1,77 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportMachineInfo : NSObject { +@private + /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ + __strong NSString *_modelName; + + /** The processor type. */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /* The number of actual physical processor cores. */ + NSUInteger _processorCount; + + /* The number of logical processors. */ + NSUInteger _logicalProcessorCount; +} + +- (id) initWithModelName: (NSString *) modelName + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + processorCount: (NSUInteger) processorCount + logicalProcessorCount: (NSUInteger) logicalProcessorCount; + +/** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *modelName; + +/** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +/* + * The number of actual physical processor cores. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger processorCount; + +/* + * The number of logical processors. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger logicalProcessorCount; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h new file mode 100644 index 0000000..802e8d4 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h @@ -0,0 +1,103 @@ +/* + * Author: Damian Morris + * + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportProcessInfo : NSObject { +@private + /** Process name, or nil if unavailable. */ + __strong NSString *_processName; + + /** Process ID */ + NSUInteger _processID; + + /** Process path */ + __strong NSString* _processPath; + + /** Date and time that the crashing process was started. This may be unavailable, and this property + * will be nil. */ + __strong NSDate *_processStartTime; + + /** Parent process name, or nil if unavailable. */ + __strong NSString *_parentProcessName; + + /** Parent process ID */ + NSUInteger _parentProcessID; + + /** If false, the process is being run via process-level CPU emulation (such as Rosetta). */ + BOOL _native; +} + +- (id) initWithProcessName: (NSString *) processName + processID: (NSUInteger) processID + processPath: (NSString *) processPath + processStartTime: (NSDate *) processStartTime + parentProcessName: (NSString *) parentProcessName + parentProcessID: (NSUInteger) parentProcessID + native: (BOOL) native; + +/** + * The process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processName; + +/** + * The process ID. + */ +@property(nonatomic, readonly) NSUInteger processID; + +/** + * The path to the process executable. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processPath; + +/** + * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSDate *processStartTime; + +/** + * The parent process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *parentProcessName; + +/** + * The parent process ID. + */ +@property(nonatomic, readonly) NSUInteger parentProcessID; + +/** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */ +@property(nonatomic, readonly) BOOL native; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h new file mode 100644 index 0000000..03d570b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h @@ -0,0 +1,74 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +/** + * @ingroup constants + * + * The type encodings supported for CPU types and subtypes. Currently only Apple + * Mach-O defined encodings are supported. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Unknown cpu type encoding. */ + PLCrashReportProcessorTypeEncodingUnknown = 0, + + /** Apple Mach-defined processor types. */ + PLCrashReportProcessorTypeEncodingMach = 1 +} PLCrashReportProcessorTypeEncoding; + +@interface PLCrashReportProcessorInfo : NSObject { +@private + /** Type encoding */ + PLCrashReportProcessorTypeEncoding _typeEncoding; + + /** CPU type */ + uint64_t _type; + + /** CPU subtype */ + uint64_t _subtype; +} + +- (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding + type: (uint64_t) type + subtype: (uint64_t) subtype; + +/** The CPU type encoding. */ +@property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding; + +/** The CPU type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The CPU subtype. */ +@property(nonatomic, readonly) uint64_t subtype; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h new file mode 100644 index 0000000..e0a1ca1 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportRegisterInfo : NSObject { +@private + /** Register name */ + __strong NSString *_registerName; + + /** Register value */ + uint64_t _registerValue; +} + +- (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; + +/** + * Register name. + */ +@property(nonatomic, readonly, strong) NSString *registerName; + +/** + * Register value. + */ +@property(nonatomic, readonly) uint64_t registerValue; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h new file mode 100644 index 0000000..d949211 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h @@ -0,0 +1,60 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSignalInfo : NSObject { +@private + /** Signal name */ + __strong NSString *_name; + + /** Signal code */ + __strong NSString *_code; + + /** Fauling instruction or address */ + uint64_t _address; +} + +- (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address; + +/** + * The signal name. + */ +@property(nonatomic, readonly, strong) NSString *name; + +/** + * The signal code. + */ +@property(nonatomic, readonly, strong) NSString *code; + +/** + * The faulting instruction or address. + */ +@property(nonatomic, readonly) uint64_t address; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000..5fd4acc --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,57 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportSymbolInfo.h" +#endif + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + __strong PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000..bdb367c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + __strong NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly, strong) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h new file mode 100644 index 0000000..eb8a447 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h @@ -0,0 +1,177 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashMacros.h" +#endif + +@class PLCrashReportProcessorInfo; + +/** + * @ingroup constants + * + * Indicates the Operating System under which a Crash Log was generated. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Mac OS X. */ + PLCrashReportOperatingSystemMacOSX = 0, + + /** iPhone OS */ + PLCrashReportOperatingSystemiPhoneOS = 1, + + /** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */ + PLCrashReportOperatingSystemiPhoneSimulator = 2, + + /** Unknown operating system */ + PLCrashReportOperatingSystemUnknown = 3, + + /** Apple tvOS */ + PLCrashReportOperatingSystemAppleTVOS = 4, + +} PLCrashReportOperatingSystem; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** + * @ingroup constants + * + * Indicates the architecture under which a Crash Log was generated. + * + * @note The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * will make use of the new PLCrashReportProcessorInfo CPU type encodings. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** x86-32. */ + PLCrashReportArchitectureX86_32 = 0, + + /** x86-64 */ + PLCrashReportArchitectureX86_64 = 1, + + /** ARMv6 */ + PLCrashReportArchitectureARMv6 = 2, + + /** + * ARMv6 + * @deprecated This value has been deprecated in favor of ARM subtype-specific + * values. + * @sa PLCrashReportArchitectureARMv6 + */ + PLCrashReportArchitectureARM PLCR_DEPRECATED = PLCrashReportArchitectureARMv6, + + /** PPC */ + PLCrashReportArchitecturePPC = 3, + + /** PPC64 */ + PLCrashReportArchitecturePPC64 = 4, + + /** ARMv7 */ + PLCrashReportArchitectureARMv7 = 5, + + /** Unknown */ + PLCrashReportArchitectureUnknown = 6 +} PLCrashReportArchitecture; +#pragma clang diagnostic pop + +extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); +extern PLCrashReportArchitecture PLCrashReportHostArchitecture PLCR_EXTERNAL_DEPRECATED; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); + +@interface PLCrashReportSystemInfo : NSObject { +@private + /** Operating system */ + PLCrashReportOperatingSystem _operatingSystem; + + /** Operating system version */ + __strong NSString *_osVersion; + + /** OS build. May be nil. */ + __strong NSString *_osBuild; + + /** Architecture */ + PLCrashReportArchitecture _architecture; + + /** Date crash report was generated. May be nil if the date is unknown. */ + __strong NSDate *_timestamp; + + /** Processor information. */ + __strong PLCrashReportProcessorInfo *_processorInfo; +} + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + timestamp: (NSDate *) timestamp; + +/** The operating system. */ +@property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem; + +/** The operating system's release version. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemVersion; + +/** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemBuild; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo + * extensible encoding. */ +@property(nonatomic, readonly) PLCrashReportArchitecture architecture PLCR_DEPRECATED; + +/** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSDate *timestamp; + +/** The processor type. For v1.2 reports and later, this is an alias to the machine info's processorInfo. + * For earlier reports, this will be synthesized from the deprecated architecture property. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h new file mode 100644 index 0000000..adbc251 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h @@ -0,0 +1,66 @@ +/* + * Authors: + * Landon Fuller + * Damian Morris + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportFormatter.h" +#endif + +/** + * Supported text output formats. + * + * @ingroup enums + */ +typedef enum { + /** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available + * through iTunes Connect. */ + PLCrashReportTextFormatiOS = 0 +} PLCrashReportTextFormat; + + +@interface PLCrashReportTextFormatter : NSObject { +@private + /** Text output format. */ + PLCrashReportTextFormat _textFormat; + + /** Encoding to use for string output. */ + NSStringEncoding _stringEncoding; +} + ++ (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat; + +- (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h new file mode 100644 index 0000000..b9092e2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h @@ -0,0 +1,88 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_THREAD_INFO_H +#define PLCRASH_REPORT_THREAD_INFO_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportRegisterInfo.h" +#endif + + +@interface PLCrashReportThreadInfo : NSObject { +@private + /** The thread number. Should be unique within a given crash log. */ + NSInteger _threadNumber; + + /** Ordered list of PLCrashReportStackFrame instances */ + __strong NSArray *_stackFrames; + + /** YES if this thread crashed. */ + BOOL _crashed; + + /** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */ + __strong NSArray *_registers; +} + +- (id) initWithThreadNumber: (NSInteger) threadNumber + stackFrames: (NSArray *) stackFrames + crashed: (BOOL) crashed + registers: (NSArray *) registers; + +/** + * Application thread number. + */ +@property(nonatomic, readonly) NSInteger threadNumber; + +/** + * Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances. + * The array is ordered, last callee to first. + */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +/** + * If this thread crashed, set to YES. + */ +@property(nonatomic, readonly) BOOL crashed; + +/** + * State of the general purpose and related registers, as a list of + * PLCrashReportRegister instances. If this thead did not crash (crashed returns NO), + * this list will be empty. + */ +@property(nonatomic, readonly, strong) NSArray *registers; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReporter.h new file mode 100644 index 0000000..bdc8f83 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReporter.h @@ -0,0 +1,159 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +#ifndef PLCRASH_REPORTER_H +#define PLCRASH_REPORTER_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReporterConfig.h" +#import "PLCrashMacros.h" +#endif + +@class PLCrashMachExceptionServer; +@class PLCrashMachExceptionPortSet; + +/** + * @ingroup functions + * + * Prototype of a callback function used to execute additional user code with signal information as provided + * by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk. + * + * @param info The signal info. + * @param uap The crash's threads context. + * @param context The API client's supplied context value. + * + * @sa The @ref async_safety documentation. + * @sa PLCrashReporter::setPostCrashCallbacks: + */ +typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context); + +/** + * @ingroup types + * + * This structure contains callbacks supported by PLCrashReporter to allow the host application to perform + * additional tasks prior to program termination after a crash has occurred. + * + * @sa The @ref async_safety documentation. + */ +typedef struct PLCrashReporterCallbacks { + /** The version number of this structure. If not one of the defined version numbers for this type, the behavior + * is undefined. The current version of this structure is 0. */ + uint16_t version; + + /** An arbitrary user-supplied context value. This value may be NULL. */ + void *context; + + /** + * The callback used to report caught signal information. In version 0 of this structure, all crashes will be + * reported via this function. + * + * @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived + * from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via + * PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will + * not provide valid thread state. + * + * This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained + * here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions. + */ + PLCrashReporterPostCrashSignalCallback handleSignal; +} PLCrashReporterCallbacks; + +@interface PLCrashReporter : NSObject { +@private + /** Reporter configuration */ + __strong PLCrashReporterConfig *_config; + + /** YES if the crash reporter has been enabled */ + BOOL _enabled; + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if + * the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */ + __strong PLCrashMachExceptionServer *_machServer; + + /** Previously registered Mach exception ports, if any. */ + __strong PLCrashMachExceptionPortSet *_previousMachPorts; +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ + + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; + + /** Path to the crash reporter internal data directory */ + __strong NSString *_crashReportDirectory; +} + ++ (PLCrashReporter *) sharedReporter PLCR_DEPRECATED; + +- (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config; + +- (BOOL) hasPendingCrashReport; + +- (NSData *) loadPendingCrashReportData; +- (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; + +- (NSData *) generateLiveReportWithThread: (thread_t) thread; +- (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; +- (NSData *) generateLiveReportWithThread: (thread_t) thread exception: (NSException *) exception error: (NSError **) outError; + +- (NSData *) generateLiveReport; +- (NSData *) generateLiveReportAndReturnError: (NSError **) outError; +- (NSData *) generateLiveReportWithException: (NSException *) exception error: (NSError **) outError; + +- (BOOL) purgePendingCrashReport; +- (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; + +- (BOOL) enableCrashReporter; +- (BOOL) enableCrashReporterAndReturnError: (NSError **) outError; + +- (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks; + +/** + * Return the path to live crash report (which may not yet, or ever, exist). + */ +- (NSString *) crashReportPath; + +/** + * Custom data to save in the crash report. + */ +@property(nonatomic, strong) NSData *customData; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReporterConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReporterConfig.h new file mode 100644 index 0000000..f151e56 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Headers/PLCrashReporterConfig.h @@ -0,0 +1,197 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashFeatureConfig.h" +#endif + +/** + * @ingroup enums + * Supported mechanisms for trapping and handling crashes. + */ +typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) { + /** + * Trap fatal signals via a sigaction(2)-registered BSD signal handler. + * + * PLCrashReporter's signal handler will supersede previously registered handlers; existing + * handlers will not be called. This behavior may be modified in a future release, and should + * not be relied upon as a mechanism to prevent existing signal handlers from being called. + * + * There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically: + * + * - On Mac OS X, stack overflows will only be handled on the thread on which + * the crash reporter was initialized. This should generally be the main thread. + * - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being + * non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS). + * - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting + * in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal + * handlers prior to raising SIGABRT). These __abort()-based checks are: + * - Implemented for unsafe memcpy/strcpy/snprintf C functions. + * - Only enabled when operating on a fixed-width target buffer (in which case the + * compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument). + * - Only trigger in the case that the source data exceeds the size of the fixed width target + * buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy), + * or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer), + * AND that argument can't be checked at compile-time. + */ + PLCrashReporterSignalHandlerTypeBSD = 0, + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** + * Trap fatal signals via a Mach exception server. + * + * If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that + * exception handler. Should the exceptions be handled by an existing handler, no report will be generated + * by PLCrashReporter. + * + * @par Mac OS X + * + * On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note, + * however, that some kernel-internal constants, as well as architecture-specific trap information, + * may be required to fully interpret a Mach exception's root cause. + * + * @par iOS + * + * On iOS, the APIs required for a complete implementation are not fully public. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included + * Mach exception handling as an optional feature, with both build-time and runtime configuration + * to disable its inclusion or use, respectively. + * + * @par Debugger Incompatibility + * + * The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to + * suspend all active threads (which will include the Mach exception handler). Mach-based handling + * should not be used when a debugger is attached. + * + * @par More Details + * + * For more information, refer to @ref mach_exceptions. + */ + PLCrashReporterSignalHandlerTypeMach = 1 +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ +}; + +/** + * @ingroup enums + * Supported mechanisms for performing local symbolication. + * + * Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may + * return information that is incorrect. This may still be useful in the case where DWARF data is unavailable + * for a given build; in that case, it can provide function and method names (though not line numbers) for a + * crash report that may otherwise be unusable. + * + * Note, however, this comes at the cost of a significant increase in code that must run within the critical + * crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In + * addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may + * change in future iOS releases. Given that DWARF symbolication data will always be more accurate, and + * the risks inherent in executing considerably more code at crash time, it is strongly recommended that local + * symbolication only be enabled for non-release builds. + * + * Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the + * results. + */ +typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) { + /** No symbolication. */ + PLCrashReporterSymbolicationStrategyNone = 0, + + /** + * Use the standard binary symbol table. On iOS, this alone will return + * incomplete results, as most symbols are rewritten to the common '\' string. + */ + PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0, + + /** + * Use Objective-C metadata to find method and class names. This relies on detailed parsing + * of the Objective-C runtime data, including undefined flags and other runtime internals. As such, + * it may return incorrect data should the runtime be changed incompatibly. + */ + PLCrashReporterSymbolicationStrategyObjC = 1 << 1, + + /** + * Enable all available symbolication strategies. + */ + PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC) +}; + +@interface PLCrashReporterConfig : NSObject { +@private + /** The configured signal handler type. */ + PLCrashReporterSignalHandlerType _signalHandlerType; + + /** The configured symbolication strategy. */ + PLCrashReporterSymbolicationStrategy _symbolicationStrategy; + + /** + * Flag indicating if the uncaughtExceptionHandler should be initialized or not. It usually is, except in a + * Xamarin environment. + */ + BOOL _shouldRegisterUncaughtExceptionHandler; +} + ++ (instancetype) defaultConfiguration; + +- (instancetype) init; + +- (instancetype) initWithBasePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + basePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler + basePath: (NSString *) basePath; + +/** The base path to save the crash data. */ +@property(nonatomic, readonly) NSString *basePath; + +/** The configured signal handler type. */ +@property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType; + +/** The configured symbolication strategy. */ +@property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy; + +/** Should PLCrashReporter regiser an uncaught exception handler? This is entended to be used in Xamarin apps */ +@property(nonatomic, readonly) BOOL shouldRegisterUncaughtExceptionHandler; + +@end + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Info.plist b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Info.plist new file mode 100644 index 0000000..46b8c67 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Info.plist differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Modules/module.modulemap b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Modules/module.modulemap new file mode 100644 index 0000000..4fa4304 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_arm64e/CrashReporter.framework/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module CrashReporter { + umbrella header "CrashReporter.h" + + export * + module * { export * } + + link framework "Foundation" +} diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/CrashReporter b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/CrashReporter new file mode 100644 index 0000000..42827e4 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/CrashReporter differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/CrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/CrashReporter.h new file mode 100644 index 0000000..99878d3 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/CrashReporter.h @@ -0,0 +1,366 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifdef __APPLE__ +#import +#endif + +#if __has_include() + +// This must be included before any other PLCrashReporter includes, as +// it redefines symbol names +#import + +/* Library Imports */ +#import +#import +#import +#else +#import "PLCrashNamespace.h" +#import "PLCrashReporter.h" +#import "PLCrashReport.h" +#import "PLCrashReportTextFormatter.h" +#endif + +/** + * @defgroup functions Crash Reporter Functions Reference + */ + +/** + * @defgroup types Crash Reporter Data Types Reference + */ + +/** + * @defgroup constants Crash Reporter Constants Reference + */ + +/** + * @internal + * @defgroup plcrash_internal Crash Reporter Internal Documentation + */ + +/** + * @defgroup enums Enumerations + * @ingroup constants + */ + +/** + * @defgroup globals Global Variables + * @ingroup constants + */ + +/** + * @defgroup exceptions Exceptions + * @ingroup constants + */ + +/* Exceptions */ +extern NSString *PLCrashReporterException; + +/* Error Domain and Codes */ +extern NSString *PLCrashReporterErrorDomain; + +/** + * NSError codes in the Plausible Crash Reporter error domain. + * @ingroup enums + */ +typedef enum { + /** An unknown error has occured. If this + * code is received, it is a bug, and should be reported. */ + PLCrashReporterErrorUnknown = 0, + + /** An Mach or POSIX operating system error has occured. The underlying NSError cause may be fetched from the userInfo + * dictionary using the NSUnderlyingErrorKey key. */ + PLCrashReporterErrorOperatingSystem = 1, + + /** The crash report log file is corrupt or invalid */ + PLCrashReporterErrorCrashReportInvalid = 2, + + /** An attempt to use a resource which was in use at the time in a manner which would have conflicted with the request. */ + PLCrashReporterErrorResourceBusy = 3 +} PLCrashReporterError; + +/** + * @mainpage Plausible Crash Reporter + * + * @section intro_sec Introduction + * + * Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X. + * + * The following features are supported: + * + * - Implemented as an in-process signal handler. + * - Does not interfer with debugging in gdb.. + * - Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc). + * - Full thread state for all active threads (backtraces, register dumps) is provided. + * + * If your application crashes, a crash report will be written. When the application is next run, you may check for a + * pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the + * report locally. + * + * @section intro_encoding Crash Report Format + * + * Crash logs are encoded using google protobuf, and may be decoded + * using the provided PLCrashReport API. Additionally, the include plcrashutil handles conversion of binary crash reports to the + * symbolicate-compatible iPhone text format. + * + * @section doc_sections Documentation Sections + * - @subpage example_usage_iphone + * - @subpage error_handling + * - @subpage async_safety + */ + +/** + * @page example_usage_iphone Example iPhone Usage + * + * @code + * // + * // Called to handle a pending crash report. + * // + * - (void) handleCrashReport { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSData *crashData; + * NSError *error; + * + * // Try loading the crash report + * crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error]; + * if (crashData == nil) { + * NSLog(@"Could not load crash report: %@", error); + * goto finish; + * } + * + * // We could send the report from here, but we'll just print out + * // some debugging info instead + * PLCrashReport *report = [[[PLCrashReport alloc] initWithData: crashData error: &error] autorelease]; + * if (report == nil) { + * NSLog(@"Could not parse crash report"); + * goto finish; + * } + * + * NSLog(@"Crashed on %@", report.systemInfo.timestamp); + * NSLog(@"Crashed with signal %@ (code %@, address=0x%" PRIx64 ")", report.signalInfo.name, + * report.signalInfo.code, report.signalInfo.address); + * + * // Purge the report + * finish: + * [crashReporter purgePendingCrashReport]; + * return; + * } + * + * // from UIApplicationDelegate protocol + * - (void) applicationDidFinishLaunching: (UIApplication *) application { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSError *error; + * + * // Check if we previously crashed + * if ([crashReporter hasPendingCrashReport]) + * [self handleCrashReport]; + + * // Enable the Crash Reporter + * if (![crashReporter enableCrashReporterAndReturnError: &error]) + * NSLog(@"Warning: Could not enable crash reporter: %@", error); + * + * } + * @endcode + * + */ + +/** + * @page error_handling Error Handling Programming Guide + * + * Where a method may return an error, Plausible Crash Reporter provides access to the underlying + * cause via an optional NSError argument. + * + * All returned errors will be a member of one of the below defined domains, however, new domains and + * error codes may be added at any time. If you do not wish to report on the error cause, many methods + * support a simple form that requires no NSError argument. + * + * @section error_domains Error Domains, Codes, and User Info + * + * @subsection crashreporter_errors Crash Reporter Errors + * + * Any errors in Plausible Crash Reporter use the #PLCrashReporterErrorDomain error domain, and and one + * of the error codes defined in #PLCrashReporterError. + */ + +/** + * @page async_safety Async-Safe Programming Guide + * + * Plausible CrashReporter provides support for executing an application specified function in the context of the + * crash reporter's signal handler, after the crash report has been written to disk. This was a regularly requested + * feature, and provides the ability to implement application finalization in the event of a crash. However, writing + * code intended for execution inside of a signal handler is exceptionally difficult, and is not recommended. + * + * @section program_flow Program Flow and Signal Handlers + * + * When the signal handler is called the normal flow of the program is interrupted, and your program is an unknown + * state. Locks may be held, the heap may be corrupt (or in the process of being updated), and your signal + * handler may invoke a function that was being executed at the time of the signal. This may result in deadlocks, + * data corruption, and program termination. + * + * @section functions Async-Safe Functions + * + * A subset of functions are defined to be async-safe by the OS, and are safely callable from within a signal handler. If + * you do implement a custom post-crash handler, it must be async-safe. A table of POSIX-defined async-safe functions + * and additional information is available from the + * CERT programming guide - SIG30-C + * + * Most notably, the Objective-C runtime itself is not async-safe, and Objective-C may not be used within a signal + * handler. + * + * @sa PLCrashReporter::setCrashCallbacks: + */ + +/** + * @page mach_exceptions Mach Exceptions on Mac OS X and iOS + * + * PLCrashReporter includes support for monitoring crashes via an in-process Mach exception handler. There are a small + * number of crash cases that will not be caught with via a POSIX signal handler, but can be caught via a Mach + * exception handler: + * + * - Stack overflow. sigaltstack() is broken in later iOS releases, and even if functional, must be configured + * on a per-thread basis. + * - Internal Apple assertions that call libSystem's __assert. These include compiler-checked constraints + * for built-in functions, such as strcpy_chk(). The __abort() implementation actually disables the SIGABRT + * signal handler (resetting it to SIG_DFL) prior to to issueing a SIGABRT, bypassing signal-based crash + * reporters entirely. + * + * Unfortunately, the latter issue (__assert) can not be handled on iOS; trapping abort requires that + * a Mach exception handler operate out-of-process, which is impossible on iOS. On Mac OS X, this will + * only be handled once we've implemented fully out-of-process crash excution. + * + * On Mac OS X, the Mach exception implementation is fully supported using entirely public API. On iOS, + * the APIs required are not fully public -- more details on the implications of this for exception handling on + * iOS may be found in @ref mach_exceptions_ios below. It is worth noting that even where the Mach exception APIs + * are fully supported, kernel-internal constants, as well + * as architecture-specific trap information, may be required to fully interpret a Mach exception's root cause. + * + * For example, the EXC_SOFTWARE exception is dispatched for four different failure types, using the exception + * code to differentiate failure types: + * - Non-existent system call invoked (SIGSYS) + * - Write on a pipe with no reader (SIGPIPE) + * - Abort program (SIGABRT -- unused) + * - Kill program (SIGKILL) + * + * Of those four types, only the constant required to interpret the SIGKILL behavior (EXC_SOFT_SIGNAL) is publicly defined. + * Of the remaining three failure types, the constant values are kernel implementation-private, defined only in the available + * kernel sources. On iOS, these sources are unavailable, and while they generally do match the Mac OS X implementation, there + * are no gaurantees that this is -- or will remain -- the case in the future. + * + * Likewise, interpretation of particular fault types requires information regarding the underlying machine traps + * that triggered the Mach exceptions. For example, a floating point trap on x86/x86-64 will trigger an EXC_ARITHMETIC, + * with a subcode value containing the value of the FPU status register. Determining the exact FPU cause requires + * extracting the actual exception flags from status register as per the x86 architecture documentation. The exact format + * of this subcode value is not actually documented outside the kernel, and may change in future releases. + * + * While we have the advantage of access to the x86 kernel sources, the situation on ARM is even less clear. The actual + * use of the Mach exception codes and subcodes is largely undefined by both headers and publicly available documentation, + * and the available x86 kernel sources are of little use in interpreting this data. + * + * As such, while Mach exceptions may catch some cases that BSD signals can not, they are not a perfect solution, + * and may also provide less insight into the actual failures that occur. By comparison, the BSD signal interface + * is both fully defined and architecture independent, with any necessary interpretation of the Mach exception + * codes handled in-kernel at the time of exception dispatch. It is generally recommended by Apple as the preferred + * interface, and should generally be preferred by PLCrashReporter API clients. + * + * @section mach_exceptions_compatibility Compatibility Issues + * + * @subsection Debuggers + * + * Enabling in-process Mach exception handlers will conflict with any attached debuggers; the debugger + * may suspend the processes Mach exception handling thread, which will result in any exception messages + * sent via the debugger being lost, as the in-process handler will be unable to receive and forward + * the messages. + * + * @subsection Managed Runtimes (Xamarin, Unity) + * + * A Mach exception handler may conflict with any managed runtime that registers a BSD signal handler that + * can safely handle otherwise fatal signals, allowing execution to proceed. This includes products + * such as Xamarin for iOS. + * + * In such a case, PLCrashReporter will write a crash report for non-fatal signals, as there is no + * immediate mechanism for determining whether a signal handler exists and that it can safely + * handle the failure. This can result in unexpected delays in application execution, increased I/O to + * disk, and other undesirable operations. + * + * @section mach_exceptions_ios Mach Exceptions on iOS + * + * The APIs required for Mach exception handling are not fully public on iOS. After filing a request with + * Apple DTS to clarify the status of the Mach exception APIs on iOS, and implementing a Mach Exception + * handler using only supported API, they provided the following guidance: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited undefined API on iOS. The reporter + * may be excluded entirely at build time by modifying the PLCRASH_FEATURE_MACH_EXCEPTIONS build configuration; it + * may also be disabled at runtime by configuring the PLCrashReporter instance appropriately via PLCrashReporterConfig. + * + * The iOS implementation is implemented almost entirely using public API, and links against no actual private symbols; + * the use of undocumented functionality is limited to assuming the use of specific msgh_id values (see below + * for details). As a result, it may be considered perfectly safe to include the Mach Exception code in the + * standard build, and enable/disable it at runtime. + * + * The following issues exist in the iOS implementation: + * - The msgh_id values required for an exception reply message are not available from the available + * headers and must be hard-coded. This prevents one from safely replying to exception messages, which + * means that it is impossible to (correctly) inform the server that an exception has *not* been + * handled. + * + * Impact: + * This can lead to the process locking up and not dispatching to the host exception handler (eg, Apple's + * crash reporter), depending on the behavior of the kernel exception code. + * + * - The mach_* structure/type variants required by MACH_EXCEPTION_CODES are not publicly defined (on Mac OS X, + * these are provided by mach_exc.defs). This prevents one from forwarding exception messages to an existing + * handler that was registered with a MACH_EXCEPTION_CODES behavior (eg, forwarding is entirely non-functional + * on ARM64 devices). + * + * Impact: + * This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES, + * including other handlers registered within the current process, eg, by a managed runtime. This could + * also result in misinterpretation of a Mach exception message, in the case where the message format is + * modified by Apple to be incompatible with the existing 32-bit format. + * + * This is the case with LLDB; it will register a task exception handler with MACH_EXCEPTION_CODES set. Failure + * to correctly forward these exceptions will result in the debugger breaking in interesting ways; for example, + * changes to the set of dyld-loaded images are detected by setting a breakpoint on the dyld image registration + * funtions, and this functionality will break if the exception is not correctly forwarded. + * + * Since Mach exception handling is important for a fully functional crash reporter, we have also filed a radar + * to request that the API be made public: + * Radar: rdar://12939497 RFE: Provide mach_exc.defs for iOS + * + * At the time of this writing, the radar remains open/unresolved. + */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashFeatureConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashFeatureConfig.h new file mode 100644 index 0000000..7bcaebf --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashFeatureConfig.h @@ -0,0 +1,108 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_FEATURE_CONFIG_H +#define PLCRASH_FEATURE_CONFIG_H + +#include + +/** + * @internal + * + * Build-time configuration for PLCrashReporter. + * + * This is used to automatically enable/disable features on a per-platform and per-configuration + * basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter. + * + * @defgroup build_config Build Configuration + * @ingroup constants + * @{ + */ + +/* + * Defaults + */ + +/* + * For release builds, disable unused unwind implementations on targets that do not use them. For non-release + * builds, we include the unwind implementations to allow testing on a broader range of targets. + */ +#ifdef PLCF_RELEASE_BUILD +# if defined(__arm__) +# ifndef PLCRASH_FEATURE_UNWIND_DWARF +# define PLCRASH_FEATURE_UNWIND_DWARF 0 +# endif +# ifndef PLCRASH_FEATURE_UNWIND_COMPACT +# define PLCRASH_FEATURE_UNWIND_COMPACT 0 +# endif +# endif +#endif + +/* + * Configuration Flags + */ + + +#ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS +/** + * If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported, + * using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a + * popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either + * they've received special dispensation to use private APIs / private structures, they've found another way to do + * it, or they're just using undocumented functionality and hoping for the best. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled + * Mach exception handling by default, and provided both build-time and runtime configuration + * to disable its use. + * + * For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions. + */ +#if TARGET_OS_TV +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 0 +#else +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 1 +#endif +#endif + +#ifndef PLCRASH_FEATURE_UNWIND_DWARF +/** If true, enable DWARF unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_DWARF 1 +#endif + + +#ifndef PLCRASH_FEATURE_UNWIND_COMPACT +/** If true, enable compact unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_COMPACT 1 +#endif + +/* + * @} + */ + +#endif /* PLCRASH_FEATURE_CONFIG_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashMacros.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashMacros.h new file mode 100644 index 0000000..556e1c2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashMacros.h @@ -0,0 +1,143 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_CONSTANTS_H +#define PLCRASH_CONSTANTS_H + +#include +#include + +#if defined(__cplusplus) +# define PLCR_EXPORT extern "C" +# define PLCR_C_BEGIN_DECLS extern "C" { +# define PLCR_C_END_DECLS } +#else +# define PLCR_EXPORT extern +# define PLCR_C_BEGIN_DECLS +# define PLCR_C_END_DECLS +#endif + +#if defined(__cplusplus) +# define NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ +# define IS_EMPTY_(name) defined(NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ ## name) +# define IS_EMPTY(name) IS_EMPTY_(name) +# if defined(PLCRASHREPORTER_PREFIX) && !IS_EMPTY(PLCRASHREPORTER_PREFIX) + /** @internal Define the plcrash namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ +# define PLCR_CPP_BEGIN_NS namespace plcrash { inline namespace PLCRASHREPORTER_PREFIX { + + /** @internal Close the definition of the `plcrash` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ +# define PLCR_CPP_END_NS }} +# else +# define PLCR_CPP_BEGIN_NS namespace plcrash { +# define PLCR_CPP_END_NS } +# endif +#endif + +#ifdef __clang__ +# define PLCR_PRAGMA_CLANG(_p) _Pragma(_p) +#else +# define PLCR_PRAGMA_CLANG(_p) +#endif + +#ifdef __clang__ +# define PLCR_DEPRECATED __attribute__((deprecated)) +#else +# define PLCR_DEPRECATED +#endif + +#if defined(__clang__) || defined(__GNUC__) +# define PLCR_UNUSED __attribute__((unused)) +#else +# define PLCR_UNUSED +#endif + +#ifdef PLCR_PRIVATE +/** + * Marks a definition as deprecated only for for external clients, allowing + * uses of it internal fo the framework. + */ +# define PLCR_EXTERNAL_DEPRECATED + +/** + * @internal + * A macro to put above a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() \ + PLCR_PRAGMA_CLANG("clang diagnostic push"); \ + PLCR_PRAGMA_CLANG("clang diagnostic ignored \"-Wdocumentation-deprecated-sync\"") + +/** + * @internal + * A macro to put below a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_POP() PLCR_PRAGMA_CLANG("clang diagnostic pop") + +#else + +# define PLCR_EXTERNAL_DEPRECATED PLCR_DEPRECATED +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() + +#endif /* PLCR_PRIVATE */ + +#ifdef PLCR_PRIVATE +# if defined(__clang__) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") +# define PLCR_FALLTHROUGH [[clang::fallthrough]] +# else +# define PLCR_FALLTHROUGH do {} while (0) +# endif +#endif + +#ifdef PLCR_PRIVATE +/** + * @internal + * Static compile-time assertion. + * + * @param name The assertion name; must be valid for use within a C identifier. + * @param cond Assertion condition + */ +# define PLCR_ASSERT_STATIC(name, cond) PLCR_ASSERT_STATIC_(name, cond, __LINE__) +/* + * C++11 and C11 both provide a static_assert(). + * + * Otherwise, we have to use typedef-based static assertions. + */ +# if (defined(__cplusplus) && __cplusplus >= 201103L) || (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(#name, cond) +# define PLCR_ASSERT_STATIC__(name, cond) static_assert(cond, #name) +# else +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(name, cond, line) +# define PLCR_ASSERT_STATIC__(name, cond, line) typedef int plcf_static_assert_##name##_##line [(cond) ? 1 : -1] PLCR_UNUSED +# endif +#endif /* PLCR_PRIVATE */ + +#endif /* PLCRASH_CONSTANTS_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashNamespace.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashNamespace.h new file mode 100644 index 0000000..f4c263c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashNamespace.h @@ -0,0 +1,320 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +// #define PLCRASHREPORTER_PREFIX AcmeCo + + +// We need two extra layers of indirection to make CPP substitute +// the PLCRASHREPORTER_PREFIX define. +#define PLNS_impl2(prefix, symbol) prefix ## symbol +#define PLNS_impl(prefix, symbol) PLNS_impl2(prefix, symbol) +#define PLNS(symbol) PLNS_impl(PLCRASHREPORTER_PREFIX, symbol) + + +/* + * Rewrite all ObjC/C symbols. + * + * For C++ symbol handling, refer to the PLCR_CPP_BEGIN_NS and PLCR_CPP_END_NS + * macros. + */ +#ifdef PLCRASHREPORTER_PREFIX + +/* Objective-C Classes */ +#define PLCrashMachExceptionServer PLNS(PLCrashMachExceptionServer) +#define PLCrashReport PLNS(PLCrashReport) +#define PLCrashReportApplicationInfo PLNS(PLCrashReportApplicationInfo) +#define PLCrashReportBinaryImageInfo PLNS(PLCrashReportBinaryImageInfo) +#define PLCrashReportExceptionInfo PLNS(PLCrashReportExceptionInfo) +#define PLCrashReportMachExceptionInfo PLNS(PLCrashReportMachExceptionInfo) +#define PLCrashReportMachineInfo PLNS(PLCrashReportMachineInfo) +#define PLCrashReportProcessInfo PLNS(PLCrashReportProcessInfo) +#define PLCrashReportProcessorInfo PLNS(PLCrashReportProcessorInfo) +#define PLCrashReportRegisterInfo PLNS(PLCrashReportRegisterInfo) +#define PLCrashReportSignalInfo PLNS(PLCrashReportSignalInfo) +#define PLCrashReportStackFrameInfo PLNS(PLCrashReportStackFrameInfo) +#define PLCrashReportSymbolInfo PLNS(PLCrashReportSymbolInfo) +#define PLCrashReportSystemInfo PLNS(PLCrashReportSystemInfo) +#define PLCrashReportTextFormatter PLNS(PLCrashReportTextFormatter) +#define PLCrashReportThreadInfo PLNS(PLCrashReportThreadInfo) +#define PLCrashReporter PLNS(PLCrashReporter) +#define PLCrashSignalHandler PLNS(PLCrashSignalHandler) +#define PLCrashHostInfo PLNS(PLCrashHostInfo) +#define PLCrashMachExceptionPort PLNS(PLCrashMachExceptionPort) +#define PLCrashMachExceptionPortSet PLNS(PLCrashMachExceptionPortSet) +#define PLCrashProcessInfo PLNS(PLCrashProcessInfo) +#define PLCrashReporterConfig PLNS(PLCrashReporterConfig) +#define PLCrashUncaughtExceptionHandler PLNS(PLCrashUncaughtExceptionHandler) +#define PLCrashReportFormatter PLNS(PLCrashReportFormatter) + +/* Public C functions */ +#define PLCrashMachExceptionForward PLNS(PLCrashMachExceptionForward) +#define PLCrashSignalHandlerForward PLNS(PLCrashSignalHandlerForward) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) + + +/* Public C global symbols */ +#define PLCrashReporterErrorDomain PLNS(PLCrashReporterErrorDomain) +#define PLCrashReportHostArchitecture PLNS(PLCrashReportHostArchitecture) +#define PLCrashReportHostOperatingSystem PLNS(PLCrashReportHostOperatingSystem) +#define PLCrashReporterException PLNS(PLCrashReporterException) + +/* For backwards compatibility, plcrash_async_byteorder vends C++ methods when included under C++. We have + * to handle this distinctly from our PLCR_CPP_BEGIN_NS C++ namespacing mechanism. */ +#define plcrash_async_byteorder PLNS(plcrash_async_byteorder) + +/* + * All private C symbols. Once these are migrated to C++, we'll be able to use the much simpler + * PLCR_CPP_BEGIN_NS machinery. + * + * This list was automatically generated (and can be updated) by setting PLCRASHREPORTER_PREFIX to 'AcmeCo', + * building the library, and executing the following: + * nm -g -U | grep '^[0-9]' | c++filt | grep -v AcmeCo | grep -E '_pl|_PL' | awk '{print $3}' | cut -c 2- | sort | uniq | awk '{print "#define",$1,"PLNS("$1")"}' + */ +#define pl_mach_thread_self PLNS(pl_mach_thread_self) +#define plcrash__architecture__descriptor PLNS(plcrash__architecture__descriptor) +#define plcrash__crash_report__application_info__descriptor PLNS(plcrash__crash_report__application_info__descriptor) +#define plcrash__crash_report__application_info__init PLNS(plcrash__crash_report__application_info__init) +#define plcrash__crash_report__binary_image__descriptor PLNS(plcrash__crash_report__binary_image__descriptor) +#define plcrash__crash_report__binary_image__init PLNS(plcrash__crash_report__binary_image__init) +#define plcrash__crash_report__descriptor PLNS(plcrash__crash_report__descriptor) +#define plcrash__crash_report__exception__descriptor PLNS(plcrash__crash_report__exception__descriptor) +#define plcrash__crash_report__exception__init PLNS(plcrash__crash_report__exception__init) +#define plcrash__crash_report__free_unpacked PLNS(plcrash__crash_report__free_unpacked) +#define plcrash__crash_report__get_packed_size PLNS(plcrash__crash_report__get_packed_size) +#define plcrash__crash_report__init PLNS(plcrash__crash_report__init) +#define plcrash__crash_report__machine_info__descriptor PLNS(plcrash__crash_report__machine_info__descriptor) +#define plcrash__crash_report__machine_info__init PLNS(plcrash__crash_report__machine_info__init) +#define plcrash__crash_report__pack PLNS(plcrash__crash_report__pack) +#define plcrash__crash_report__pack_to_buffer PLNS(plcrash__crash_report__pack_to_buffer) +#define plcrash__crash_report__process_info__descriptor PLNS(plcrash__crash_report__process_info__descriptor) +#define plcrash__crash_report__process_info__init PLNS(plcrash__crash_report__process_info__init) +#define plcrash__crash_report__processor__descriptor PLNS(plcrash__crash_report__processor__descriptor) +#define plcrash__crash_report__processor__init PLNS(plcrash__crash_report__processor__init) +#define plcrash__crash_report__processor__type_encoding__descriptor PLNS(plcrash__crash_report__processor__type_encoding__descriptor) +#define plcrash__crash_report__report_info__descriptor PLNS(plcrash__crash_report__report_info__descriptor) +#define plcrash__crash_report__report_info__init PLNS(plcrash__crash_report__report_info__init) +#define plcrash__crash_report__signal__descriptor PLNS(plcrash__crash_report__signal__descriptor) +#define plcrash__crash_report__signal__init PLNS(plcrash__crash_report__signal__init) +#define plcrash__crash_report__signal__mach_exception__descriptor PLNS(plcrash__crash_report__signal__mach_exception__descriptor) +#define plcrash__crash_report__signal__mach_exception__init PLNS(plcrash__crash_report__signal__mach_exception__init) +#define plcrash__crash_report__symbol__descriptor PLNS(plcrash__crash_report__symbol__descriptor) +#define plcrash__crash_report__symbol__init PLNS(plcrash__crash_report__symbol__init) +#define plcrash__crash_report__system_info__descriptor PLNS(plcrash__crash_report__system_info__descriptor) +#define plcrash__crash_report__system_info__init PLNS(plcrash__crash_report__system_info__init) +#define plcrash__crash_report__system_info__operating_system__descriptor PLNS(plcrash__crash_report__system_info__operating_system__descriptor) +#define plcrash__crash_report__thread__descriptor PLNS(plcrash__crash_report__thread__descriptor) +#define plcrash__crash_report__thread__init PLNS(plcrash__crash_report__thread__init) +#define plcrash__crash_report__thread__register_value__descriptor PLNS(plcrash__crash_report__thread__register_value__descriptor) +#define plcrash__crash_report__thread__register_value__init PLNS(plcrash__crash_report__thread__register_value__init) +#define plcrash__crash_report__thread__stack_frame__descriptor PLNS(plcrash__crash_report__thread__stack_frame__descriptor) +#define plcrash__crash_report__thread__stack_frame__init PLNS(plcrash__crash_report__thread__stack_frame__init) +#define plcrash__crash_report__unpack PLNS(plcrash__crash_report__unpack) +#define plcrash_async_address_apply_offset PLNS(plcrash_async_address_apply_offset) +#define plcrash_async_byteorder_big_endian PLNS(plcrash_async_byteorder_big_endian) +#define plcrash_async_byteorder_direct PLNS(plcrash_async_byteorder_direct) +#define plcrash_async_byteorder_little_endian PLNS(plcrash_async_byteorder_little_endian) +#define plcrash_async_byteorder_swapped PLNS(plcrash_async_byteorder_swapped) +#define plcrash_async_cfe_entry_apply PLNS(plcrash_async_cfe_entry_apply) +#define plcrash_async_cfe_entry_free PLNS(plcrash_async_cfe_entry_free) +#define plcrash_async_cfe_entry_init PLNS(plcrash_async_cfe_entry_init) +#define plcrash_async_cfe_entry_register_count PLNS(plcrash_async_cfe_entry_register_count) +#define plcrash_async_cfe_entry_register_list PLNS(plcrash_async_cfe_entry_register_list) +#define plcrash_async_cfe_entry_return_address_register PLNS(plcrash_async_cfe_entry_return_address_register) +#define plcrash_async_cfe_entry_stack_adjustment PLNS(plcrash_async_cfe_entry_stack_adjustment) +#define plcrash_async_cfe_entry_stack_offset PLNS(plcrash_async_cfe_entry_stack_offset) +#define plcrash_async_cfe_entry_type PLNS(plcrash_async_cfe_entry_type) +#define plcrash_async_cfe_reader_find_pc PLNS(plcrash_async_cfe_reader_find_pc) +#define plcrash_async_cfe_reader_free PLNS(plcrash_async_cfe_reader_free) +#define plcrash_async_cfe_reader_init PLNS(plcrash_async_cfe_reader_init) +#define plcrash_async_cfe_register_decode PLNS(plcrash_async_cfe_register_decode) +#define plcrash_async_cfe_register_encode PLNS(plcrash_async_cfe_register_encode) +#define plcrash_async_file_close PLNS(plcrash_async_file_close) +#define plcrash_async_file_flush PLNS(plcrash_async_file_flush) +#define plcrash_async_file_init PLNS(plcrash_async_file_init) +#define plcrash_async_file_write PLNS(plcrash_async_file_write) +#define plcrash_async_find_symbol PLNS(plcrash_async_find_symbol) +#define plcrash_async_image_containing_address PLNS(plcrash_async_image_containing_address) +#define plcrash_async_image_list_next PLNS(plcrash_async_image_list_next) +#define plcrash_async_image_list_set_reading PLNS(plcrash_async_image_list_set_reading) +#define plcrash_async_mach_exception_get_siginfo PLNS(plcrash_async_mach_exception_get_siginfo) +#define plcrash_async_macho_byteorder PLNS(plcrash_async_macho_byteorder) +#define plcrash_async_macho_contains_address PLNS(plcrash_async_macho_contains_address) +#define plcrash_async_macho_cpu_subtype PLNS(plcrash_async_macho_cpu_subtype) +#define plcrash_async_macho_cpu_type PLNS(plcrash_async_macho_cpu_type) +#define plcrash_async_macho_find_command PLNS(plcrash_async_macho_find_command) +#define plcrash_async_macho_find_segment_cmd PLNS(plcrash_async_macho_find_segment_cmd) +#define plcrash_async_macho_find_symbol_by_name PLNS(plcrash_async_macho_find_symbol_by_name) +#define plcrash_async_macho_find_symbol_by_pc PLNS(plcrash_async_macho_find_symbol_by_pc) +#define plcrash_async_macho_header PLNS(plcrash_async_macho_header) +#define plcrash_async_macho_header_size PLNS(plcrash_async_macho_header_size) +#define plcrash_async_macho_map_section PLNS(plcrash_async_macho_map_section) +#define plcrash_async_macho_map_segment PLNS(plcrash_async_macho_map_segment) +#define plcrash_async_macho_mapped_segment_free PLNS(plcrash_async_macho_mapped_segment_free) +#define plcrash_async_macho_next_command PLNS(plcrash_async_macho_next_command) +#define plcrash_async_macho_next_command_type PLNS(plcrash_async_macho_next_command_type) +#define plcrash_async_macho_string_free PLNS(plcrash_async_macho_string_free) +#define plcrash_async_macho_string_get_length PLNS(plcrash_async_macho_string_get_length) +#define plcrash_async_macho_string_get_pointer PLNS(plcrash_async_macho_string_get_pointer) +#define plcrash_async_macho_string_init PLNS(plcrash_async_macho_string_init) +#define plcrash_async_macho_symtab_reader_free PLNS(plcrash_async_macho_symtab_reader_free) +#define plcrash_async_macho_symtab_reader_init PLNS(plcrash_async_macho_symtab_reader_init) +#define plcrash_async_macho_symtab_reader_read PLNS(plcrash_async_macho_symtab_reader_read) +#define plcrash_async_macho_symtab_reader_symbol_name PLNS(plcrash_async_macho_symtab_reader_symbol_name) +#define plcrash_async_memcpy PLNS(plcrash_async_memcpy) +#define plcrash_async_memset PLNS(plcrash_async_memset) +#define plcrash_async_mobject_base_address PLNS(plcrash_async_mobject_base_address) +#define plcrash_async_mobject_free PLNS(plcrash_async_mobject_free) +#define plcrash_async_mobject_init PLNS(plcrash_async_mobject_init) +#define plcrash_async_mobject_length PLNS(plcrash_async_mobject_length) +#define plcrash_async_mobject_read_uint16 PLNS(plcrash_async_mobject_read_uint16) +#define plcrash_async_mobject_read_uint32 PLNS(plcrash_async_mobject_read_uint32) +#define plcrash_async_mobject_read_uint64 PLNS(plcrash_async_mobject_read_uint64) +#define plcrash_async_mobject_read_uint8 PLNS(plcrash_async_mobject_read_uint8) +#define plcrash_async_mobject_remap_address PLNS(plcrash_async_mobject_remap_address) +#define plcrash_async_mobject_task PLNS(plcrash_async_mobject_task) +#define plcrash_async_mobject_verify_local_pointer PLNS(plcrash_async_mobject_verify_local_pointer) +#define plcrash_async_objc_cache_free PLNS(plcrash_async_objc_cache_free) +#define plcrash_async_objc_cache_init PLNS(plcrash_async_objc_cache_init) +#define plcrash_async_objc_find_method PLNS(plcrash_async_objc_find_method) +#define plcrash_async_signal_sigcode PLNS(plcrash_async_signal_sigcode) +#define plcrash_async_signal_signame PLNS(plcrash_async_signal_signame) +#define plcrash_async_strcmp PLNS(plcrash_async_strcmp) +#define plcrash_async_strerror PLNS(plcrash_async_strerror) +#define plcrash_async_strncmp PLNS(plcrash_async_strncmp) +#define plcrash_async_symbol_cache_free PLNS(plcrash_async_symbol_cache_free) +#define plcrash_async_symbol_cache_init PLNS(plcrash_async_symbol_cache_init) +#define plcrash_async_task_memcpy PLNS(plcrash_async_task_memcpy) +#define plcrash_async_task_read_uint16 PLNS(plcrash_async_task_read_uint16) +#define plcrash_async_task_read_uint32 PLNS(plcrash_async_task_read_uint32) +#define plcrash_async_task_read_uint64 PLNS(plcrash_async_task_read_uint64) +#define plcrash_async_task_read_uint8 PLNS(plcrash_async_task_read_uint8) +#define plcrash_async_thread_state_clear_all_regs PLNS(plcrash_async_thread_state_clear_all_regs) +#define plcrash_async_thread_state_clear_reg PLNS(plcrash_async_thread_state_clear_reg) +#define plcrash_async_thread_state_clear_volatile_regs PLNS(plcrash_async_thread_state_clear_volatile_regs) +#define plcrash_async_thread_state_copy PLNS(plcrash_async_thread_state_copy) +#define plcrash_async_thread_state_current PLNS(plcrash_async_thread_state_current) +#define plcrash_async_thread_state_current_stub PLNS(plcrash_async_thread_state_current_stub) +#define plcrash_async_thread_state_get_greg_size PLNS(plcrash_async_thread_state_get_greg_size) +#define plcrash_async_thread_state_get_reg PLNS(plcrash_async_thread_state_get_reg) +#define plcrash_async_thread_state_get_reg_count PLNS(plcrash_async_thread_state_get_reg_count) +#define plcrash_async_thread_state_get_reg_name PLNS(plcrash_async_thread_state_get_reg_name) +#define plcrash_async_thread_state_get_stack_direction PLNS(plcrash_async_thread_state_get_stack_direction) +#define plcrash_async_thread_state_has_reg PLNS(plcrash_async_thread_state_has_reg) +#define plcrash_async_thread_state_init PLNS(plcrash_async_thread_state_init) +#define plcrash_async_thread_state_mach_thread_init PLNS(plcrash_async_thread_state_mach_thread_init) +#define plcrash_async_thread_state_map_dwarf_to_reg PLNS(plcrash_async_thread_state_map_dwarf_to_reg) +#define plcrash_async_thread_state_map_reg_to_dwarf PLNS(plcrash_async_thread_state_map_reg_to_dwarf) +#define plcrash_async_thread_state_mcontext_init PLNS(plcrash_async_thread_state_mcontext_init) +#define plcrash_async_thread_state_set_reg PLNS(plcrash_async_thread_state_set_reg) +#define plcrash_async_writen PLNS(plcrash_async_writen) +#define plcrash_log_writer_close PLNS(plcrash_log_writer_close) +#define plcrash_log_writer_free PLNS(plcrash_log_writer_free) +#define plcrash_log_writer_init PLNS(plcrash_log_writer_init) +#define plcrash_log_writer_set_exception PLNS(plcrash_log_writer_set_exception) +#define plcrash_log_writer_write PLNS(plcrash_log_writer_write) +#define plcrash_log_writer_set_custom_data PLNS(plcrash_log_writer_set_custom_data) +#define plcrash_nasync_image_list_append PLNS(plcrash_nasync_image_list_append) +#define plcrash_nasync_image_list_free PLNS(plcrash_nasync_image_list_free) +#define plcrash_nasync_image_list_init PLNS(plcrash_nasync_image_list_init) +#define plcrash_nasync_image_list_remove PLNS(plcrash_nasync_image_list_remove) +#define plcrash_nasync_macho_free PLNS(plcrash_nasync_macho_free) +#define plcrash_nasync_macho_init PLNS(plcrash_nasync_macho_init) +#define plcrash_populate_error PLNS(plcrash_populate_error) +#define plcrash_populate_mach_error PLNS(plcrash_populate_mach_error) +#define plcrash_populate_posix_error PLNS(plcrash_populate_posix_error) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) +#define plcrash_sysctl_int PLNS(plcrash_sysctl_int) +#define plcrash_sysctl_string PLNS(plcrash_sysctl_string) +#define plcrash_sysctl_valid_utf8_bytes PLNS(plcrash_sysctl_valid_utf8_bytes) +#define plcrash_sysctl_valid_utf8_bytes_max PLNS(plcrash_sysctl_valid_utf8_bytes_max) +#define plcrash_writer_pack PLNS(plcrash_writer_pack) +#define plframe_cursor_free PLNS(plframe_cursor_free) +#define plframe_cursor_get_reg PLNS(plframe_cursor_get_reg) +#define plframe_cursor_get_regcount PLNS(plframe_cursor_get_regcount) +#define plframe_cursor_get_regname PLNS(plframe_cursor_get_regname) +#define plframe_cursor_init PLNS(plframe_cursor_init) +#define plframe_cursor_next PLNS(plframe_cursor_next) +#define plframe_cursor_next_with_readers PLNS(plframe_cursor_next_with_readers) +#define plframe_cursor_read_compact_unwind PLNS(plframe_cursor_read_compact_unwind) +#define plframe_cursor_read_dwarf_unwind PLNS(plframe_cursor_read_dwarf_unwind) +#define plframe_cursor_read_frame_ptr PLNS(plframe_cursor_read_frame_ptr) +#define plframe_cursor_thread_init PLNS(plframe_cursor_thread_init) +#define plframe_strerror PLNS(plframe_strerror) + +#endif + +/* + * The following symbols are exported by the protobuf-c library. When building + * a shared library, we can hide these as private symbols. + * + * However, when building a static library, we can only do so if we use + * MH_OBJECT "single object prelink". The MH_OBJECT approach allows us to apply + * symbol hiding/aliasing/etc similar to that supported by dylibs, but because it is + * seemingly unused within Apple, the use thereof regularly introduces linking bugs + * and errors in new Xcode releases. + * + * Rather than fighting the linker, we use the namespacing machinery to rewrite these + * symbols, but only when explicitly compiling PLCrashReporter. Since protobuf-c is a library + * that may be used elsewhere, we don't want to rewrite these symbols if they're used + * independently by PLCrashReporter API clients. + */ +#ifdef PLCR_PRIVATE + /* If no prefix has been defined, we need to specify our own private prefix */ +# ifndef PLCRASHREPORTER_PREFIX +# define PLCRASHREPORTER_PREFIX PL_ +# endif + +# define protobuf_c_buffer_simple_append PLNS(protobuf_c_buffer_simple_append) +# define protobuf_c_empty_string PLNS(protobuf_c_empty_string) +# define protobuf_c_enum_descriptor_get_value PLNS(protobuf_c_enum_descriptor_get_value) +# define protobuf_c_enum_descriptor_get_value_by_name PLNS(protobuf_c_enum_descriptor_get_value_by_name) +# define protobuf_c_message_check PLNS(protobuf_c_message_check) +# define protobuf_c_message_descriptor_get_field PLNS(protobuf_c_message_descriptor_get_field) +# define protobuf_c_message_descriptor_get_field_by_name PLNS(protobuf_c_message_descriptor_get_field_by_name) +# define protobuf_c_message_free_unpacked PLNS(protobuf_c_message_free_unpacked) +# define protobuf_c_message_get_packed_size PLNS(protobuf_c_message_get_packed_size) +# define protobuf_c_message_init PLNS(protobuf_c_message_init) +# define protobuf_c_message_pack PLNS(protobuf_c_message_pack) +# define protobuf_c_message_pack_to_buffer PLNS(protobuf_c_message_pack_to_buffer) +# define protobuf_c_message_unpack PLNS(protobuf_c_message_unpack) +# define protobuf_c_service_descriptor_get_method_by_name PLNS(protobuf_c_service_descriptor_get_method_by_name) +# define protobuf_c_service_destroy PLNS(protobuf_c_service_destroy) +# define protobuf_c_service_generated_init PLNS(protobuf_c_service_generated_init) +# define protobuf_c_service_invoke_internal PLNS(protobuf_c_service_invoke_internal) +# define protobuf_c_version PLNS(protobuf_c_version) +# define protobuf_c_version_number PLNS(protobuf_c_version_number) +#endif /* PLCR_PRIVATE */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReport.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReport.h new file mode 100644 index 0000000..f710c3f --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReport.h @@ -0,0 +1,230 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_H +#define PLCRASH_REPORT_H + +#if __has_include() +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#else +#import "PLCrashReportApplicationInfo.h" +#import "PLCrashReportBinaryImageInfo.h" +#import "PLCrashReportExceptionInfo.h" +#import "PLCrashReportMachineInfo.h" +#import "PLCrashReportMachExceptionInfo.h" +#import "PLCrashReportProcessInfo.h" +#import "PLCrashReportProcessorInfo.h" +#import "PLCrashReportRegisterInfo.h" +#import "PLCrashReportSignalInfo.h" +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportSymbolInfo.h" +#import "PLCrashReportSystemInfo.h" +#import "PLCrashReportThreadInfo.h" +#endif + +/** + * @ingroup constants + * Crash file magic identifier */ +#define PLCRASH_REPORT_FILE_MAGIC "plcrash" + +/** + * @ingroup constants + * Crash format version byte identifier. Will not change outside of the introduction of + * an entirely new crash log format. */ +#define PLCRASH_REPORT_FILE_VERSION 1 + +/** + * @ingroup types + * Crash log file header format. + * + * Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC), + * followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION). + * The crash log message format itself is extensible, so this version number will only + * be incremented in the event of an incompatible encoding or format change. + */ +struct PLCrashReportFileHeader { + /** Crash log magic identifier, not NULL terminated */ + const char magic[7]; + + /** Crash log encoding/format version */ + const uint8_t version; + + /** File data */ + const uint8_t data[]; +} __attribute__((packed)); + + +/** + * @internal + * Private decoder instance variables (used to hide the underlying protobuf parser). + */ +typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; + +@interface PLCrashReport : NSObject { +@private + /** Private implementation variables (used to hide the underlying protobuf parser) */ + _PLCrashReportDecoder *_decoder; + + /** System info */ + __strong PLCrashReportSystemInfo *_systemInfo; + + /** Machine info */ + __strong PLCrashReportMachineInfo *_machineInfo; + + /** Application info */ + __strong PLCrashReportApplicationInfo *_applicationInfo; + + /** Process info */ + __strong PLCrashReportProcessInfo *_processInfo; + + /** Signal info */ + __strong PLCrashReportSignalInfo *_signalInfo; + + /** Mach exception info */ + __strong PLCrashReportMachExceptionInfo *_machExceptionInfo; + + /** Thread info (PLCrashReportThreadInfo instances) */ + __strong NSArray *_threads; + + /** Binary images (PLCrashReportBinaryImageInfo instances */ + __strong NSArray *_images; + + /** Exception information (may be nil) */ + __strong PLCrashReportExceptionInfo *_exceptionInfo; + + /** User defined information (may be nil) */ + __strong NSData *_customData; + + /** Report UUID */ + CFUUIDRef _uuid; +} + +- (id) initWithData: (NSData *) encodedData error: (NSError **) outError; + +- (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address; + +/** + * System information. + */ +@property(nonatomic, readonly, strong) PLCrashReportSystemInfo *systemInfo; + +/** + * YES if machine information is available. + */ +@property(nonatomic, readonly) BOOL hasMachineInfo; + +/** + * Machine information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachineInfo *machineInfo; + +/** + * Application information. + */ +@property(nonatomic, readonly, strong) PLCrashReportApplicationInfo *applicationInfo; + +/** + * YES if process information is available. + */ +@property(nonatomic, readonly) BOOL hasProcessInfo; + +/** + * Process information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessInfo *processInfo; + +/** + * Signal information. This provides the signal and signal code of the fatal signal. + */ +@property(nonatomic, readonly, strong) PLCrashReportSignalInfo *signalInfo; + +/** + * Mach exception information, if available. This will only be included in the + * case that encoding crash reporter's exception-based reporting was enabled, and a Mach + * exception was caught. + * + * @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this + * s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the + * Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal + * mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachExceptionInfo *machExceptionInfo; + +/** + * Thread information. Returns a list of PLCrashReportThreadInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *threads; + +/** + * Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *images; + +/** + * YES if exception information is available. + */ +@property(nonatomic, readonly) BOOL hasExceptionInfo; + +/** + * Exception information. Only available if a crash was caused by an uncaught exception, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportExceptionInfo *exceptionInfo; + +/** + * Custom user data. Only available if user explicitly assigned it before crash happened, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) NSData *customData; + +/** + * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated + * by a single client. Only available in later (v1.2+) crash report format versions. If not available, + * will be NULL. + */ +@property(nonatomic, readonly) CFUUIDRef uuidRef; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h new file mode 100644 index 0000000..787a286 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h @@ -0,0 +1,62 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportApplicationInfo : NSObject { +@private + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; +} + +- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier + applicationVersion: (NSString *) applicationVersion + applicationMarketingVersion: (NSString *) applicationMarketingVersion; + +/** + * The application identifier. This is usually the application's CFBundleIdentifier value. + */ +@property(nonatomic, readonly, strong) NSString *applicationIdentifier; + +/** + * The application version. This is usually the application's CFBundleVersion value. + */ +@property(nonatomic, readonly, strong) NSString *applicationVersion; + +/** + * The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil. + */ +@property(nonatomic, readonly, strong) NSString *applicationMarketingVersion; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h new file mode 100644 index 0000000..1a75051 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h @@ -0,0 +1,95 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportBinaryImageInfo : NSObject { +@private + /** Code type */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /** Base image address */ + uint64_t _baseAddress; + + /** Image segment size */ + uint64_t _imageSize; + + /** Name of binary image */ + __strong NSString *_imageName; + + /** If the UUID is available */ + BOOL _hasImageUUID; + + /** 128-bit object UUID. May be nil. */ + __strong NSString *_imageUUID; +} + +- (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo + baseAddress: (uint64_t) baseAddress + size: (uint64_t) imageSize + name: (NSString *) imageName + uuid: (NSData *) uuid; + +/** + * Image code type, or nil if unavailable. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *codeType; + +/** + * Image base address. + */ +@property(nonatomic, readonly) uint64_t imageBaseAddress; + +/** + * Segment size. + */ +@property(nonatomic, readonly) uint64_t imageSize; + +/** + * Image name (absolute path) + */ +@property(nonatomic, readonly, strong) NSString *imageName; + + +/** + * YES if this image has an associated UUID. + */ +@property(nonatomic, readonly) BOOL hasImageUUID; + +/** + * 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable. + */ +@property(nonatomic, readonly, strong) NSString *imageUUID; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h new file mode 100644 index 0000000..7423ca9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h @@ -0,0 +1,69 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportThreadInfo.h" +#endif + +@interface PLCrashReportExceptionInfo : NSObject { +@private + /** Name */ + __strong NSString *_name; + + /** Reason */ + __strong NSString *_reason; + + /** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */ + __strong NSArray *_stackFrames; +} + +- (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason; + +- (id) initWithExceptionName: (NSString *) name + reason: (NSString *) reason + stackFrames: (NSArray *) stackFrames; + +/** + * The exception name. + */ +@property(nonatomic, readonly, strong) NSString *exceptionName; + +/** + * The exception reason. + */ +@property(nonatomic, readonly, strong) NSString *exceptionReason; + +/* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable. + * This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportFormatter.h new file mode 100644 index 0000000..5cdf01b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportFormatter.h @@ -0,0 +1,55 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReport.h" +#endif + +/** + * A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules, + * (such as implementing text output support), and returns the result. + */ +@protocol PLCrashReportFormatter + +/** + * Format the provided @a report. + * + * @param report Report to be formatted. + * @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error + * object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will + * be left unmodified. You may specify nil for this parameter, and no error information will be provided. + * + * @return Returns the formatted report data on success, or nil on failure. + */ +- (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h new file mode 100644 index 0000000..19461a5 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h @@ -0,0 +1,48 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportMachExceptionInfo : NSObject { +@private + /** The Mach exception type. */ + uint64_t _type; + + /** The Mach exception codes, represented as an ordered array of NSNumber instances. */ + __strong NSArray *_codes; +} + +- (id) initWithType: (uint64_t) type codes: (NSArray *) codes; + +/** The Mach exception type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */ +@property(nonatomic, readonly, strong) NSArray *codes; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h new file mode 100644 index 0000000..ab6fee9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h @@ -0,0 +1,77 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportMachineInfo : NSObject { +@private + /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ + __strong NSString *_modelName; + + /** The processor type. */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /* The number of actual physical processor cores. */ + NSUInteger _processorCount; + + /* The number of logical processors. */ + NSUInteger _logicalProcessorCount; +} + +- (id) initWithModelName: (NSString *) modelName + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + processorCount: (NSUInteger) processorCount + logicalProcessorCount: (NSUInteger) logicalProcessorCount; + +/** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *modelName; + +/** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +/* + * The number of actual physical processor cores. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger processorCount; + +/* + * The number of logical processors. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger logicalProcessorCount; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h new file mode 100644 index 0000000..802e8d4 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h @@ -0,0 +1,103 @@ +/* + * Author: Damian Morris + * + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportProcessInfo : NSObject { +@private + /** Process name, or nil if unavailable. */ + __strong NSString *_processName; + + /** Process ID */ + NSUInteger _processID; + + /** Process path */ + __strong NSString* _processPath; + + /** Date and time that the crashing process was started. This may be unavailable, and this property + * will be nil. */ + __strong NSDate *_processStartTime; + + /** Parent process name, or nil if unavailable. */ + __strong NSString *_parentProcessName; + + /** Parent process ID */ + NSUInteger _parentProcessID; + + /** If false, the process is being run via process-level CPU emulation (such as Rosetta). */ + BOOL _native; +} + +- (id) initWithProcessName: (NSString *) processName + processID: (NSUInteger) processID + processPath: (NSString *) processPath + processStartTime: (NSDate *) processStartTime + parentProcessName: (NSString *) parentProcessName + parentProcessID: (NSUInteger) parentProcessID + native: (BOOL) native; + +/** + * The process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processName; + +/** + * The process ID. + */ +@property(nonatomic, readonly) NSUInteger processID; + +/** + * The path to the process executable. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processPath; + +/** + * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSDate *processStartTime; + +/** + * The parent process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *parentProcessName; + +/** + * The parent process ID. + */ +@property(nonatomic, readonly) NSUInteger parentProcessID; + +/** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */ +@property(nonatomic, readonly) BOOL native; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h new file mode 100644 index 0000000..03d570b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h @@ -0,0 +1,74 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +/** + * @ingroup constants + * + * The type encodings supported for CPU types and subtypes. Currently only Apple + * Mach-O defined encodings are supported. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Unknown cpu type encoding. */ + PLCrashReportProcessorTypeEncodingUnknown = 0, + + /** Apple Mach-defined processor types. */ + PLCrashReportProcessorTypeEncodingMach = 1 +} PLCrashReportProcessorTypeEncoding; + +@interface PLCrashReportProcessorInfo : NSObject { +@private + /** Type encoding */ + PLCrashReportProcessorTypeEncoding _typeEncoding; + + /** CPU type */ + uint64_t _type; + + /** CPU subtype */ + uint64_t _subtype; +} + +- (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding + type: (uint64_t) type + subtype: (uint64_t) subtype; + +/** The CPU type encoding. */ +@property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding; + +/** The CPU type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The CPU subtype. */ +@property(nonatomic, readonly) uint64_t subtype; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h new file mode 100644 index 0000000..e0a1ca1 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportRegisterInfo : NSObject { +@private + /** Register name */ + __strong NSString *_registerName; + + /** Register value */ + uint64_t _registerValue; +} + +- (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; + +/** + * Register name. + */ +@property(nonatomic, readonly, strong) NSString *registerName; + +/** + * Register value. + */ +@property(nonatomic, readonly) uint64_t registerValue; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h new file mode 100644 index 0000000..d949211 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h @@ -0,0 +1,60 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSignalInfo : NSObject { +@private + /** Signal name */ + __strong NSString *_name; + + /** Signal code */ + __strong NSString *_code; + + /** Fauling instruction or address */ + uint64_t _address; +} + +- (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address; + +/** + * The signal name. + */ +@property(nonatomic, readonly, strong) NSString *name; + +/** + * The signal code. + */ +@property(nonatomic, readonly, strong) NSString *code; + +/** + * The faulting instruction or address. + */ +@property(nonatomic, readonly) uint64_t address; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000..5fd4acc --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,57 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportSymbolInfo.h" +#endif + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + __strong PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000..bdb367c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + __strong NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly, strong) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h new file mode 100644 index 0000000..eb8a447 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h @@ -0,0 +1,177 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashMacros.h" +#endif + +@class PLCrashReportProcessorInfo; + +/** + * @ingroup constants + * + * Indicates the Operating System under which a Crash Log was generated. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Mac OS X. */ + PLCrashReportOperatingSystemMacOSX = 0, + + /** iPhone OS */ + PLCrashReportOperatingSystemiPhoneOS = 1, + + /** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */ + PLCrashReportOperatingSystemiPhoneSimulator = 2, + + /** Unknown operating system */ + PLCrashReportOperatingSystemUnknown = 3, + + /** Apple tvOS */ + PLCrashReportOperatingSystemAppleTVOS = 4, + +} PLCrashReportOperatingSystem; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** + * @ingroup constants + * + * Indicates the architecture under which a Crash Log was generated. + * + * @note The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * will make use of the new PLCrashReportProcessorInfo CPU type encodings. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** x86-32. */ + PLCrashReportArchitectureX86_32 = 0, + + /** x86-64 */ + PLCrashReportArchitectureX86_64 = 1, + + /** ARMv6 */ + PLCrashReportArchitectureARMv6 = 2, + + /** + * ARMv6 + * @deprecated This value has been deprecated in favor of ARM subtype-specific + * values. + * @sa PLCrashReportArchitectureARMv6 + */ + PLCrashReportArchitectureARM PLCR_DEPRECATED = PLCrashReportArchitectureARMv6, + + /** PPC */ + PLCrashReportArchitecturePPC = 3, + + /** PPC64 */ + PLCrashReportArchitecturePPC64 = 4, + + /** ARMv7 */ + PLCrashReportArchitectureARMv7 = 5, + + /** Unknown */ + PLCrashReportArchitectureUnknown = 6 +} PLCrashReportArchitecture; +#pragma clang diagnostic pop + +extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); +extern PLCrashReportArchitecture PLCrashReportHostArchitecture PLCR_EXTERNAL_DEPRECATED; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); + +@interface PLCrashReportSystemInfo : NSObject { +@private + /** Operating system */ + PLCrashReportOperatingSystem _operatingSystem; + + /** Operating system version */ + __strong NSString *_osVersion; + + /** OS build. May be nil. */ + __strong NSString *_osBuild; + + /** Architecture */ + PLCrashReportArchitecture _architecture; + + /** Date crash report was generated. May be nil if the date is unknown. */ + __strong NSDate *_timestamp; + + /** Processor information. */ + __strong PLCrashReportProcessorInfo *_processorInfo; +} + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + timestamp: (NSDate *) timestamp; + +/** The operating system. */ +@property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem; + +/** The operating system's release version. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemVersion; + +/** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemBuild; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo + * extensible encoding. */ +@property(nonatomic, readonly) PLCrashReportArchitecture architecture PLCR_DEPRECATED; + +/** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSDate *timestamp; + +/** The processor type. For v1.2 reports and later, this is an alias to the machine info's processorInfo. + * For earlier reports, this will be synthesized from the deprecated architecture property. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h new file mode 100644 index 0000000..adbc251 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h @@ -0,0 +1,66 @@ +/* + * Authors: + * Landon Fuller + * Damian Morris + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportFormatter.h" +#endif + +/** + * Supported text output formats. + * + * @ingroup enums + */ +typedef enum { + /** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available + * through iTunes Connect. */ + PLCrashReportTextFormatiOS = 0 +} PLCrashReportTextFormat; + + +@interface PLCrashReportTextFormatter : NSObject { +@private + /** Text output format. */ + PLCrashReportTextFormat _textFormat; + + /** Encoding to use for string output. */ + NSStringEncoding _stringEncoding; +} + ++ (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat; + +- (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h new file mode 100644 index 0000000..b9092e2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h @@ -0,0 +1,88 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_THREAD_INFO_H +#define PLCRASH_REPORT_THREAD_INFO_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportRegisterInfo.h" +#endif + + +@interface PLCrashReportThreadInfo : NSObject { +@private + /** The thread number. Should be unique within a given crash log. */ + NSInteger _threadNumber; + + /** Ordered list of PLCrashReportStackFrame instances */ + __strong NSArray *_stackFrames; + + /** YES if this thread crashed. */ + BOOL _crashed; + + /** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */ + __strong NSArray *_registers; +} + +- (id) initWithThreadNumber: (NSInteger) threadNumber + stackFrames: (NSArray *) stackFrames + crashed: (BOOL) crashed + registers: (NSArray *) registers; + +/** + * Application thread number. + */ +@property(nonatomic, readonly) NSInteger threadNumber; + +/** + * Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances. + * The array is ordered, last callee to first. + */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +/** + * If this thread crashed, set to YES. + */ +@property(nonatomic, readonly) BOOL crashed; + +/** + * State of the general purpose and related registers, as a list of + * PLCrashReportRegister instances. If this thead did not crash (crashed returns NO), + * this list will be empty. + */ +@property(nonatomic, readonly, strong) NSArray *registers; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReporter.h new file mode 100644 index 0000000..bdc8f83 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReporter.h @@ -0,0 +1,159 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +#ifndef PLCRASH_REPORTER_H +#define PLCRASH_REPORTER_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReporterConfig.h" +#import "PLCrashMacros.h" +#endif + +@class PLCrashMachExceptionServer; +@class PLCrashMachExceptionPortSet; + +/** + * @ingroup functions + * + * Prototype of a callback function used to execute additional user code with signal information as provided + * by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk. + * + * @param info The signal info. + * @param uap The crash's threads context. + * @param context The API client's supplied context value. + * + * @sa The @ref async_safety documentation. + * @sa PLCrashReporter::setPostCrashCallbacks: + */ +typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context); + +/** + * @ingroup types + * + * This structure contains callbacks supported by PLCrashReporter to allow the host application to perform + * additional tasks prior to program termination after a crash has occurred. + * + * @sa The @ref async_safety documentation. + */ +typedef struct PLCrashReporterCallbacks { + /** The version number of this structure. If not one of the defined version numbers for this type, the behavior + * is undefined. The current version of this structure is 0. */ + uint16_t version; + + /** An arbitrary user-supplied context value. This value may be NULL. */ + void *context; + + /** + * The callback used to report caught signal information. In version 0 of this structure, all crashes will be + * reported via this function. + * + * @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived + * from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via + * PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will + * not provide valid thread state. + * + * This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained + * here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions. + */ + PLCrashReporterPostCrashSignalCallback handleSignal; +} PLCrashReporterCallbacks; + +@interface PLCrashReporter : NSObject { +@private + /** Reporter configuration */ + __strong PLCrashReporterConfig *_config; + + /** YES if the crash reporter has been enabled */ + BOOL _enabled; + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if + * the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */ + __strong PLCrashMachExceptionServer *_machServer; + + /** Previously registered Mach exception ports, if any. */ + __strong PLCrashMachExceptionPortSet *_previousMachPorts; +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ + + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; + + /** Path to the crash reporter internal data directory */ + __strong NSString *_crashReportDirectory; +} + ++ (PLCrashReporter *) sharedReporter PLCR_DEPRECATED; + +- (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config; + +- (BOOL) hasPendingCrashReport; + +- (NSData *) loadPendingCrashReportData; +- (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; + +- (NSData *) generateLiveReportWithThread: (thread_t) thread; +- (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; +- (NSData *) generateLiveReportWithThread: (thread_t) thread exception: (NSException *) exception error: (NSError **) outError; + +- (NSData *) generateLiveReport; +- (NSData *) generateLiveReportAndReturnError: (NSError **) outError; +- (NSData *) generateLiveReportWithException: (NSException *) exception error: (NSError **) outError; + +- (BOOL) purgePendingCrashReport; +- (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; + +- (BOOL) enableCrashReporter; +- (BOOL) enableCrashReporterAndReturnError: (NSError **) outError; + +- (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks; + +/** + * Return the path to live crash report (which may not yet, or ever, exist). + */ +- (NSString *) crashReportPath; + +/** + * Custom data to save in the crash report. + */ +@property(nonatomic, strong) NSData *customData; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReporterConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReporterConfig.h new file mode 100644 index 0000000..f151e56 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Headers/PLCrashReporterConfig.h @@ -0,0 +1,197 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashFeatureConfig.h" +#endif + +/** + * @ingroup enums + * Supported mechanisms for trapping and handling crashes. + */ +typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) { + /** + * Trap fatal signals via a sigaction(2)-registered BSD signal handler. + * + * PLCrashReporter's signal handler will supersede previously registered handlers; existing + * handlers will not be called. This behavior may be modified in a future release, and should + * not be relied upon as a mechanism to prevent existing signal handlers from being called. + * + * There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically: + * + * - On Mac OS X, stack overflows will only be handled on the thread on which + * the crash reporter was initialized. This should generally be the main thread. + * - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being + * non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS). + * - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting + * in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal + * handlers prior to raising SIGABRT). These __abort()-based checks are: + * - Implemented for unsafe memcpy/strcpy/snprintf C functions. + * - Only enabled when operating on a fixed-width target buffer (in which case the + * compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument). + * - Only trigger in the case that the source data exceeds the size of the fixed width target + * buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy), + * or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer), + * AND that argument can't be checked at compile-time. + */ + PLCrashReporterSignalHandlerTypeBSD = 0, + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** + * Trap fatal signals via a Mach exception server. + * + * If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that + * exception handler. Should the exceptions be handled by an existing handler, no report will be generated + * by PLCrashReporter. + * + * @par Mac OS X + * + * On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note, + * however, that some kernel-internal constants, as well as architecture-specific trap information, + * may be required to fully interpret a Mach exception's root cause. + * + * @par iOS + * + * On iOS, the APIs required for a complete implementation are not fully public. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included + * Mach exception handling as an optional feature, with both build-time and runtime configuration + * to disable its inclusion or use, respectively. + * + * @par Debugger Incompatibility + * + * The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to + * suspend all active threads (which will include the Mach exception handler). Mach-based handling + * should not be used when a debugger is attached. + * + * @par More Details + * + * For more information, refer to @ref mach_exceptions. + */ + PLCrashReporterSignalHandlerTypeMach = 1 +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ +}; + +/** + * @ingroup enums + * Supported mechanisms for performing local symbolication. + * + * Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may + * return information that is incorrect. This may still be useful in the case where DWARF data is unavailable + * for a given build; in that case, it can provide function and method names (though not line numbers) for a + * crash report that may otherwise be unusable. + * + * Note, however, this comes at the cost of a significant increase in code that must run within the critical + * crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In + * addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may + * change in future iOS releases. Given that DWARF symbolication data will always be more accurate, and + * the risks inherent in executing considerably more code at crash time, it is strongly recommended that local + * symbolication only be enabled for non-release builds. + * + * Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the + * results. + */ +typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) { + /** No symbolication. */ + PLCrashReporterSymbolicationStrategyNone = 0, + + /** + * Use the standard binary symbol table. On iOS, this alone will return + * incomplete results, as most symbols are rewritten to the common '\' string. + */ + PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0, + + /** + * Use Objective-C metadata to find method and class names. This relies on detailed parsing + * of the Objective-C runtime data, including undefined flags and other runtime internals. As such, + * it may return incorrect data should the runtime be changed incompatibly. + */ + PLCrashReporterSymbolicationStrategyObjC = 1 << 1, + + /** + * Enable all available symbolication strategies. + */ + PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC) +}; + +@interface PLCrashReporterConfig : NSObject { +@private + /** The configured signal handler type. */ + PLCrashReporterSignalHandlerType _signalHandlerType; + + /** The configured symbolication strategy. */ + PLCrashReporterSymbolicationStrategy _symbolicationStrategy; + + /** + * Flag indicating if the uncaughtExceptionHandler should be initialized or not. It usually is, except in a + * Xamarin environment. + */ + BOOL _shouldRegisterUncaughtExceptionHandler; +} + ++ (instancetype) defaultConfiguration; + +- (instancetype) init; + +- (instancetype) initWithBasePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + basePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler + basePath: (NSString *) basePath; + +/** The base path to save the crash data. */ +@property(nonatomic, readonly) NSString *basePath; + +/** The configured signal handler type. */ +@property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType; + +/** The configured symbolication strategy. */ +@property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy; + +/** Should PLCrashReporter regiser an uncaught exception handler? This is entended to be used in Xamarin apps */ +@property(nonatomic, readonly) BOOL shouldRegisterUncaughtExceptionHandler; + +@end + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Modules/module.modulemap b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Modules/module.modulemap new file mode 100644 index 0000000..4fa4304 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module CrashReporter { + umbrella header "CrashReporter.h" + + export * + module * { export * } + + link framework "Foundation" +} diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Resources/Info.plist b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Resources/Info.plist new file mode 100644 index 0000000..3ce348a --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Resources/Info.plist @@ -0,0 +1,52 @@ + + + + + BuildMachineOSBuild + 21G531 + CFBundleDevelopmentRegion + English + CFBundleExecutable + CrashReporter + CFBundleIdentifier + com.microsoft.CrashReporter + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CrashReporter + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.11.1 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1.11.1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 13C100 + DTPlatformName + macosx + DTPlatformVersion + 12.1 + DTSDKBuild + 21C46 + DTSDKName + macosx12.1 + DTXcode + 1321 + DTXcodeBuild + 13C100 + LSMinimumSystemVersion + 10.15 + UIDeviceFamily + + 2 + + + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/CrashReporter b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/CrashReporter new file mode 100644 index 0000000..42827e4 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/CrashReporter differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/CrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/CrashReporter.h new file mode 100644 index 0000000..99878d3 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/CrashReporter.h @@ -0,0 +1,366 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifdef __APPLE__ +#import +#endif + +#if __has_include() + +// This must be included before any other PLCrashReporter includes, as +// it redefines symbol names +#import + +/* Library Imports */ +#import +#import +#import +#else +#import "PLCrashNamespace.h" +#import "PLCrashReporter.h" +#import "PLCrashReport.h" +#import "PLCrashReportTextFormatter.h" +#endif + +/** + * @defgroup functions Crash Reporter Functions Reference + */ + +/** + * @defgroup types Crash Reporter Data Types Reference + */ + +/** + * @defgroup constants Crash Reporter Constants Reference + */ + +/** + * @internal + * @defgroup plcrash_internal Crash Reporter Internal Documentation + */ + +/** + * @defgroup enums Enumerations + * @ingroup constants + */ + +/** + * @defgroup globals Global Variables + * @ingroup constants + */ + +/** + * @defgroup exceptions Exceptions + * @ingroup constants + */ + +/* Exceptions */ +extern NSString *PLCrashReporterException; + +/* Error Domain and Codes */ +extern NSString *PLCrashReporterErrorDomain; + +/** + * NSError codes in the Plausible Crash Reporter error domain. + * @ingroup enums + */ +typedef enum { + /** An unknown error has occured. If this + * code is received, it is a bug, and should be reported. */ + PLCrashReporterErrorUnknown = 0, + + /** An Mach or POSIX operating system error has occured. The underlying NSError cause may be fetched from the userInfo + * dictionary using the NSUnderlyingErrorKey key. */ + PLCrashReporterErrorOperatingSystem = 1, + + /** The crash report log file is corrupt or invalid */ + PLCrashReporterErrorCrashReportInvalid = 2, + + /** An attempt to use a resource which was in use at the time in a manner which would have conflicted with the request. */ + PLCrashReporterErrorResourceBusy = 3 +} PLCrashReporterError; + +/** + * @mainpage Plausible Crash Reporter + * + * @section intro_sec Introduction + * + * Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X. + * + * The following features are supported: + * + * - Implemented as an in-process signal handler. + * - Does not interfer with debugging in gdb.. + * - Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc). + * - Full thread state for all active threads (backtraces, register dumps) is provided. + * + * If your application crashes, a crash report will be written. When the application is next run, you may check for a + * pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the + * report locally. + * + * @section intro_encoding Crash Report Format + * + * Crash logs are encoded using google protobuf, and may be decoded + * using the provided PLCrashReport API. Additionally, the include plcrashutil handles conversion of binary crash reports to the + * symbolicate-compatible iPhone text format. + * + * @section doc_sections Documentation Sections + * - @subpage example_usage_iphone + * - @subpage error_handling + * - @subpage async_safety + */ + +/** + * @page example_usage_iphone Example iPhone Usage + * + * @code + * // + * // Called to handle a pending crash report. + * // + * - (void) handleCrashReport { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSData *crashData; + * NSError *error; + * + * // Try loading the crash report + * crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error]; + * if (crashData == nil) { + * NSLog(@"Could not load crash report: %@", error); + * goto finish; + * } + * + * // We could send the report from here, but we'll just print out + * // some debugging info instead + * PLCrashReport *report = [[[PLCrashReport alloc] initWithData: crashData error: &error] autorelease]; + * if (report == nil) { + * NSLog(@"Could not parse crash report"); + * goto finish; + * } + * + * NSLog(@"Crashed on %@", report.systemInfo.timestamp); + * NSLog(@"Crashed with signal %@ (code %@, address=0x%" PRIx64 ")", report.signalInfo.name, + * report.signalInfo.code, report.signalInfo.address); + * + * // Purge the report + * finish: + * [crashReporter purgePendingCrashReport]; + * return; + * } + * + * // from UIApplicationDelegate protocol + * - (void) applicationDidFinishLaunching: (UIApplication *) application { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSError *error; + * + * // Check if we previously crashed + * if ([crashReporter hasPendingCrashReport]) + * [self handleCrashReport]; + + * // Enable the Crash Reporter + * if (![crashReporter enableCrashReporterAndReturnError: &error]) + * NSLog(@"Warning: Could not enable crash reporter: %@", error); + * + * } + * @endcode + * + */ + +/** + * @page error_handling Error Handling Programming Guide + * + * Where a method may return an error, Plausible Crash Reporter provides access to the underlying + * cause via an optional NSError argument. + * + * All returned errors will be a member of one of the below defined domains, however, new domains and + * error codes may be added at any time. If you do not wish to report on the error cause, many methods + * support a simple form that requires no NSError argument. + * + * @section error_domains Error Domains, Codes, and User Info + * + * @subsection crashreporter_errors Crash Reporter Errors + * + * Any errors in Plausible Crash Reporter use the #PLCrashReporterErrorDomain error domain, and and one + * of the error codes defined in #PLCrashReporterError. + */ + +/** + * @page async_safety Async-Safe Programming Guide + * + * Plausible CrashReporter provides support for executing an application specified function in the context of the + * crash reporter's signal handler, after the crash report has been written to disk. This was a regularly requested + * feature, and provides the ability to implement application finalization in the event of a crash. However, writing + * code intended for execution inside of a signal handler is exceptionally difficult, and is not recommended. + * + * @section program_flow Program Flow and Signal Handlers + * + * When the signal handler is called the normal flow of the program is interrupted, and your program is an unknown + * state. Locks may be held, the heap may be corrupt (or in the process of being updated), and your signal + * handler may invoke a function that was being executed at the time of the signal. This may result in deadlocks, + * data corruption, and program termination. + * + * @section functions Async-Safe Functions + * + * A subset of functions are defined to be async-safe by the OS, and are safely callable from within a signal handler. If + * you do implement a custom post-crash handler, it must be async-safe. A table of POSIX-defined async-safe functions + * and additional information is available from the + * CERT programming guide - SIG30-C + * + * Most notably, the Objective-C runtime itself is not async-safe, and Objective-C may not be used within a signal + * handler. + * + * @sa PLCrashReporter::setCrashCallbacks: + */ + +/** + * @page mach_exceptions Mach Exceptions on Mac OS X and iOS + * + * PLCrashReporter includes support for monitoring crashes via an in-process Mach exception handler. There are a small + * number of crash cases that will not be caught with via a POSIX signal handler, but can be caught via a Mach + * exception handler: + * + * - Stack overflow. sigaltstack() is broken in later iOS releases, and even if functional, must be configured + * on a per-thread basis. + * - Internal Apple assertions that call libSystem's __assert. These include compiler-checked constraints + * for built-in functions, such as strcpy_chk(). The __abort() implementation actually disables the SIGABRT + * signal handler (resetting it to SIG_DFL) prior to to issueing a SIGABRT, bypassing signal-based crash + * reporters entirely. + * + * Unfortunately, the latter issue (__assert) can not be handled on iOS; trapping abort requires that + * a Mach exception handler operate out-of-process, which is impossible on iOS. On Mac OS X, this will + * only be handled once we've implemented fully out-of-process crash excution. + * + * On Mac OS X, the Mach exception implementation is fully supported using entirely public API. On iOS, + * the APIs required are not fully public -- more details on the implications of this for exception handling on + * iOS may be found in @ref mach_exceptions_ios below. It is worth noting that even where the Mach exception APIs + * are fully supported, kernel-internal constants, as well + * as architecture-specific trap information, may be required to fully interpret a Mach exception's root cause. + * + * For example, the EXC_SOFTWARE exception is dispatched for four different failure types, using the exception + * code to differentiate failure types: + * - Non-existent system call invoked (SIGSYS) + * - Write on a pipe with no reader (SIGPIPE) + * - Abort program (SIGABRT -- unused) + * - Kill program (SIGKILL) + * + * Of those four types, only the constant required to interpret the SIGKILL behavior (EXC_SOFT_SIGNAL) is publicly defined. + * Of the remaining three failure types, the constant values are kernel implementation-private, defined only in the available + * kernel sources. On iOS, these sources are unavailable, and while they generally do match the Mac OS X implementation, there + * are no gaurantees that this is -- or will remain -- the case in the future. + * + * Likewise, interpretation of particular fault types requires information regarding the underlying machine traps + * that triggered the Mach exceptions. For example, a floating point trap on x86/x86-64 will trigger an EXC_ARITHMETIC, + * with a subcode value containing the value of the FPU status register. Determining the exact FPU cause requires + * extracting the actual exception flags from status register as per the x86 architecture documentation. The exact format + * of this subcode value is not actually documented outside the kernel, and may change in future releases. + * + * While we have the advantage of access to the x86 kernel sources, the situation on ARM is even less clear. The actual + * use of the Mach exception codes and subcodes is largely undefined by both headers and publicly available documentation, + * and the available x86 kernel sources are of little use in interpreting this data. + * + * As such, while Mach exceptions may catch some cases that BSD signals can not, they are not a perfect solution, + * and may also provide less insight into the actual failures that occur. By comparison, the BSD signal interface + * is both fully defined and architecture independent, with any necessary interpretation of the Mach exception + * codes handled in-kernel at the time of exception dispatch. It is generally recommended by Apple as the preferred + * interface, and should generally be preferred by PLCrashReporter API clients. + * + * @section mach_exceptions_compatibility Compatibility Issues + * + * @subsection Debuggers + * + * Enabling in-process Mach exception handlers will conflict with any attached debuggers; the debugger + * may suspend the processes Mach exception handling thread, which will result in any exception messages + * sent via the debugger being lost, as the in-process handler will be unable to receive and forward + * the messages. + * + * @subsection Managed Runtimes (Xamarin, Unity) + * + * A Mach exception handler may conflict with any managed runtime that registers a BSD signal handler that + * can safely handle otherwise fatal signals, allowing execution to proceed. This includes products + * such as Xamarin for iOS. + * + * In such a case, PLCrashReporter will write a crash report for non-fatal signals, as there is no + * immediate mechanism for determining whether a signal handler exists and that it can safely + * handle the failure. This can result in unexpected delays in application execution, increased I/O to + * disk, and other undesirable operations. + * + * @section mach_exceptions_ios Mach Exceptions on iOS + * + * The APIs required for Mach exception handling are not fully public on iOS. After filing a request with + * Apple DTS to clarify the status of the Mach exception APIs on iOS, and implementing a Mach Exception + * handler using only supported API, they provided the following guidance: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited undefined API on iOS. The reporter + * may be excluded entirely at build time by modifying the PLCRASH_FEATURE_MACH_EXCEPTIONS build configuration; it + * may also be disabled at runtime by configuring the PLCrashReporter instance appropriately via PLCrashReporterConfig. + * + * The iOS implementation is implemented almost entirely using public API, and links against no actual private symbols; + * the use of undocumented functionality is limited to assuming the use of specific msgh_id values (see below + * for details). As a result, it may be considered perfectly safe to include the Mach Exception code in the + * standard build, and enable/disable it at runtime. + * + * The following issues exist in the iOS implementation: + * - The msgh_id values required for an exception reply message are not available from the available + * headers and must be hard-coded. This prevents one from safely replying to exception messages, which + * means that it is impossible to (correctly) inform the server that an exception has *not* been + * handled. + * + * Impact: + * This can lead to the process locking up and not dispatching to the host exception handler (eg, Apple's + * crash reporter), depending on the behavior of the kernel exception code. + * + * - The mach_* structure/type variants required by MACH_EXCEPTION_CODES are not publicly defined (on Mac OS X, + * these are provided by mach_exc.defs). This prevents one from forwarding exception messages to an existing + * handler that was registered with a MACH_EXCEPTION_CODES behavior (eg, forwarding is entirely non-functional + * on ARM64 devices). + * + * Impact: + * This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES, + * including other handlers registered within the current process, eg, by a managed runtime. This could + * also result in misinterpretation of a Mach exception message, in the case where the message format is + * modified by Apple to be incompatible with the existing 32-bit format. + * + * This is the case with LLDB; it will register a task exception handler with MACH_EXCEPTION_CODES set. Failure + * to correctly forward these exceptions will result in the debugger breaking in interesting ways; for example, + * changes to the set of dyld-loaded images are detected by setting a breakpoint on the dyld image registration + * funtions, and this functionality will break if the exception is not correctly forwarded. + * + * Since Mach exception handling is important for a fully functional crash reporter, we have also filed a radar + * to request that the API be made public: + * Radar: rdar://12939497 RFE: Provide mach_exc.defs for iOS + * + * At the time of this writing, the radar remains open/unresolved. + */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h new file mode 100644 index 0000000..7bcaebf --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h @@ -0,0 +1,108 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_FEATURE_CONFIG_H +#define PLCRASH_FEATURE_CONFIG_H + +#include + +/** + * @internal + * + * Build-time configuration for PLCrashReporter. + * + * This is used to automatically enable/disable features on a per-platform and per-configuration + * basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter. + * + * @defgroup build_config Build Configuration + * @ingroup constants + * @{ + */ + +/* + * Defaults + */ + +/* + * For release builds, disable unused unwind implementations on targets that do not use them. For non-release + * builds, we include the unwind implementations to allow testing on a broader range of targets. + */ +#ifdef PLCF_RELEASE_BUILD +# if defined(__arm__) +# ifndef PLCRASH_FEATURE_UNWIND_DWARF +# define PLCRASH_FEATURE_UNWIND_DWARF 0 +# endif +# ifndef PLCRASH_FEATURE_UNWIND_COMPACT +# define PLCRASH_FEATURE_UNWIND_COMPACT 0 +# endif +# endif +#endif + +/* + * Configuration Flags + */ + + +#ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS +/** + * If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported, + * using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a + * popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either + * they've received special dispensation to use private APIs / private structures, they've found another way to do + * it, or they're just using undocumented functionality and hoping for the best. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled + * Mach exception handling by default, and provided both build-time and runtime configuration + * to disable its use. + * + * For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions. + */ +#if TARGET_OS_TV +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 0 +#else +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 1 +#endif +#endif + +#ifndef PLCRASH_FEATURE_UNWIND_DWARF +/** If true, enable DWARF unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_DWARF 1 +#endif + + +#ifndef PLCRASH_FEATURE_UNWIND_COMPACT +/** If true, enable compact unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_COMPACT 1 +#endif + +/* + * @} + */ + +#endif /* PLCRASH_FEATURE_CONFIG_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashMacros.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashMacros.h new file mode 100644 index 0000000..556e1c2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashMacros.h @@ -0,0 +1,143 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_CONSTANTS_H +#define PLCRASH_CONSTANTS_H + +#include +#include + +#if defined(__cplusplus) +# define PLCR_EXPORT extern "C" +# define PLCR_C_BEGIN_DECLS extern "C" { +# define PLCR_C_END_DECLS } +#else +# define PLCR_EXPORT extern +# define PLCR_C_BEGIN_DECLS +# define PLCR_C_END_DECLS +#endif + +#if defined(__cplusplus) +# define NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ +# define IS_EMPTY_(name) defined(NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ ## name) +# define IS_EMPTY(name) IS_EMPTY_(name) +# if defined(PLCRASHREPORTER_PREFIX) && !IS_EMPTY(PLCRASHREPORTER_PREFIX) + /** @internal Define the plcrash namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ +# define PLCR_CPP_BEGIN_NS namespace plcrash { inline namespace PLCRASHREPORTER_PREFIX { + + /** @internal Close the definition of the `plcrash` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ +# define PLCR_CPP_END_NS }} +# else +# define PLCR_CPP_BEGIN_NS namespace plcrash { +# define PLCR_CPP_END_NS } +# endif +#endif + +#ifdef __clang__ +# define PLCR_PRAGMA_CLANG(_p) _Pragma(_p) +#else +# define PLCR_PRAGMA_CLANG(_p) +#endif + +#ifdef __clang__ +# define PLCR_DEPRECATED __attribute__((deprecated)) +#else +# define PLCR_DEPRECATED +#endif + +#if defined(__clang__) || defined(__GNUC__) +# define PLCR_UNUSED __attribute__((unused)) +#else +# define PLCR_UNUSED +#endif + +#ifdef PLCR_PRIVATE +/** + * Marks a definition as deprecated only for for external clients, allowing + * uses of it internal fo the framework. + */ +# define PLCR_EXTERNAL_DEPRECATED + +/** + * @internal + * A macro to put above a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() \ + PLCR_PRAGMA_CLANG("clang diagnostic push"); \ + PLCR_PRAGMA_CLANG("clang diagnostic ignored \"-Wdocumentation-deprecated-sync\"") + +/** + * @internal + * A macro to put below a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_POP() PLCR_PRAGMA_CLANG("clang diagnostic pop") + +#else + +# define PLCR_EXTERNAL_DEPRECATED PLCR_DEPRECATED +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() + +#endif /* PLCR_PRIVATE */ + +#ifdef PLCR_PRIVATE +# if defined(__clang__) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") +# define PLCR_FALLTHROUGH [[clang::fallthrough]] +# else +# define PLCR_FALLTHROUGH do {} while (0) +# endif +#endif + +#ifdef PLCR_PRIVATE +/** + * @internal + * Static compile-time assertion. + * + * @param name The assertion name; must be valid for use within a C identifier. + * @param cond Assertion condition + */ +# define PLCR_ASSERT_STATIC(name, cond) PLCR_ASSERT_STATIC_(name, cond, __LINE__) +/* + * C++11 and C11 both provide a static_assert(). + * + * Otherwise, we have to use typedef-based static assertions. + */ +# if (defined(__cplusplus) && __cplusplus >= 201103L) || (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(#name, cond) +# define PLCR_ASSERT_STATIC__(name, cond) static_assert(cond, #name) +# else +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(name, cond, line) +# define PLCR_ASSERT_STATIC__(name, cond, line) typedef int plcf_static_assert_##name##_##line [(cond) ? 1 : -1] PLCR_UNUSED +# endif +#endif /* PLCR_PRIVATE */ + +#endif /* PLCRASH_CONSTANTS_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashNamespace.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashNamespace.h new file mode 100644 index 0000000..f4c263c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashNamespace.h @@ -0,0 +1,320 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +// #define PLCRASHREPORTER_PREFIX AcmeCo + + +// We need two extra layers of indirection to make CPP substitute +// the PLCRASHREPORTER_PREFIX define. +#define PLNS_impl2(prefix, symbol) prefix ## symbol +#define PLNS_impl(prefix, symbol) PLNS_impl2(prefix, symbol) +#define PLNS(symbol) PLNS_impl(PLCRASHREPORTER_PREFIX, symbol) + + +/* + * Rewrite all ObjC/C symbols. + * + * For C++ symbol handling, refer to the PLCR_CPP_BEGIN_NS and PLCR_CPP_END_NS + * macros. + */ +#ifdef PLCRASHREPORTER_PREFIX + +/* Objective-C Classes */ +#define PLCrashMachExceptionServer PLNS(PLCrashMachExceptionServer) +#define PLCrashReport PLNS(PLCrashReport) +#define PLCrashReportApplicationInfo PLNS(PLCrashReportApplicationInfo) +#define PLCrashReportBinaryImageInfo PLNS(PLCrashReportBinaryImageInfo) +#define PLCrashReportExceptionInfo PLNS(PLCrashReportExceptionInfo) +#define PLCrashReportMachExceptionInfo PLNS(PLCrashReportMachExceptionInfo) +#define PLCrashReportMachineInfo PLNS(PLCrashReportMachineInfo) +#define PLCrashReportProcessInfo PLNS(PLCrashReportProcessInfo) +#define PLCrashReportProcessorInfo PLNS(PLCrashReportProcessorInfo) +#define PLCrashReportRegisterInfo PLNS(PLCrashReportRegisterInfo) +#define PLCrashReportSignalInfo PLNS(PLCrashReportSignalInfo) +#define PLCrashReportStackFrameInfo PLNS(PLCrashReportStackFrameInfo) +#define PLCrashReportSymbolInfo PLNS(PLCrashReportSymbolInfo) +#define PLCrashReportSystemInfo PLNS(PLCrashReportSystemInfo) +#define PLCrashReportTextFormatter PLNS(PLCrashReportTextFormatter) +#define PLCrashReportThreadInfo PLNS(PLCrashReportThreadInfo) +#define PLCrashReporter PLNS(PLCrashReporter) +#define PLCrashSignalHandler PLNS(PLCrashSignalHandler) +#define PLCrashHostInfo PLNS(PLCrashHostInfo) +#define PLCrashMachExceptionPort PLNS(PLCrashMachExceptionPort) +#define PLCrashMachExceptionPortSet PLNS(PLCrashMachExceptionPortSet) +#define PLCrashProcessInfo PLNS(PLCrashProcessInfo) +#define PLCrashReporterConfig PLNS(PLCrashReporterConfig) +#define PLCrashUncaughtExceptionHandler PLNS(PLCrashUncaughtExceptionHandler) +#define PLCrashReportFormatter PLNS(PLCrashReportFormatter) + +/* Public C functions */ +#define PLCrashMachExceptionForward PLNS(PLCrashMachExceptionForward) +#define PLCrashSignalHandlerForward PLNS(PLCrashSignalHandlerForward) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) + + +/* Public C global symbols */ +#define PLCrashReporterErrorDomain PLNS(PLCrashReporterErrorDomain) +#define PLCrashReportHostArchitecture PLNS(PLCrashReportHostArchitecture) +#define PLCrashReportHostOperatingSystem PLNS(PLCrashReportHostOperatingSystem) +#define PLCrashReporterException PLNS(PLCrashReporterException) + +/* For backwards compatibility, plcrash_async_byteorder vends C++ methods when included under C++. We have + * to handle this distinctly from our PLCR_CPP_BEGIN_NS C++ namespacing mechanism. */ +#define plcrash_async_byteorder PLNS(plcrash_async_byteorder) + +/* + * All private C symbols. Once these are migrated to C++, we'll be able to use the much simpler + * PLCR_CPP_BEGIN_NS machinery. + * + * This list was automatically generated (and can be updated) by setting PLCRASHREPORTER_PREFIX to 'AcmeCo', + * building the library, and executing the following: + * nm -g -U | grep '^[0-9]' | c++filt | grep -v AcmeCo | grep -E '_pl|_PL' | awk '{print $3}' | cut -c 2- | sort | uniq | awk '{print "#define",$1,"PLNS("$1")"}' + */ +#define pl_mach_thread_self PLNS(pl_mach_thread_self) +#define plcrash__architecture__descriptor PLNS(plcrash__architecture__descriptor) +#define plcrash__crash_report__application_info__descriptor PLNS(plcrash__crash_report__application_info__descriptor) +#define plcrash__crash_report__application_info__init PLNS(plcrash__crash_report__application_info__init) +#define plcrash__crash_report__binary_image__descriptor PLNS(plcrash__crash_report__binary_image__descriptor) +#define plcrash__crash_report__binary_image__init PLNS(plcrash__crash_report__binary_image__init) +#define plcrash__crash_report__descriptor PLNS(plcrash__crash_report__descriptor) +#define plcrash__crash_report__exception__descriptor PLNS(plcrash__crash_report__exception__descriptor) +#define plcrash__crash_report__exception__init PLNS(plcrash__crash_report__exception__init) +#define plcrash__crash_report__free_unpacked PLNS(plcrash__crash_report__free_unpacked) +#define plcrash__crash_report__get_packed_size PLNS(plcrash__crash_report__get_packed_size) +#define plcrash__crash_report__init PLNS(plcrash__crash_report__init) +#define plcrash__crash_report__machine_info__descriptor PLNS(plcrash__crash_report__machine_info__descriptor) +#define plcrash__crash_report__machine_info__init PLNS(plcrash__crash_report__machine_info__init) +#define plcrash__crash_report__pack PLNS(plcrash__crash_report__pack) +#define plcrash__crash_report__pack_to_buffer PLNS(plcrash__crash_report__pack_to_buffer) +#define plcrash__crash_report__process_info__descriptor PLNS(plcrash__crash_report__process_info__descriptor) +#define plcrash__crash_report__process_info__init PLNS(plcrash__crash_report__process_info__init) +#define plcrash__crash_report__processor__descriptor PLNS(plcrash__crash_report__processor__descriptor) +#define plcrash__crash_report__processor__init PLNS(plcrash__crash_report__processor__init) +#define plcrash__crash_report__processor__type_encoding__descriptor PLNS(plcrash__crash_report__processor__type_encoding__descriptor) +#define plcrash__crash_report__report_info__descriptor PLNS(plcrash__crash_report__report_info__descriptor) +#define plcrash__crash_report__report_info__init PLNS(plcrash__crash_report__report_info__init) +#define plcrash__crash_report__signal__descriptor PLNS(plcrash__crash_report__signal__descriptor) +#define plcrash__crash_report__signal__init PLNS(plcrash__crash_report__signal__init) +#define plcrash__crash_report__signal__mach_exception__descriptor PLNS(plcrash__crash_report__signal__mach_exception__descriptor) +#define plcrash__crash_report__signal__mach_exception__init PLNS(plcrash__crash_report__signal__mach_exception__init) +#define plcrash__crash_report__symbol__descriptor PLNS(plcrash__crash_report__symbol__descriptor) +#define plcrash__crash_report__symbol__init PLNS(plcrash__crash_report__symbol__init) +#define plcrash__crash_report__system_info__descriptor PLNS(plcrash__crash_report__system_info__descriptor) +#define plcrash__crash_report__system_info__init PLNS(plcrash__crash_report__system_info__init) +#define plcrash__crash_report__system_info__operating_system__descriptor PLNS(plcrash__crash_report__system_info__operating_system__descriptor) +#define plcrash__crash_report__thread__descriptor PLNS(plcrash__crash_report__thread__descriptor) +#define plcrash__crash_report__thread__init PLNS(plcrash__crash_report__thread__init) +#define plcrash__crash_report__thread__register_value__descriptor PLNS(plcrash__crash_report__thread__register_value__descriptor) +#define plcrash__crash_report__thread__register_value__init PLNS(plcrash__crash_report__thread__register_value__init) +#define plcrash__crash_report__thread__stack_frame__descriptor PLNS(plcrash__crash_report__thread__stack_frame__descriptor) +#define plcrash__crash_report__thread__stack_frame__init PLNS(plcrash__crash_report__thread__stack_frame__init) +#define plcrash__crash_report__unpack PLNS(plcrash__crash_report__unpack) +#define plcrash_async_address_apply_offset PLNS(plcrash_async_address_apply_offset) +#define plcrash_async_byteorder_big_endian PLNS(plcrash_async_byteorder_big_endian) +#define plcrash_async_byteorder_direct PLNS(plcrash_async_byteorder_direct) +#define plcrash_async_byteorder_little_endian PLNS(plcrash_async_byteorder_little_endian) +#define plcrash_async_byteorder_swapped PLNS(plcrash_async_byteorder_swapped) +#define plcrash_async_cfe_entry_apply PLNS(plcrash_async_cfe_entry_apply) +#define plcrash_async_cfe_entry_free PLNS(plcrash_async_cfe_entry_free) +#define plcrash_async_cfe_entry_init PLNS(plcrash_async_cfe_entry_init) +#define plcrash_async_cfe_entry_register_count PLNS(plcrash_async_cfe_entry_register_count) +#define plcrash_async_cfe_entry_register_list PLNS(plcrash_async_cfe_entry_register_list) +#define plcrash_async_cfe_entry_return_address_register PLNS(plcrash_async_cfe_entry_return_address_register) +#define plcrash_async_cfe_entry_stack_adjustment PLNS(plcrash_async_cfe_entry_stack_adjustment) +#define plcrash_async_cfe_entry_stack_offset PLNS(plcrash_async_cfe_entry_stack_offset) +#define plcrash_async_cfe_entry_type PLNS(plcrash_async_cfe_entry_type) +#define plcrash_async_cfe_reader_find_pc PLNS(plcrash_async_cfe_reader_find_pc) +#define plcrash_async_cfe_reader_free PLNS(plcrash_async_cfe_reader_free) +#define plcrash_async_cfe_reader_init PLNS(plcrash_async_cfe_reader_init) +#define plcrash_async_cfe_register_decode PLNS(plcrash_async_cfe_register_decode) +#define plcrash_async_cfe_register_encode PLNS(plcrash_async_cfe_register_encode) +#define plcrash_async_file_close PLNS(plcrash_async_file_close) +#define plcrash_async_file_flush PLNS(plcrash_async_file_flush) +#define plcrash_async_file_init PLNS(plcrash_async_file_init) +#define plcrash_async_file_write PLNS(plcrash_async_file_write) +#define plcrash_async_find_symbol PLNS(plcrash_async_find_symbol) +#define plcrash_async_image_containing_address PLNS(plcrash_async_image_containing_address) +#define plcrash_async_image_list_next PLNS(plcrash_async_image_list_next) +#define plcrash_async_image_list_set_reading PLNS(plcrash_async_image_list_set_reading) +#define plcrash_async_mach_exception_get_siginfo PLNS(plcrash_async_mach_exception_get_siginfo) +#define plcrash_async_macho_byteorder PLNS(plcrash_async_macho_byteorder) +#define plcrash_async_macho_contains_address PLNS(plcrash_async_macho_contains_address) +#define plcrash_async_macho_cpu_subtype PLNS(plcrash_async_macho_cpu_subtype) +#define plcrash_async_macho_cpu_type PLNS(plcrash_async_macho_cpu_type) +#define plcrash_async_macho_find_command PLNS(plcrash_async_macho_find_command) +#define plcrash_async_macho_find_segment_cmd PLNS(plcrash_async_macho_find_segment_cmd) +#define plcrash_async_macho_find_symbol_by_name PLNS(plcrash_async_macho_find_symbol_by_name) +#define plcrash_async_macho_find_symbol_by_pc PLNS(plcrash_async_macho_find_symbol_by_pc) +#define plcrash_async_macho_header PLNS(plcrash_async_macho_header) +#define plcrash_async_macho_header_size PLNS(plcrash_async_macho_header_size) +#define plcrash_async_macho_map_section PLNS(plcrash_async_macho_map_section) +#define plcrash_async_macho_map_segment PLNS(plcrash_async_macho_map_segment) +#define plcrash_async_macho_mapped_segment_free PLNS(plcrash_async_macho_mapped_segment_free) +#define plcrash_async_macho_next_command PLNS(plcrash_async_macho_next_command) +#define plcrash_async_macho_next_command_type PLNS(plcrash_async_macho_next_command_type) +#define plcrash_async_macho_string_free PLNS(plcrash_async_macho_string_free) +#define plcrash_async_macho_string_get_length PLNS(plcrash_async_macho_string_get_length) +#define plcrash_async_macho_string_get_pointer PLNS(plcrash_async_macho_string_get_pointer) +#define plcrash_async_macho_string_init PLNS(plcrash_async_macho_string_init) +#define plcrash_async_macho_symtab_reader_free PLNS(plcrash_async_macho_symtab_reader_free) +#define plcrash_async_macho_symtab_reader_init PLNS(plcrash_async_macho_symtab_reader_init) +#define plcrash_async_macho_symtab_reader_read PLNS(plcrash_async_macho_symtab_reader_read) +#define plcrash_async_macho_symtab_reader_symbol_name PLNS(plcrash_async_macho_symtab_reader_symbol_name) +#define plcrash_async_memcpy PLNS(plcrash_async_memcpy) +#define plcrash_async_memset PLNS(plcrash_async_memset) +#define plcrash_async_mobject_base_address PLNS(plcrash_async_mobject_base_address) +#define plcrash_async_mobject_free PLNS(plcrash_async_mobject_free) +#define plcrash_async_mobject_init PLNS(plcrash_async_mobject_init) +#define plcrash_async_mobject_length PLNS(plcrash_async_mobject_length) +#define plcrash_async_mobject_read_uint16 PLNS(plcrash_async_mobject_read_uint16) +#define plcrash_async_mobject_read_uint32 PLNS(plcrash_async_mobject_read_uint32) +#define plcrash_async_mobject_read_uint64 PLNS(plcrash_async_mobject_read_uint64) +#define plcrash_async_mobject_read_uint8 PLNS(plcrash_async_mobject_read_uint8) +#define plcrash_async_mobject_remap_address PLNS(plcrash_async_mobject_remap_address) +#define plcrash_async_mobject_task PLNS(plcrash_async_mobject_task) +#define plcrash_async_mobject_verify_local_pointer PLNS(plcrash_async_mobject_verify_local_pointer) +#define plcrash_async_objc_cache_free PLNS(plcrash_async_objc_cache_free) +#define plcrash_async_objc_cache_init PLNS(plcrash_async_objc_cache_init) +#define plcrash_async_objc_find_method PLNS(plcrash_async_objc_find_method) +#define plcrash_async_signal_sigcode PLNS(plcrash_async_signal_sigcode) +#define plcrash_async_signal_signame PLNS(plcrash_async_signal_signame) +#define plcrash_async_strcmp PLNS(plcrash_async_strcmp) +#define plcrash_async_strerror PLNS(plcrash_async_strerror) +#define plcrash_async_strncmp PLNS(plcrash_async_strncmp) +#define plcrash_async_symbol_cache_free PLNS(plcrash_async_symbol_cache_free) +#define plcrash_async_symbol_cache_init PLNS(plcrash_async_symbol_cache_init) +#define plcrash_async_task_memcpy PLNS(plcrash_async_task_memcpy) +#define plcrash_async_task_read_uint16 PLNS(plcrash_async_task_read_uint16) +#define plcrash_async_task_read_uint32 PLNS(plcrash_async_task_read_uint32) +#define plcrash_async_task_read_uint64 PLNS(plcrash_async_task_read_uint64) +#define plcrash_async_task_read_uint8 PLNS(plcrash_async_task_read_uint8) +#define plcrash_async_thread_state_clear_all_regs PLNS(plcrash_async_thread_state_clear_all_regs) +#define plcrash_async_thread_state_clear_reg PLNS(plcrash_async_thread_state_clear_reg) +#define plcrash_async_thread_state_clear_volatile_regs PLNS(plcrash_async_thread_state_clear_volatile_regs) +#define plcrash_async_thread_state_copy PLNS(plcrash_async_thread_state_copy) +#define plcrash_async_thread_state_current PLNS(plcrash_async_thread_state_current) +#define plcrash_async_thread_state_current_stub PLNS(plcrash_async_thread_state_current_stub) +#define plcrash_async_thread_state_get_greg_size PLNS(plcrash_async_thread_state_get_greg_size) +#define plcrash_async_thread_state_get_reg PLNS(plcrash_async_thread_state_get_reg) +#define plcrash_async_thread_state_get_reg_count PLNS(plcrash_async_thread_state_get_reg_count) +#define plcrash_async_thread_state_get_reg_name PLNS(plcrash_async_thread_state_get_reg_name) +#define plcrash_async_thread_state_get_stack_direction PLNS(plcrash_async_thread_state_get_stack_direction) +#define plcrash_async_thread_state_has_reg PLNS(plcrash_async_thread_state_has_reg) +#define plcrash_async_thread_state_init PLNS(plcrash_async_thread_state_init) +#define plcrash_async_thread_state_mach_thread_init PLNS(plcrash_async_thread_state_mach_thread_init) +#define plcrash_async_thread_state_map_dwarf_to_reg PLNS(plcrash_async_thread_state_map_dwarf_to_reg) +#define plcrash_async_thread_state_map_reg_to_dwarf PLNS(plcrash_async_thread_state_map_reg_to_dwarf) +#define plcrash_async_thread_state_mcontext_init PLNS(plcrash_async_thread_state_mcontext_init) +#define plcrash_async_thread_state_set_reg PLNS(plcrash_async_thread_state_set_reg) +#define plcrash_async_writen PLNS(plcrash_async_writen) +#define plcrash_log_writer_close PLNS(plcrash_log_writer_close) +#define plcrash_log_writer_free PLNS(plcrash_log_writer_free) +#define plcrash_log_writer_init PLNS(plcrash_log_writer_init) +#define plcrash_log_writer_set_exception PLNS(plcrash_log_writer_set_exception) +#define plcrash_log_writer_write PLNS(plcrash_log_writer_write) +#define plcrash_log_writer_set_custom_data PLNS(plcrash_log_writer_set_custom_data) +#define plcrash_nasync_image_list_append PLNS(plcrash_nasync_image_list_append) +#define plcrash_nasync_image_list_free PLNS(plcrash_nasync_image_list_free) +#define plcrash_nasync_image_list_init PLNS(plcrash_nasync_image_list_init) +#define plcrash_nasync_image_list_remove PLNS(plcrash_nasync_image_list_remove) +#define plcrash_nasync_macho_free PLNS(plcrash_nasync_macho_free) +#define plcrash_nasync_macho_init PLNS(plcrash_nasync_macho_init) +#define plcrash_populate_error PLNS(plcrash_populate_error) +#define plcrash_populate_mach_error PLNS(plcrash_populate_mach_error) +#define plcrash_populate_posix_error PLNS(plcrash_populate_posix_error) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) +#define plcrash_sysctl_int PLNS(plcrash_sysctl_int) +#define plcrash_sysctl_string PLNS(plcrash_sysctl_string) +#define plcrash_sysctl_valid_utf8_bytes PLNS(plcrash_sysctl_valid_utf8_bytes) +#define plcrash_sysctl_valid_utf8_bytes_max PLNS(plcrash_sysctl_valid_utf8_bytes_max) +#define plcrash_writer_pack PLNS(plcrash_writer_pack) +#define plframe_cursor_free PLNS(plframe_cursor_free) +#define plframe_cursor_get_reg PLNS(plframe_cursor_get_reg) +#define plframe_cursor_get_regcount PLNS(plframe_cursor_get_regcount) +#define plframe_cursor_get_regname PLNS(plframe_cursor_get_regname) +#define plframe_cursor_init PLNS(plframe_cursor_init) +#define plframe_cursor_next PLNS(plframe_cursor_next) +#define plframe_cursor_next_with_readers PLNS(plframe_cursor_next_with_readers) +#define plframe_cursor_read_compact_unwind PLNS(plframe_cursor_read_compact_unwind) +#define plframe_cursor_read_dwarf_unwind PLNS(plframe_cursor_read_dwarf_unwind) +#define plframe_cursor_read_frame_ptr PLNS(plframe_cursor_read_frame_ptr) +#define plframe_cursor_thread_init PLNS(plframe_cursor_thread_init) +#define plframe_strerror PLNS(plframe_strerror) + +#endif + +/* + * The following symbols are exported by the protobuf-c library. When building + * a shared library, we can hide these as private symbols. + * + * However, when building a static library, we can only do so if we use + * MH_OBJECT "single object prelink". The MH_OBJECT approach allows us to apply + * symbol hiding/aliasing/etc similar to that supported by dylibs, but because it is + * seemingly unused within Apple, the use thereof regularly introduces linking bugs + * and errors in new Xcode releases. + * + * Rather than fighting the linker, we use the namespacing machinery to rewrite these + * symbols, but only when explicitly compiling PLCrashReporter. Since protobuf-c is a library + * that may be used elsewhere, we don't want to rewrite these symbols if they're used + * independently by PLCrashReporter API clients. + */ +#ifdef PLCR_PRIVATE + /* If no prefix has been defined, we need to specify our own private prefix */ +# ifndef PLCRASHREPORTER_PREFIX +# define PLCRASHREPORTER_PREFIX PL_ +# endif + +# define protobuf_c_buffer_simple_append PLNS(protobuf_c_buffer_simple_append) +# define protobuf_c_empty_string PLNS(protobuf_c_empty_string) +# define protobuf_c_enum_descriptor_get_value PLNS(protobuf_c_enum_descriptor_get_value) +# define protobuf_c_enum_descriptor_get_value_by_name PLNS(protobuf_c_enum_descriptor_get_value_by_name) +# define protobuf_c_message_check PLNS(protobuf_c_message_check) +# define protobuf_c_message_descriptor_get_field PLNS(protobuf_c_message_descriptor_get_field) +# define protobuf_c_message_descriptor_get_field_by_name PLNS(protobuf_c_message_descriptor_get_field_by_name) +# define protobuf_c_message_free_unpacked PLNS(protobuf_c_message_free_unpacked) +# define protobuf_c_message_get_packed_size PLNS(protobuf_c_message_get_packed_size) +# define protobuf_c_message_init PLNS(protobuf_c_message_init) +# define protobuf_c_message_pack PLNS(protobuf_c_message_pack) +# define protobuf_c_message_pack_to_buffer PLNS(protobuf_c_message_pack_to_buffer) +# define protobuf_c_message_unpack PLNS(protobuf_c_message_unpack) +# define protobuf_c_service_descriptor_get_method_by_name PLNS(protobuf_c_service_descriptor_get_method_by_name) +# define protobuf_c_service_destroy PLNS(protobuf_c_service_destroy) +# define protobuf_c_service_generated_init PLNS(protobuf_c_service_generated_init) +# define protobuf_c_service_invoke_internal PLNS(protobuf_c_service_invoke_internal) +# define protobuf_c_version PLNS(protobuf_c_version) +# define protobuf_c_version_number PLNS(protobuf_c_version_number) +#endif /* PLCR_PRIVATE */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h new file mode 100644 index 0000000..f710c3f --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h @@ -0,0 +1,230 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_H +#define PLCRASH_REPORT_H + +#if __has_include() +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#else +#import "PLCrashReportApplicationInfo.h" +#import "PLCrashReportBinaryImageInfo.h" +#import "PLCrashReportExceptionInfo.h" +#import "PLCrashReportMachineInfo.h" +#import "PLCrashReportMachExceptionInfo.h" +#import "PLCrashReportProcessInfo.h" +#import "PLCrashReportProcessorInfo.h" +#import "PLCrashReportRegisterInfo.h" +#import "PLCrashReportSignalInfo.h" +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportSymbolInfo.h" +#import "PLCrashReportSystemInfo.h" +#import "PLCrashReportThreadInfo.h" +#endif + +/** + * @ingroup constants + * Crash file magic identifier */ +#define PLCRASH_REPORT_FILE_MAGIC "plcrash" + +/** + * @ingroup constants + * Crash format version byte identifier. Will not change outside of the introduction of + * an entirely new crash log format. */ +#define PLCRASH_REPORT_FILE_VERSION 1 + +/** + * @ingroup types + * Crash log file header format. + * + * Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC), + * followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION). + * The crash log message format itself is extensible, so this version number will only + * be incremented in the event of an incompatible encoding or format change. + */ +struct PLCrashReportFileHeader { + /** Crash log magic identifier, not NULL terminated */ + const char magic[7]; + + /** Crash log encoding/format version */ + const uint8_t version; + + /** File data */ + const uint8_t data[]; +} __attribute__((packed)); + + +/** + * @internal + * Private decoder instance variables (used to hide the underlying protobuf parser). + */ +typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; + +@interface PLCrashReport : NSObject { +@private + /** Private implementation variables (used to hide the underlying protobuf parser) */ + _PLCrashReportDecoder *_decoder; + + /** System info */ + __strong PLCrashReportSystemInfo *_systemInfo; + + /** Machine info */ + __strong PLCrashReportMachineInfo *_machineInfo; + + /** Application info */ + __strong PLCrashReportApplicationInfo *_applicationInfo; + + /** Process info */ + __strong PLCrashReportProcessInfo *_processInfo; + + /** Signal info */ + __strong PLCrashReportSignalInfo *_signalInfo; + + /** Mach exception info */ + __strong PLCrashReportMachExceptionInfo *_machExceptionInfo; + + /** Thread info (PLCrashReportThreadInfo instances) */ + __strong NSArray *_threads; + + /** Binary images (PLCrashReportBinaryImageInfo instances */ + __strong NSArray *_images; + + /** Exception information (may be nil) */ + __strong PLCrashReportExceptionInfo *_exceptionInfo; + + /** User defined information (may be nil) */ + __strong NSData *_customData; + + /** Report UUID */ + CFUUIDRef _uuid; +} + +- (id) initWithData: (NSData *) encodedData error: (NSError **) outError; + +- (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address; + +/** + * System information. + */ +@property(nonatomic, readonly, strong) PLCrashReportSystemInfo *systemInfo; + +/** + * YES if machine information is available. + */ +@property(nonatomic, readonly) BOOL hasMachineInfo; + +/** + * Machine information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachineInfo *machineInfo; + +/** + * Application information. + */ +@property(nonatomic, readonly, strong) PLCrashReportApplicationInfo *applicationInfo; + +/** + * YES if process information is available. + */ +@property(nonatomic, readonly) BOOL hasProcessInfo; + +/** + * Process information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessInfo *processInfo; + +/** + * Signal information. This provides the signal and signal code of the fatal signal. + */ +@property(nonatomic, readonly, strong) PLCrashReportSignalInfo *signalInfo; + +/** + * Mach exception information, if available. This will only be included in the + * case that encoding crash reporter's exception-based reporting was enabled, and a Mach + * exception was caught. + * + * @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this + * s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the + * Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal + * mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachExceptionInfo *machExceptionInfo; + +/** + * Thread information. Returns a list of PLCrashReportThreadInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *threads; + +/** + * Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *images; + +/** + * YES if exception information is available. + */ +@property(nonatomic, readonly) BOOL hasExceptionInfo; + +/** + * Exception information. Only available if a crash was caused by an uncaught exception, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportExceptionInfo *exceptionInfo; + +/** + * Custom user data. Only available if user explicitly assigned it before crash happened, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) NSData *customData; + +/** + * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated + * by a single client. Only available in later (v1.2+) crash report format versions. If not available, + * will be NULL. + */ +@property(nonatomic, readonly) CFUUIDRef uuidRef; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h new file mode 100644 index 0000000..787a286 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h @@ -0,0 +1,62 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportApplicationInfo : NSObject { +@private + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; +} + +- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier + applicationVersion: (NSString *) applicationVersion + applicationMarketingVersion: (NSString *) applicationMarketingVersion; + +/** + * The application identifier. This is usually the application's CFBundleIdentifier value. + */ +@property(nonatomic, readonly, strong) NSString *applicationIdentifier; + +/** + * The application version. This is usually the application's CFBundleVersion value. + */ +@property(nonatomic, readonly, strong) NSString *applicationVersion; + +/** + * The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil. + */ +@property(nonatomic, readonly, strong) NSString *applicationMarketingVersion; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h new file mode 100644 index 0000000..1a75051 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h @@ -0,0 +1,95 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportBinaryImageInfo : NSObject { +@private + /** Code type */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /** Base image address */ + uint64_t _baseAddress; + + /** Image segment size */ + uint64_t _imageSize; + + /** Name of binary image */ + __strong NSString *_imageName; + + /** If the UUID is available */ + BOOL _hasImageUUID; + + /** 128-bit object UUID. May be nil. */ + __strong NSString *_imageUUID; +} + +- (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo + baseAddress: (uint64_t) baseAddress + size: (uint64_t) imageSize + name: (NSString *) imageName + uuid: (NSData *) uuid; + +/** + * Image code type, or nil if unavailable. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *codeType; + +/** + * Image base address. + */ +@property(nonatomic, readonly) uint64_t imageBaseAddress; + +/** + * Segment size. + */ +@property(nonatomic, readonly) uint64_t imageSize; + +/** + * Image name (absolute path) + */ +@property(nonatomic, readonly, strong) NSString *imageName; + + +/** + * YES if this image has an associated UUID. + */ +@property(nonatomic, readonly) BOOL hasImageUUID; + +/** + * 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable. + */ +@property(nonatomic, readonly, strong) NSString *imageUUID; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h new file mode 100644 index 0000000..7423ca9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h @@ -0,0 +1,69 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportThreadInfo.h" +#endif + +@interface PLCrashReportExceptionInfo : NSObject { +@private + /** Name */ + __strong NSString *_name; + + /** Reason */ + __strong NSString *_reason; + + /** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */ + __strong NSArray *_stackFrames; +} + +- (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason; + +- (id) initWithExceptionName: (NSString *) name + reason: (NSString *) reason + stackFrames: (NSArray *) stackFrames; + +/** + * The exception name. + */ +@property(nonatomic, readonly, strong) NSString *exceptionName; + +/** + * The exception reason. + */ +@property(nonatomic, readonly, strong) NSString *exceptionReason; + +/* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable. + * This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h new file mode 100644 index 0000000..5cdf01b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h @@ -0,0 +1,55 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReport.h" +#endif + +/** + * A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules, + * (such as implementing text output support), and returns the result. + */ +@protocol PLCrashReportFormatter + +/** + * Format the provided @a report. + * + * @param report Report to be formatted. + * @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error + * object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will + * be left unmodified. You may specify nil for this parameter, and no error information will be provided. + * + * @return Returns the formatted report data on success, or nil on failure. + */ +- (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h new file mode 100644 index 0000000..19461a5 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h @@ -0,0 +1,48 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportMachExceptionInfo : NSObject { +@private + /** The Mach exception type. */ + uint64_t _type; + + /** The Mach exception codes, represented as an ordered array of NSNumber instances. */ + __strong NSArray *_codes; +} + +- (id) initWithType: (uint64_t) type codes: (NSArray *) codes; + +/** The Mach exception type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */ +@property(nonatomic, readonly, strong) NSArray *codes; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h new file mode 100644 index 0000000..ab6fee9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h @@ -0,0 +1,77 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportMachineInfo : NSObject { +@private + /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ + __strong NSString *_modelName; + + /** The processor type. */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /* The number of actual physical processor cores. */ + NSUInteger _processorCount; + + /* The number of logical processors. */ + NSUInteger _logicalProcessorCount; +} + +- (id) initWithModelName: (NSString *) modelName + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + processorCount: (NSUInteger) processorCount + logicalProcessorCount: (NSUInteger) logicalProcessorCount; + +/** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *modelName; + +/** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +/* + * The number of actual physical processor cores. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger processorCount; + +/* + * The number of logical processors. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger logicalProcessorCount; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h new file mode 100644 index 0000000..802e8d4 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h @@ -0,0 +1,103 @@ +/* + * Author: Damian Morris + * + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportProcessInfo : NSObject { +@private + /** Process name, or nil if unavailable. */ + __strong NSString *_processName; + + /** Process ID */ + NSUInteger _processID; + + /** Process path */ + __strong NSString* _processPath; + + /** Date and time that the crashing process was started. This may be unavailable, and this property + * will be nil. */ + __strong NSDate *_processStartTime; + + /** Parent process name, or nil if unavailable. */ + __strong NSString *_parentProcessName; + + /** Parent process ID */ + NSUInteger _parentProcessID; + + /** If false, the process is being run via process-level CPU emulation (such as Rosetta). */ + BOOL _native; +} + +- (id) initWithProcessName: (NSString *) processName + processID: (NSUInteger) processID + processPath: (NSString *) processPath + processStartTime: (NSDate *) processStartTime + parentProcessName: (NSString *) parentProcessName + parentProcessID: (NSUInteger) parentProcessID + native: (BOOL) native; + +/** + * The process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processName; + +/** + * The process ID. + */ +@property(nonatomic, readonly) NSUInteger processID; + +/** + * The path to the process executable. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processPath; + +/** + * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSDate *processStartTime; + +/** + * The parent process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *parentProcessName; + +/** + * The parent process ID. + */ +@property(nonatomic, readonly) NSUInteger parentProcessID; + +/** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */ +@property(nonatomic, readonly) BOOL native; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h new file mode 100644 index 0000000..03d570b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h @@ -0,0 +1,74 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +/** + * @ingroup constants + * + * The type encodings supported for CPU types and subtypes. Currently only Apple + * Mach-O defined encodings are supported. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Unknown cpu type encoding. */ + PLCrashReportProcessorTypeEncodingUnknown = 0, + + /** Apple Mach-defined processor types. */ + PLCrashReportProcessorTypeEncodingMach = 1 +} PLCrashReportProcessorTypeEncoding; + +@interface PLCrashReportProcessorInfo : NSObject { +@private + /** Type encoding */ + PLCrashReportProcessorTypeEncoding _typeEncoding; + + /** CPU type */ + uint64_t _type; + + /** CPU subtype */ + uint64_t _subtype; +} + +- (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding + type: (uint64_t) type + subtype: (uint64_t) subtype; + +/** The CPU type encoding. */ +@property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding; + +/** The CPU type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The CPU subtype. */ +@property(nonatomic, readonly) uint64_t subtype; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h new file mode 100644 index 0000000..e0a1ca1 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportRegisterInfo : NSObject { +@private + /** Register name */ + __strong NSString *_registerName; + + /** Register value */ + uint64_t _registerValue; +} + +- (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; + +/** + * Register name. + */ +@property(nonatomic, readonly, strong) NSString *registerName; + +/** + * Register value. + */ +@property(nonatomic, readonly) uint64_t registerValue; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h new file mode 100644 index 0000000..d949211 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h @@ -0,0 +1,60 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSignalInfo : NSObject { +@private + /** Signal name */ + __strong NSString *_name; + + /** Signal code */ + __strong NSString *_code; + + /** Fauling instruction or address */ + uint64_t _address; +} + +- (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address; + +/** + * The signal name. + */ +@property(nonatomic, readonly, strong) NSString *name; + +/** + * The signal code. + */ +@property(nonatomic, readonly, strong) NSString *code; + +/** + * The faulting instruction or address. + */ +@property(nonatomic, readonly) uint64_t address; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000..5fd4acc --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,57 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportSymbolInfo.h" +#endif + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + __strong PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000..bdb367c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + __strong NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly, strong) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h new file mode 100644 index 0000000..eb8a447 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h @@ -0,0 +1,177 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashMacros.h" +#endif + +@class PLCrashReportProcessorInfo; + +/** + * @ingroup constants + * + * Indicates the Operating System under which a Crash Log was generated. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Mac OS X. */ + PLCrashReportOperatingSystemMacOSX = 0, + + /** iPhone OS */ + PLCrashReportOperatingSystemiPhoneOS = 1, + + /** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */ + PLCrashReportOperatingSystemiPhoneSimulator = 2, + + /** Unknown operating system */ + PLCrashReportOperatingSystemUnknown = 3, + + /** Apple tvOS */ + PLCrashReportOperatingSystemAppleTVOS = 4, + +} PLCrashReportOperatingSystem; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** + * @ingroup constants + * + * Indicates the architecture under which a Crash Log was generated. + * + * @note The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * will make use of the new PLCrashReportProcessorInfo CPU type encodings. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** x86-32. */ + PLCrashReportArchitectureX86_32 = 0, + + /** x86-64 */ + PLCrashReportArchitectureX86_64 = 1, + + /** ARMv6 */ + PLCrashReportArchitectureARMv6 = 2, + + /** + * ARMv6 + * @deprecated This value has been deprecated in favor of ARM subtype-specific + * values. + * @sa PLCrashReportArchitectureARMv6 + */ + PLCrashReportArchitectureARM PLCR_DEPRECATED = PLCrashReportArchitectureARMv6, + + /** PPC */ + PLCrashReportArchitecturePPC = 3, + + /** PPC64 */ + PLCrashReportArchitecturePPC64 = 4, + + /** ARMv7 */ + PLCrashReportArchitectureARMv7 = 5, + + /** Unknown */ + PLCrashReportArchitectureUnknown = 6 +} PLCrashReportArchitecture; +#pragma clang diagnostic pop + +extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); +extern PLCrashReportArchitecture PLCrashReportHostArchitecture PLCR_EXTERNAL_DEPRECATED; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); + +@interface PLCrashReportSystemInfo : NSObject { +@private + /** Operating system */ + PLCrashReportOperatingSystem _operatingSystem; + + /** Operating system version */ + __strong NSString *_osVersion; + + /** OS build. May be nil. */ + __strong NSString *_osBuild; + + /** Architecture */ + PLCrashReportArchitecture _architecture; + + /** Date crash report was generated. May be nil if the date is unknown. */ + __strong NSDate *_timestamp; + + /** Processor information. */ + __strong PLCrashReportProcessorInfo *_processorInfo; +} + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + timestamp: (NSDate *) timestamp; + +/** The operating system. */ +@property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem; + +/** The operating system's release version. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemVersion; + +/** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemBuild; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo + * extensible encoding. */ +@property(nonatomic, readonly) PLCrashReportArchitecture architecture PLCR_DEPRECATED; + +/** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSDate *timestamp; + +/** The processor type. For v1.2 reports and later, this is an alias to the machine info's processorInfo. + * For earlier reports, this will be synthesized from the deprecated architecture property. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h new file mode 100644 index 0000000..adbc251 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h @@ -0,0 +1,66 @@ +/* + * Authors: + * Landon Fuller + * Damian Morris + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportFormatter.h" +#endif + +/** + * Supported text output formats. + * + * @ingroup enums + */ +typedef enum { + /** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available + * through iTunes Connect. */ + PLCrashReportTextFormatiOS = 0 +} PLCrashReportTextFormat; + + +@interface PLCrashReportTextFormatter : NSObject { +@private + /** Text output format. */ + PLCrashReportTextFormat _textFormat; + + /** Encoding to use for string output. */ + NSStringEncoding _stringEncoding; +} + ++ (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat; + +- (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h new file mode 100644 index 0000000..b9092e2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h @@ -0,0 +1,88 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_THREAD_INFO_H +#define PLCRASH_REPORT_THREAD_INFO_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportRegisterInfo.h" +#endif + + +@interface PLCrashReportThreadInfo : NSObject { +@private + /** The thread number. Should be unique within a given crash log. */ + NSInteger _threadNumber; + + /** Ordered list of PLCrashReportStackFrame instances */ + __strong NSArray *_stackFrames; + + /** YES if this thread crashed. */ + BOOL _crashed; + + /** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */ + __strong NSArray *_registers; +} + +- (id) initWithThreadNumber: (NSInteger) threadNumber + stackFrames: (NSArray *) stackFrames + crashed: (BOOL) crashed + registers: (NSArray *) registers; + +/** + * Application thread number. + */ +@property(nonatomic, readonly) NSInteger threadNumber; + +/** + * Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances. + * The array is ordered, last callee to first. + */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +/** + * If this thread crashed, set to YES. + */ +@property(nonatomic, readonly) BOOL crashed; + +/** + * State of the general purpose and related registers, as a list of + * PLCrashReportRegister instances. If this thead did not crash (crashed returns NO), + * this list will be empty. + */ +@property(nonatomic, readonly, strong) NSArray *registers; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h new file mode 100644 index 0000000..bdc8f83 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h @@ -0,0 +1,159 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +#ifndef PLCRASH_REPORTER_H +#define PLCRASH_REPORTER_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReporterConfig.h" +#import "PLCrashMacros.h" +#endif + +@class PLCrashMachExceptionServer; +@class PLCrashMachExceptionPortSet; + +/** + * @ingroup functions + * + * Prototype of a callback function used to execute additional user code with signal information as provided + * by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk. + * + * @param info The signal info. + * @param uap The crash's threads context. + * @param context The API client's supplied context value. + * + * @sa The @ref async_safety documentation. + * @sa PLCrashReporter::setPostCrashCallbacks: + */ +typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context); + +/** + * @ingroup types + * + * This structure contains callbacks supported by PLCrashReporter to allow the host application to perform + * additional tasks prior to program termination after a crash has occurred. + * + * @sa The @ref async_safety documentation. + */ +typedef struct PLCrashReporterCallbacks { + /** The version number of this structure. If not one of the defined version numbers for this type, the behavior + * is undefined. The current version of this structure is 0. */ + uint16_t version; + + /** An arbitrary user-supplied context value. This value may be NULL. */ + void *context; + + /** + * The callback used to report caught signal information. In version 0 of this structure, all crashes will be + * reported via this function. + * + * @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived + * from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via + * PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will + * not provide valid thread state. + * + * This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained + * here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions. + */ + PLCrashReporterPostCrashSignalCallback handleSignal; +} PLCrashReporterCallbacks; + +@interface PLCrashReporter : NSObject { +@private + /** Reporter configuration */ + __strong PLCrashReporterConfig *_config; + + /** YES if the crash reporter has been enabled */ + BOOL _enabled; + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if + * the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */ + __strong PLCrashMachExceptionServer *_machServer; + + /** Previously registered Mach exception ports, if any. */ + __strong PLCrashMachExceptionPortSet *_previousMachPorts; +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ + + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; + + /** Path to the crash reporter internal data directory */ + __strong NSString *_crashReportDirectory; +} + ++ (PLCrashReporter *) sharedReporter PLCR_DEPRECATED; + +- (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config; + +- (BOOL) hasPendingCrashReport; + +- (NSData *) loadPendingCrashReportData; +- (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; + +- (NSData *) generateLiveReportWithThread: (thread_t) thread; +- (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; +- (NSData *) generateLiveReportWithThread: (thread_t) thread exception: (NSException *) exception error: (NSError **) outError; + +- (NSData *) generateLiveReport; +- (NSData *) generateLiveReportAndReturnError: (NSError **) outError; +- (NSData *) generateLiveReportWithException: (NSException *) exception error: (NSError **) outError; + +- (BOOL) purgePendingCrashReport; +- (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; + +- (BOOL) enableCrashReporter; +- (BOOL) enableCrashReporterAndReturnError: (NSError **) outError; + +- (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks; + +/** + * Return the path to live crash report (which may not yet, or ever, exist). + */ +- (NSString *) crashReportPath; + +/** + * Custom data to save in the crash report. + */ +@property(nonatomic, strong) NSData *customData; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h new file mode 100644 index 0000000..f151e56 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h @@ -0,0 +1,197 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashFeatureConfig.h" +#endif + +/** + * @ingroup enums + * Supported mechanisms for trapping and handling crashes. + */ +typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) { + /** + * Trap fatal signals via a sigaction(2)-registered BSD signal handler. + * + * PLCrashReporter's signal handler will supersede previously registered handlers; existing + * handlers will not be called. This behavior may be modified in a future release, and should + * not be relied upon as a mechanism to prevent existing signal handlers from being called. + * + * There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically: + * + * - On Mac OS X, stack overflows will only be handled on the thread on which + * the crash reporter was initialized. This should generally be the main thread. + * - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being + * non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS). + * - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting + * in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal + * handlers prior to raising SIGABRT). These __abort()-based checks are: + * - Implemented for unsafe memcpy/strcpy/snprintf C functions. + * - Only enabled when operating on a fixed-width target buffer (in which case the + * compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument). + * - Only trigger in the case that the source data exceeds the size of the fixed width target + * buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy), + * or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer), + * AND that argument can't be checked at compile-time. + */ + PLCrashReporterSignalHandlerTypeBSD = 0, + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** + * Trap fatal signals via a Mach exception server. + * + * If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that + * exception handler. Should the exceptions be handled by an existing handler, no report will be generated + * by PLCrashReporter. + * + * @par Mac OS X + * + * On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note, + * however, that some kernel-internal constants, as well as architecture-specific trap information, + * may be required to fully interpret a Mach exception's root cause. + * + * @par iOS + * + * On iOS, the APIs required for a complete implementation are not fully public. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included + * Mach exception handling as an optional feature, with both build-time and runtime configuration + * to disable its inclusion or use, respectively. + * + * @par Debugger Incompatibility + * + * The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to + * suspend all active threads (which will include the Mach exception handler). Mach-based handling + * should not be used when a debugger is attached. + * + * @par More Details + * + * For more information, refer to @ref mach_exceptions. + */ + PLCrashReporterSignalHandlerTypeMach = 1 +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ +}; + +/** + * @ingroup enums + * Supported mechanisms for performing local symbolication. + * + * Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may + * return information that is incorrect. This may still be useful in the case where DWARF data is unavailable + * for a given build; in that case, it can provide function and method names (though not line numbers) for a + * crash report that may otherwise be unusable. + * + * Note, however, this comes at the cost of a significant increase in code that must run within the critical + * crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In + * addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may + * change in future iOS releases. Given that DWARF symbolication data will always be more accurate, and + * the risks inherent in executing considerably more code at crash time, it is strongly recommended that local + * symbolication only be enabled for non-release builds. + * + * Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the + * results. + */ +typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) { + /** No symbolication. */ + PLCrashReporterSymbolicationStrategyNone = 0, + + /** + * Use the standard binary symbol table. On iOS, this alone will return + * incomplete results, as most symbols are rewritten to the common '\' string. + */ + PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0, + + /** + * Use Objective-C metadata to find method and class names. This relies on detailed parsing + * of the Objective-C runtime data, including undefined flags and other runtime internals. As such, + * it may return incorrect data should the runtime be changed incompatibly. + */ + PLCrashReporterSymbolicationStrategyObjC = 1 << 1, + + /** + * Enable all available symbolication strategies. + */ + PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC) +}; + +@interface PLCrashReporterConfig : NSObject { +@private + /** The configured signal handler type. */ + PLCrashReporterSignalHandlerType _signalHandlerType; + + /** The configured symbolication strategy. */ + PLCrashReporterSymbolicationStrategy _symbolicationStrategy; + + /** + * Flag indicating if the uncaughtExceptionHandler should be initialized or not. It usually is, except in a + * Xamarin environment. + */ + BOOL _shouldRegisterUncaughtExceptionHandler; +} + ++ (instancetype) defaultConfiguration; + +- (instancetype) init; + +- (instancetype) initWithBasePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + basePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler + basePath: (NSString *) basePath; + +/** The base path to save the crash data. */ +@property(nonatomic, readonly) NSString *basePath; + +/** The configured signal handler type. */ +@property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType; + +/** The configured symbolication strategy. */ +@property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy; + +/** Should PLCrashReporter regiser an uncaught exception handler? This is entended to be used in Xamarin apps */ +@property(nonatomic, readonly) BOOL shouldRegisterUncaughtExceptionHandler; + +@end + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Modules/module.modulemap b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..4fa4304 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module CrashReporter { + umbrella header "CrashReporter.h" + + export * + module * { export * } + + link framework "Foundation" +} diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Resources/Info.plist b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..3ce348a --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,52 @@ + + + + + BuildMachineOSBuild + 21G531 + CFBundleDevelopmentRegion + English + CFBundleExecutable + CrashReporter + CFBundleIdentifier + com.microsoft.CrashReporter + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CrashReporter + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.11.1 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1.11.1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 13C100 + DTPlatformName + macosx + DTPlatformVersion + 12.1 + DTSDKBuild + 21C46 + DTSDKName + macosx12.1 + DTXcode + 1321 + DTXcodeBuild + 13C100 + LSMinimumSystemVersion + 10.15 + UIDeviceFamily + + 2 + + + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/CrashReporter b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/CrashReporter new file mode 100644 index 0000000..42827e4 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/CrashReporter differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/CrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/CrashReporter.h new file mode 100644 index 0000000..99878d3 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/CrashReporter.h @@ -0,0 +1,366 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifdef __APPLE__ +#import +#endif + +#if __has_include() + +// This must be included before any other PLCrashReporter includes, as +// it redefines symbol names +#import + +/* Library Imports */ +#import +#import +#import +#else +#import "PLCrashNamespace.h" +#import "PLCrashReporter.h" +#import "PLCrashReport.h" +#import "PLCrashReportTextFormatter.h" +#endif + +/** + * @defgroup functions Crash Reporter Functions Reference + */ + +/** + * @defgroup types Crash Reporter Data Types Reference + */ + +/** + * @defgroup constants Crash Reporter Constants Reference + */ + +/** + * @internal + * @defgroup plcrash_internal Crash Reporter Internal Documentation + */ + +/** + * @defgroup enums Enumerations + * @ingroup constants + */ + +/** + * @defgroup globals Global Variables + * @ingroup constants + */ + +/** + * @defgroup exceptions Exceptions + * @ingroup constants + */ + +/* Exceptions */ +extern NSString *PLCrashReporterException; + +/* Error Domain and Codes */ +extern NSString *PLCrashReporterErrorDomain; + +/** + * NSError codes in the Plausible Crash Reporter error domain. + * @ingroup enums + */ +typedef enum { + /** An unknown error has occured. If this + * code is received, it is a bug, and should be reported. */ + PLCrashReporterErrorUnknown = 0, + + /** An Mach or POSIX operating system error has occured. The underlying NSError cause may be fetched from the userInfo + * dictionary using the NSUnderlyingErrorKey key. */ + PLCrashReporterErrorOperatingSystem = 1, + + /** The crash report log file is corrupt or invalid */ + PLCrashReporterErrorCrashReportInvalid = 2, + + /** An attempt to use a resource which was in use at the time in a manner which would have conflicted with the request. */ + PLCrashReporterErrorResourceBusy = 3 +} PLCrashReporterError; + +/** + * @mainpage Plausible Crash Reporter + * + * @section intro_sec Introduction + * + * Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X. + * + * The following features are supported: + * + * - Implemented as an in-process signal handler. + * - Does not interfer with debugging in gdb.. + * - Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc). + * - Full thread state for all active threads (backtraces, register dumps) is provided. + * + * If your application crashes, a crash report will be written. When the application is next run, you may check for a + * pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the + * report locally. + * + * @section intro_encoding Crash Report Format + * + * Crash logs are encoded using google protobuf, and may be decoded + * using the provided PLCrashReport API. Additionally, the include plcrashutil handles conversion of binary crash reports to the + * symbolicate-compatible iPhone text format. + * + * @section doc_sections Documentation Sections + * - @subpage example_usage_iphone + * - @subpage error_handling + * - @subpage async_safety + */ + +/** + * @page example_usage_iphone Example iPhone Usage + * + * @code + * // + * // Called to handle a pending crash report. + * // + * - (void) handleCrashReport { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSData *crashData; + * NSError *error; + * + * // Try loading the crash report + * crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error]; + * if (crashData == nil) { + * NSLog(@"Could not load crash report: %@", error); + * goto finish; + * } + * + * // We could send the report from here, but we'll just print out + * // some debugging info instead + * PLCrashReport *report = [[[PLCrashReport alloc] initWithData: crashData error: &error] autorelease]; + * if (report == nil) { + * NSLog(@"Could not parse crash report"); + * goto finish; + * } + * + * NSLog(@"Crashed on %@", report.systemInfo.timestamp); + * NSLog(@"Crashed with signal %@ (code %@, address=0x%" PRIx64 ")", report.signalInfo.name, + * report.signalInfo.code, report.signalInfo.address); + * + * // Purge the report + * finish: + * [crashReporter purgePendingCrashReport]; + * return; + * } + * + * // from UIApplicationDelegate protocol + * - (void) applicationDidFinishLaunching: (UIApplication *) application { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSError *error; + * + * // Check if we previously crashed + * if ([crashReporter hasPendingCrashReport]) + * [self handleCrashReport]; + + * // Enable the Crash Reporter + * if (![crashReporter enableCrashReporterAndReturnError: &error]) + * NSLog(@"Warning: Could not enable crash reporter: %@", error); + * + * } + * @endcode + * + */ + +/** + * @page error_handling Error Handling Programming Guide + * + * Where a method may return an error, Plausible Crash Reporter provides access to the underlying + * cause via an optional NSError argument. + * + * All returned errors will be a member of one of the below defined domains, however, new domains and + * error codes may be added at any time. If you do not wish to report on the error cause, many methods + * support a simple form that requires no NSError argument. + * + * @section error_domains Error Domains, Codes, and User Info + * + * @subsection crashreporter_errors Crash Reporter Errors + * + * Any errors in Plausible Crash Reporter use the #PLCrashReporterErrorDomain error domain, and and one + * of the error codes defined in #PLCrashReporterError. + */ + +/** + * @page async_safety Async-Safe Programming Guide + * + * Plausible CrashReporter provides support for executing an application specified function in the context of the + * crash reporter's signal handler, after the crash report has been written to disk. This was a regularly requested + * feature, and provides the ability to implement application finalization in the event of a crash. However, writing + * code intended for execution inside of a signal handler is exceptionally difficult, and is not recommended. + * + * @section program_flow Program Flow and Signal Handlers + * + * When the signal handler is called the normal flow of the program is interrupted, and your program is an unknown + * state. Locks may be held, the heap may be corrupt (or in the process of being updated), and your signal + * handler may invoke a function that was being executed at the time of the signal. This may result in deadlocks, + * data corruption, and program termination. + * + * @section functions Async-Safe Functions + * + * A subset of functions are defined to be async-safe by the OS, and are safely callable from within a signal handler. If + * you do implement a custom post-crash handler, it must be async-safe. A table of POSIX-defined async-safe functions + * and additional information is available from the + * CERT programming guide - SIG30-C + * + * Most notably, the Objective-C runtime itself is not async-safe, and Objective-C may not be used within a signal + * handler. + * + * @sa PLCrashReporter::setCrashCallbacks: + */ + +/** + * @page mach_exceptions Mach Exceptions on Mac OS X and iOS + * + * PLCrashReporter includes support for monitoring crashes via an in-process Mach exception handler. There are a small + * number of crash cases that will not be caught with via a POSIX signal handler, but can be caught via a Mach + * exception handler: + * + * - Stack overflow. sigaltstack() is broken in later iOS releases, and even if functional, must be configured + * on a per-thread basis. + * - Internal Apple assertions that call libSystem's __assert. These include compiler-checked constraints + * for built-in functions, such as strcpy_chk(). The __abort() implementation actually disables the SIGABRT + * signal handler (resetting it to SIG_DFL) prior to to issueing a SIGABRT, bypassing signal-based crash + * reporters entirely. + * + * Unfortunately, the latter issue (__assert) can not be handled on iOS; trapping abort requires that + * a Mach exception handler operate out-of-process, which is impossible on iOS. On Mac OS X, this will + * only be handled once we've implemented fully out-of-process crash excution. + * + * On Mac OS X, the Mach exception implementation is fully supported using entirely public API. On iOS, + * the APIs required are not fully public -- more details on the implications of this for exception handling on + * iOS may be found in @ref mach_exceptions_ios below. It is worth noting that even where the Mach exception APIs + * are fully supported, kernel-internal constants, as well + * as architecture-specific trap information, may be required to fully interpret a Mach exception's root cause. + * + * For example, the EXC_SOFTWARE exception is dispatched for four different failure types, using the exception + * code to differentiate failure types: + * - Non-existent system call invoked (SIGSYS) + * - Write on a pipe with no reader (SIGPIPE) + * - Abort program (SIGABRT -- unused) + * - Kill program (SIGKILL) + * + * Of those four types, only the constant required to interpret the SIGKILL behavior (EXC_SOFT_SIGNAL) is publicly defined. + * Of the remaining three failure types, the constant values are kernel implementation-private, defined only in the available + * kernel sources. On iOS, these sources are unavailable, and while they generally do match the Mac OS X implementation, there + * are no gaurantees that this is -- or will remain -- the case in the future. + * + * Likewise, interpretation of particular fault types requires information regarding the underlying machine traps + * that triggered the Mach exceptions. For example, a floating point trap on x86/x86-64 will trigger an EXC_ARITHMETIC, + * with a subcode value containing the value of the FPU status register. Determining the exact FPU cause requires + * extracting the actual exception flags from status register as per the x86 architecture documentation. The exact format + * of this subcode value is not actually documented outside the kernel, and may change in future releases. + * + * While we have the advantage of access to the x86 kernel sources, the situation on ARM is even less clear. The actual + * use of the Mach exception codes and subcodes is largely undefined by both headers and publicly available documentation, + * and the available x86 kernel sources are of little use in interpreting this data. + * + * As such, while Mach exceptions may catch some cases that BSD signals can not, they are not a perfect solution, + * and may also provide less insight into the actual failures that occur. By comparison, the BSD signal interface + * is both fully defined and architecture independent, with any necessary interpretation of the Mach exception + * codes handled in-kernel at the time of exception dispatch. It is generally recommended by Apple as the preferred + * interface, and should generally be preferred by PLCrashReporter API clients. + * + * @section mach_exceptions_compatibility Compatibility Issues + * + * @subsection Debuggers + * + * Enabling in-process Mach exception handlers will conflict with any attached debuggers; the debugger + * may suspend the processes Mach exception handling thread, which will result in any exception messages + * sent via the debugger being lost, as the in-process handler will be unable to receive and forward + * the messages. + * + * @subsection Managed Runtimes (Xamarin, Unity) + * + * A Mach exception handler may conflict with any managed runtime that registers a BSD signal handler that + * can safely handle otherwise fatal signals, allowing execution to proceed. This includes products + * such as Xamarin for iOS. + * + * In such a case, PLCrashReporter will write a crash report for non-fatal signals, as there is no + * immediate mechanism for determining whether a signal handler exists and that it can safely + * handle the failure. This can result in unexpected delays in application execution, increased I/O to + * disk, and other undesirable operations. + * + * @section mach_exceptions_ios Mach Exceptions on iOS + * + * The APIs required for Mach exception handling are not fully public on iOS. After filing a request with + * Apple DTS to clarify the status of the Mach exception APIs on iOS, and implementing a Mach Exception + * handler using only supported API, they provided the following guidance: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited undefined API on iOS. The reporter + * may be excluded entirely at build time by modifying the PLCRASH_FEATURE_MACH_EXCEPTIONS build configuration; it + * may also be disabled at runtime by configuring the PLCrashReporter instance appropriately via PLCrashReporterConfig. + * + * The iOS implementation is implemented almost entirely using public API, and links against no actual private symbols; + * the use of undocumented functionality is limited to assuming the use of specific msgh_id values (see below + * for details). As a result, it may be considered perfectly safe to include the Mach Exception code in the + * standard build, and enable/disable it at runtime. + * + * The following issues exist in the iOS implementation: + * - The msgh_id values required for an exception reply message are not available from the available + * headers and must be hard-coded. This prevents one from safely replying to exception messages, which + * means that it is impossible to (correctly) inform the server that an exception has *not* been + * handled. + * + * Impact: + * This can lead to the process locking up and not dispatching to the host exception handler (eg, Apple's + * crash reporter), depending on the behavior of the kernel exception code. + * + * - The mach_* structure/type variants required by MACH_EXCEPTION_CODES are not publicly defined (on Mac OS X, + * these are provided by mach_exc.defs). This prevents one from forwarding exception messages to an existing + * handler that was registered with a MACH_EXCEPTION_CODES behavior (eg, forwarding is entirely non-functional + * on ARM64 devices). + * + * Impact: + * This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES, + * including other handlers registered within the current process, eg, by a managed runtime. This could + * also result in misinterpretation of a Mach exception message, in the case where the message format is + * modified by Apple to be incompatible with the existing 32-bit format. + * + * This is the case with LLDB; it will register a task exception handler with MACH_EXCEPTION_CODES set. Failure + * to correctly forward these exceptions will result in the debugger breaking in interesting ways; for example, + * changes to the set of dyld-loaded images are detected by setting a breakpoint on the dyld image registration + * funtions, and this functionality will break if the exception is not correctly forwarded. + * + * Since Mach exception handling is important for a fully functional crash reporter, we have also filed a radar + * to request that the API be made public: + * Radar: rdar://12939497 RFE: Provide mach_exc.defs for iOS + * + * At the time of this writing, the radar remains open/unresolved. + */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashFeatureConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashFeatureConfig.h new file mode 100644 index 0000000..7bcaebf --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashFeatureConfig.h @@ -0,0 +1,108 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_FEATURE_CONFIG_H +#define PLCRASH_FEATURE_CONFIG_H + +#include + +/** + * @internal + * + * Build-time configuration for PLCrashReporter. + * + * This is used to automatically enable/disable features on a per-platform and per-configuration + * basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter. + * + * @defgroup build_config Build Configuration + * @ingroup constants + * @{ + */ + +/* + * Defaults + */ + +/* + * For release builds, disable unused unwind implementations on targets that do not use them. For non-release + * builds, we include the unwind implementations to allow testing on a broader range of targets. + */ +#ifdef PLCF_RELEASE_BUILD +# if defined(__arm__) +# ifndef PLCRASH_FEATURE_UNWIND_DWARF +# define PLCRASH_FEATURE_UNWIND_DWARF 0 +# endif +# ifndef PLCRASH_FEATURE_UNWIND_COMPACT +# define PLCRASH_FEATURE_UNWIND_COMPACT 0 +# endif +# endif +#endif + +/* + * Configuration Flags + */ + + +#ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS +/** + * If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported, + * using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a + * popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either + * they've received special dispensation to use private APIs / private structures, they've found another way to do + * it, or they're just using undocumented functionality and hoping for the best. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled + * Mach exception handling by default, and provided both build-time and runtime configuration + * to disable its use. + * + * For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions. + */ +#if TARGET_OS_TV +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 0 +#else +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 1 +#endif +#endif + +#ifndef PLCRASH_FEATURE_UNWIND_DWARF +/** If true, enable DWARF unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_DWARF 1 +#endif + + +#ifndef PLCRASH_FEATURE_UNWIND_COMPACT +/** If true, enable compact unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_COMPACT 1 +#endif + +/* + * @} + */ + +#endif /* PLCRASH_FEATURE_CONFIG_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashMacros.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashMacros.h new file mode 100644 index 0000000..556e1c2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashMacros.h @@ -0,0 +1,143 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_CONSTANTS_H +#define PLCRASH_CONSTANTS_H + +#include +#include + +#if defined(__cplusplus) +# define PLCR_EXPORT extern "C" +# define PLCR_C_BEGIN_DECLS extern "C" { +# define PLCR_C_END_DECLS } +#else +# define PLCR_EXPORT extern +# define PLCR_C_BEGIN_DECLS +# define PLCR_C_END_DECLS +#endif + +#if defined(__cplusplus) +# define NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ +# define IS_EMPTY_(name) defined(NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ ## name) +# define IS_EMPTY(name) IS_EMPTY_(name) +# if defined(PLCRASHREPORTER_PREFIX) && !IS_EMPTY(PLCRASHREPORTER_PREFIX) + /** @internal Define the plcrash namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ +# define PLCR_CPP_BEGIN_NS namespace plcrash { inline namespace PLCRASHREPORTER_PREFIX { + + /** @internal Close the definition of the `plcrash` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ +# define PLCR_CPP_END_NS }} +# else +# define PLCR_CPP_BEGIN_NS namespace plcrash { +# define PLCR_CPP_END_NS } +# endif +#endif + +#ifdef __clang__ +# define PLCR_PRAGMA_CLANG(_p) _Pragma(_p) +#else +# define PLCR_PRAGMA_CLANG(_p) +#endif + +#ifdef __clang__ +# define PLCR_DEPRECATED __attribute__((deprecated)) +#else +# define PLCR_DEPRECATED +#endif + +#if defined(__clang__) || defined(__GNUC__) +# define PLCR_UNUSED __attribute__((unused)) +#else +# define PLCR_UNUSED +#endif + +#ifdef PLCR_PRIVATE +/** + * Marks a definition as deprecated only for for external clients, allowing + * uses of it internal fo the framework. + */ +# define PLCR_EXTERNAL_DEPRECATED + +/** + * @internal + * A macro to put above a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() \ + PLCR_PRAGMA_CLANG("clang diagnostic push"); \ + PLCR_PRAGMA_CLANG("clang diagnostic ignored \"-Wdocumentation-deprecated-sync\"") + +/** + * @internal + * A macro to put below a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_POP() PLCR_PRAGMA_CLANG("clang diagnostic pop") + +#else + +# define PLCR_EXTERNAL_DEPRECATED PLCR_DEPRECATED +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() + +#endif /* PLCR_PRIVATE */ + +#ifdef PLCR_PRIVATE +# if defined(__clang__) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") +# define PLCR_FALLTHROUGH [[clang::fallthrough]] +# else +# define PLCR_FALLTHROUGH do {} while (0) +# endif +#endif + +#ifdef PLCR_PRIVATE +/** + * @internal + * Static compile-time assertion. + * + * @param name The assertion name; must be valid for use within a C identifier. + * @param cond Assertion condition + */ +# define PLCR_ASSERT_STATIC(name, cond) PLCR_ASSERT_STATIC_(name, cond, __LINE__) +/* + * C++11 and C11 both provide a static_assert(). + * + * Otherwise, we have to use typedef-based static assertions. + */ +# if (defined(__cplusplus) && __cplusplus >= 201103L) || (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(#name, cond) +# define PLCR_ASSERT_STATIC__(name, cond) static_assert(cond, #name) +# else +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(name, cond, line) +# define PLCR_ASSERT_STATIC__(name, cond, line) typedef int plcf_static_assert_##name##_##line [(cond) ? 1 : -1] PLCR_UNUSED +# endif +#endif /* PLCR_PRIVATE */ + +#endif /* PLCRASH_CONSTANTS_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashNamespace.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashNamespace.h new file mode 100644 index 0000000..f4c263c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashNamespace.h @@ -0,0 +1,320 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +// #define PLCRASHREPORTER_PREFIX AcmeCo + + +// We need two extra layers of indirection to make CPP substitute +// the PLCRASHREPORTER_PREFIX define. +#define PLNS_impl2(prefix, symbol) prefix ## symbol +#define PLNS_impl(prefix, symbol) PLNS_impl2(prefix, symbol) +#define PLNS(symbol) PLNS_impl(PLCRASHREPORTER_PREFIX, symbol) + + +/* + * Rewrite all ObjC/C symbols. + * + * For C++ symbol handling, refer to the PLCR_CPP_BEGIN_NS and PLCR_CPP_END_NS + * macros. + */ +#ifdef PLCRASHREPORTER_PREFIX + +/* Objective-C Classes */ +#define PLCrashMachExceptionServer PLNS(PLCrashMachExceptionServer) +#define PLCrashReport PLNS(PLCrashReport) +#define PLCrashReportApplicationInfo PLNS(PLCrashReportApplicationInfo) +#define PLCrashReportBinaryImageInfo PLNS(PLCrashReportBinaryImageInfo) +#define PLCrashReportExceptionInfo PLNS(PLCrashReportExceptionInfo) +#define PLCrashReportMachExceptionInfo PLNS(PLCrashReportMachExceptionInfo) +#define PLCrashReportMachineInfo PLNS(PLCrashReportMachineInfo) +#define PLCrashReportProcessInfo PLNS(PLCrashReportProcessInfo) +#define PLCrashReportProcessorInfo PLNS(PLCrashReportProcessorInfo) +#define PLCrashReportRegisterInfo PLNS(PLCrashReportRegisterInfo) +#define PLCrashReportSignalInfo PLNS(PLCrashReportSignalInfo) +#define PLCrashReportStackFrameInfo PLNS(PLCrashReportStackFrameInfo) +#define PLCrashReportSymbolInfo PLNS(PLCrashReportSymbolInfo) +#define PLCrashReportSystemInfo PLNS(PLCrashReportSystemInfo) +#define PLCrashReportTextFormatter PLNS(PLCrashReportTextFormatter) +#define PLCrashReportThreadInfo PLNS(PLCrashReportThreadInfo) +#define PLCrashReporter PLNS(PLCrashReporter) +#define PLCrashSignalHandler PLNS(PLCrashSignalHandler) +#define PLCrashHostInfo PLNS(PLCrashHostInfo) +#define PLCrashMachExceptionPort PLNS(PLCrashMachExceptionPort) +#define PLCrashMachExceptionPortSet PLNS(PLCrashMachExceptionPortSet) +#define PLCrashProcessInfo PLNS(PLCrashProcessInfo) +#define PLCrashReporterConfig PLNS(PLCrashReporterConfig) +#define PLCrashUncaughtExceptionHandler PLNS(PLCrashUncaughtExceptionHandler) +#define PLCrashReportFormatter PLNS(PLCrashReportFormatter) + +/* Public C functions */ +#define PLCrashMachExceptionForward PLNS(PLCrashMachExceptionForward) +#define PLCrashSignalHandlerForward PLNS(PLCrashSignalHandlerForward) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) + + +/* Public C global symbols */ +#define PLCrashReporterErrorDomain PLNS(PLCrashReporterErrorDomain) +#define PLCrashReportHostArchitecture PLNS(PLCrashReportHostArchitecture) +#define PLCrashReportHostOperatingSystem PLNS(PLCrashReportHostOperatingSystem) +#define PLCrashReporterException PLNS(PLCrashReporterException) + +/* For backwards compatibility, plcrash_async_byteorder vends C++ methods when included under C++. We have + * to handle this distinctly from our PLCR_CPP_BEGIN_NS C++ namespacing mechanism. */ +#define plcrash_async_byteorder PLNS(plcrash_async_byteorder) + +/* + * All private C symbols. Once these are migrated to C++, we'll be able to use the much simpler + * PLCR_CPP_BEGIN_NS machinery. + * + * This list was automatically generated (and can be updated) by setting PLCRASHREPORTER_PREFIX to 'AcmeCo', + * building the library, and executing the following: + * nm -g -U | grep '^[0-9]' | c++filt | grep -v AcmeCo | grep -E '_pl|_PL' | awk '{print $3}' | cut -c 2- | sort | uniq | awk '{print "#define",$1,"PLNS("$1")"}' + */ +#define pl_mach_thread_self PLNS(pl_mach_thread_self) +#define plcrash__architecture__descriptor PLNS(plcrash__architecture__descriptor) +#define plcrash__crash_report__application_info__descriptor PLNS(plcrash__crash_report__application_info__descriptor) +#define plcrash__crash_report__application_info__init PLNS(plcrash__crash_report__application_info__init) +#define plcrash__crash_report__binary_image__descriptor PLNS(plcrash__crash_report__binary_image__descriptor) +#define plcrash__crash_report__binary_image__init PLNS(plcrash__crash_report__binary_image__init) +#define plcrash__crash_report__descriptor PLNS(plcrash__crash_report__descriptor) +#define plcrash__crash_report__exception__descriptor PLNS(plcrash__crash_report__exception__descriptor) +#define plcrash__crash_report__exception__init PLNS(plcrash__crash_report__exception__init) +#define plcrash__crash_report__free_unpacked PLNS(plcrash__crash_report__free_unpacked) +#define plcrash__crash_report__get_packed_size PLNS(plcrash__crash_report__get_packed_size) +#define plcrash__crash_report__init PLNS(plcrash__crash_report__init) +#define plcrash__crash_report__machine_info__descriptor PLNS(plcrash__crash_report__machine_info__descriptor) +#define plcrash__crash_report__machine_info__init PLNS(plcrash__crash_report__machine_info__init) +#define plcrash__crash_report__pack PLNS(plcrash__crash_report__pack) +#define plcrash__crash_report__pack_to_buffer PLNS(plcrash__crash_report__pack_to_buffer) +#define plcrash__crash_report__process_info__descriptor PLNS(plcrash__crash_report__process_info__descriptor) +#define plcrash__crash_report__process_info__init PLNS(plcrash__crash_report__process_info__init) +#define plcrash__crash_report__processor__descriptor PLNS(plcrash__crash_report__processor__descriptor) +#define plcrash__crash_report__processor__init PLNS(plcrash__crash_report__processor__init) +#define plcrash__crash_report__processor__type_encoding__descriptor PLNS(plcrash__crash_report__processor__type_encoding__descriptor) +#define plcrash__crash_report__report_info__descriptor PLNS(plcrash__crash_report__report_info__descriptor) +#define plcrash__crash_report__report_info__init PLNS(plcrash__crash_report__report_info__init) +#define plcrash__crash_report__signal__descriptor PLNS(plcrash__crash_report__signal__descriptor) +#define plcrash__crash_report__signal__init PLNS(plcrash__crash_report__signal__init) +#define plcrash__crash_report__signal__mach_exception__descriptor PLNS(plcrash__crash_report__signal__mach_exception__descriptor) +#define plcrash__crash_report__signal__mach_exception__init PLNS(plcrash__crash_report__signal__mach_exception__init) +#define plcrash__crash_report__symbol__descriptor PLNS(plcrash__crash_report__symbol__descriptor) +#define plcrash__crash_report__symbol__init PLNS(plcrash__crash_report__symbol__init) +#define plcrash__crash_report__system_info__descriptor PLNS(plcrash__crash_report__system_info__descriptor) +#define plcrash__crash_report__system_info__init PLNS(plcrash__crash_report__system_info__init) +#define plcrash__crash_report__system_info__operating_system__descriptor PLNS(plcrash__crash_report__system_info__operating_system__descriptor) +#define plcrash__crash_report__thread__descriptor PLNS(plcrash__crash_report__thread__descriptor) +#define plcrash__crash_report__thread__init PLNS(plcrash__crash_report__thread__init) +#define plcrash__crash_report__thread__register_value__descriptor PLNS(plcrash__crash_report__thread__register_value__descriptor) +#define plcrash__crash_report__thread__register_value__init PLNS(plcrash__crash_report__thread__register_value__init) +#define plcrash__crash_report__thread__stack_frame__descriptor PLNS(plcrash__crash_report__thread__stack_frame__descriptor) +#define plcrash__crash_report__thread__stack_frame__init PLNS(plcrash__crash_report__thread__stack_frame__init) +#define plcrash__crash_report__unpack PLNS(plcrash__crash_report__unpack) +#define plcrash_async_address_apply_offset PLNS(plcrash_async_address_apply_offset) +#define plcrash_async_byteorder_big_endian PLNS(plcrash_async_byteorder_big_endian) +#define plcrash_async_byteorder_direct PLNS(plcrash_async_byteorder_direct) +#define plcrash_async_byteorder_little_endian PLNS(plcrash_async_byteorder_little_endian) +#define plcrash_async_byteorder_swapped PLNS(plcrash_async_byteorder_swapped) +#define plcrash_async_cfe_entry_apply PLNS(plcrash_async_cfe_entry_apply) +#define plcrash_async_cfe_entry_free PLNS(plcrash_async_cfe_entry_free) +#define plcrash_async_cfe_entry_init PLNS(plcrash_async_cfe_entry_init) +#define plcrash_async_cfe_entry_register_count PLNS(plcrash_async_cfe_entry_register_count) +#define plcrash_async_cfe_entry_register_list PLNS(plcrash_async_cfe_entry_register_list) +#define plcrash_async_cfe_entry_return_address_register PLNS(plcrash_async_cfe_entry_return_address_register) +#define plcrash_async_cfe_entry_stack_adjustment PLNS(plcrash_async_cfe_entry_stack_adjustment) +#define plcrash_async_cfe_entry_stack_offset PLNS(plcrash_async_cfe_entry_stack_offset) +#define plcrash_async_cfe_entry_type PLNS(plcrash_async_cfe_entry_type) +#define plcrash_async_cfe_reader_find_pc PLNS(plcrash_async_cfe_reader_find_pc) +#define plcrash_async_cfe_reader_free PLNS(plcrash_async_cfe_reader_free) +#define plcrash_async_cfe_reader_init PLNS(plcrash_async_cfe_reader_init) +#define plcrash_async_cfe_register_decode PLNS(plcrash_async_cfe_register_decode) +#define plcrash_async_cfe_register_encode PLNS(plcrash_async_cfe_register_encode) +#define plcrash_async_file_close PLNS(plcrash_async_file_close) +#define plcrash_async_file_flush PLNS(plcrash_async_file_flush) +#define plcrash_async_file_init PLNS(plcrash_async_file_init) +#define plcrash_async_file_write PLNS(plcrash_async_file_write) +#define plcrash_async_find_symbol PLNS(plcrash_async_find_symbol) +#define plcrash_async_image_containing_address PLNS(plcrash_async_image_containing_address) +#define plcrash_async_image_list_next PLNS(plcrash_async_image_list_next) +#define plcrash_async_image_list_set_reading PLNS(plcrash_async_image_list_set_reading) +#define plcrash_async_mach_exception_get_siginfo PLNS(plcrash_async_mach_exception_get_siginfo) +#define plcrash_async_macho_byteorder PLNS(plcrash_async_macho_byteorder) +#define plcrash_async_macho_contains_address PLNS(plcrash_async_macho_contains_address) +#define plcrash_async_macho_cpu_subtype PLNS(plcrash_async_macho_cpu_subtype) +#define plcrash_async_macho_cpu_type PLNS(plcrash_async_macho_cpu_type) +#define plcrash_async_macho_find_command PLNS(plcrash_async_macho_find_command) +#define plcrash_async_macho_find_segment_cmd PLNS(plcrash_async_macho_find_segment_cmd) +#define plcrash_async_macho_find_symbol_by_name PLNS(plcrash_async_macho_find_symbol_by_name) +#define plcrash_async_macho_find_symbol_by_pc PLNS(plcrash_async_macho_find_symbol_by_pc) +#define plcrash_async_macho_header PLNS(plcrash_async_macho_header) +#define plcrash_async_macho_header_size PLNS(plcrash_async_macho_header_size) +#define plcrash_async_macho_map_section PLNS(plcrash_async_macho_map_section) +#define plcrash_async_macho_map_segment PLNS(plcrash_async_macho_map_segment) +#define plcrash_async_macho_mapped_segment_free PLNS(plcrash_async_macho_mapped_segment_free) +#define plcrash_async_macho_next_command PLNS(plcrash_async_macho_next_command) +#define plcrash_async_macho_next_command_type PLNS(plcrash_async_macho_next_command_type) +#define plcrash_async_macho_string_free PLNS(plcrash_async_macho_string_free) +#define plcrash_async_macho_string_get_length PLNS(plcrash_async_macho_string_get_length) +#define plcrash_async_macho_string_get_pointer PLNS(plcrash_async_macho_string_get_pointer) +#define plcrash_async_macho_string_init PLNS(plcrash_async_macho_string_init) +#define plcrash_async_macho_symtab_reader_free PLNS(plcrash_async_macho_symtab_reader_free) +#define plcrash_async_macho_symtab_reader_init PLNS(plcrash_async_macho_symtab_reader_init) +#define plcrash_async_macho_symtab_reader_read PLNS(plcrash_async_macho_symtab_reader_read) +#define plcrash_async_macho_symtab_reader_symbol_name PLNS(plcrash_async_macho_symtab_reader_symbol_name) +#define plcrash_async_memcpy PLNS(plcrash_async_memcpy) +#define plcrash_async_memset PLNS(plcrash_async_memset) +#define plcrash_async_mobject_base_address PLNS(plcrash_async_mobject_base_address) +#define plcrash_async_mobject_free PLNS(plcrash_async_mobject_free) +#define plcrash_async_mobject_init PLNS(plcrash_async_mobject_init) +#define plcrash_async_mobject_length PLNS(plcrash_async_mobject_length) +#define plcrash_async_mobject_read_uint16 PLNS(plcrash_async_mobject_read_uint16) +#define plcrash_async_mobject_read_uint32 PLNS(plcrash_async_mobject_read_uint32) +#define plcrash_async_mobject_read_uint64 PLNS(plcrash_async_mobject_read_uint64) +#define plcrash_async_mobject_read_uint8 PLNS(plcrash_async_mobject_read_uint8) +#define plcrash_async_mobject_remap_address PLNS(plcrash_async_mobject_remap_address) +#define plcrash_async_mobject_task PLNS(plcrash_async_mobject_task) +#define plcrash_async_mobject_verify_local_pointer PLNS(plcrash_async_mobject_verify_local_pointer) +#define plcrash_async_objc_cache_free PLNS(plcrash_async_objc_cache_free) +#define plcrash_async_objc_cache_init PLNS(plcrash_async_objc_cache_init) +#define plcrash_async_objc_find_method PLNS(plcrash_async_objc_find_method) +#define plcrash_async_signal_sigcode PLNS(plcrash_async_signal_sigcode) +#define plcrash_async_signal_signame PLNS(plcrash_async_signal_signame) +#define plcrash_async_strcmp PLNS(plcrash_async_strcmp) +#define plcrash_async_strerror PLNS(plcrash_async_strerror) +#define plcrash_async_strncmp PLNS(plcrash_async_strncmp) +#define plcrash_async_symbol_cache_free PLNS(plcrash_async_symbol_cache_free) +#define plcrash_async_symbol_cache_init PLNS(plcrash_async_symbol_cache_init) +#define plcrash_async_task_memcpy PLNS(plcrash_async_task_memcpy) +#define plcrash_async_task_read_uint16 PLNS(plcrash_async_task_read_uint16) +#define plcrash_async_task_read_uint32 PLNS(plcrash_async_task_read_uint32) +#define plcrash_async_task_read_uint64 PLNS(plcrash_async_task_read_uint64) +#define plcrash_async_task_read_uint8 PLNS(plcrash_async_task_read_uint8) +#define plcrash_async_thread_state_clear_all_regs PLNS(plcrash_async_thread_state_clear_all_regs) +#define plcrash_async_thread_state_clear_reg PLNS(plcrash_async_thread_state_clear_reg) +#define plcrash_async_thread_state_clear_volatile_regs PLNS(plcrash_async_thread_state_clear_volatile_regs) +#define plcrash_async_thread_state_copy PLNS(plcrash_async_thread_state_copy) +#define plcrash_async_thread_state_current PLNS(plcrash_async_thread_state_current) +#define plcrash_async_thread_state_current_stub PLNS(plcrash_async_thread_state_current_stub) +#define plcrash_async_thread_state_get_greg_size PLNS(plcrash_async_thread_state_get_greg_size) +#define plcrash_async_thread_state_get_reg PLNS(plcrash_async_thread_state_get_reg) +#define plcrash_async_thread_state_get_reg_count PLNS(plcrash_async_thread_state_get_reg_count) +#define plcrash_async_thread_state_get_reg_name PLNS(plcrash_async_thread_state_get_reg_name) +#define plcrash_async_thread_state_get_stack_direction PLNS(plcrash_async_thread_state_get_stack_direction) +#define plcrash_async_thread_state_has_reg PLNS(plcrash_async_thread_state_has_reg) +#define plcrash_async_thread_state_init PLNS(plcrash_async_thread_state_init) +#define plcrash_async_thread_state_mach_thread_init PLNS(plcrash_async_thread_state_mach_thread_init) +#define plcrash_async_thread_state_map_dwarf_to_reg PLNS(plcrash_async_thread_state_map_dwarf_to_reg) +#define plcrash_async_thread_state_map_reg_to_dwarf PLNS(plcrash_async_thread_state_map_reg_to_dwarf) +#define plcrash_async_thread_state_mcontext_init PLNS(plcrash_async_thread_state_mcontext_init) +#define plcrash_async_thread_state_set_reg PLNS(plcrash_async_thread_state_set_reg) +#define plcrash_async_writen PLNS(plcrash_async_writen) +#define plcrash_log_writer_close PLNS(plcrash_log_writer_close) +#define plcrash_log_writer_free PLNS(plcrash_log_writer_free) +#define plcrash_log_writer_init PLNS(plcrash_log_writer_init) +#define plcrash_log_writer_set_exception PLNS(plcrash_log_writer_set_exception) +#define plcrash_log_writer_write PLNS(plcrash_log_writer_write) +#define plcrash_log_writer_set_custom_data PLNS(plcrash_log_writer_set_custom_data) +#define plcrash_nasync_image_list_append PLNS(plcrash_nasync_image_list_append) +#define plcrash_nasync_image_list_free PLNS(plcrash_nasync_image_list_free) +#define plcrash_nasync_image_list_init PLNS(plcrash_nasync_image_list_init) +#define plcrash_nasync_image_list_remove PLNS(plcrash_nasync_image_list_remove) +#define plcrash_nasync_macho_free PLNS(plcrash_nasync_macho_free) +#define plcrash_nasync_macho_init PLNS(plcrash_nasync_macho_init) +#define plcrash_populate_error PLNS(plcrash_populate_error) +#define plcrash_populate_mach_error PLNS(plcrash_populate_mach_error) +#define plcrash_populate_posix_error PLNS(plcrash_populate_posix_error) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) +#define plcrash_sysctl_int PLNS(plcrash_sysctl_int) +#define plcrash_sysctl_string PLNS(plcrash_sysctl_string) +#define plcrash_sysctl_valid_utf8_bytes PLNS(plcrash_sysctl_valid_utf8_bytes) +#define plcrash_sysctl_valid_utf8_bytes_max PLNS(plcrash_sysctl_valid_utf8_bytes_max) +#define plcrash_writer_pack PLNS(plcrash_writer_pack) +#define plframe_cursor_free PLNS(plframe_cursor_free) +#define plframe_cursor_get_reg PLNS(plframe_cursor_get_reg) +#define plframe_cursor_get_regcount PLNS(plframe_cursor_get_regcount) +#define plframe_cursor_get_regname PLNS(plframe_cursor_get_regname) +#define plframe_cursor_init PLNS(plframe_cursor_init) +#define plframe_cursor_next PLNS(plframe_cursor_next) +#define plframe_cursor_next_with_readers PLNS(plframe_cursor_next_with_readers) +#define plframe_cursor_read_compact_unwind PLNS(plframe_cursor_read_compact_unwind) +#define plframe_cursor_read_dwarf_unwind PLNS(plframe_cursor_read_dwarf_unwind) +#define plframe_cursor_read_frame_ptr PLNS(plframe_cursor_read_frame_ptr) +#define plframe_cursor_thread_init PLNS(plframe_cursor_thread_init) +#define plframe_strerror PLNS(plframe_strerror) + +#endif + +/* + * The following symbols are exported by the protobuf-c library. When building + * a shared library, we can hide these as private symbols. + * + * However, when building a static library, we can only do so if we use + * MH_OBJECT "single object prelink". The MH_OBJECT approach allows us to apply + * symbol hiding/aliasing/etc similar to that supported by dylibs, but because it is + * seemingly unused within Apple, the use thereof regularly introduces linking bugs + * and errors in new Xcode releases. + * + * Rather than fighting the linker, we use the namespacing machinery to rewrite these + * symbols, but only when explicitly compiling PLCrashReporter. Since protobuf-c is a library + * that may be used elsewhere, we don't want to rewrite these symbols if they're used + * independently by PLCrashReporter API clients. + */ +#ifdef PLCR_PRIVATE + /* If no prefix has been defined, we need to specify our own private prefix */ +# ifndef PLCRASHREPORTER_PREFIX +# define PLCRASHREPORTER_PREFIX PL_ +# endif + +# define protobuf_c_buffer_simple_append PLNS(protobuf_c_buffer_simple_append) +# define protobuf_c_empty_string PLNS(protobuf_c_empty_string) +# define protobuf_c_enum_descriptor_get_value PLNS(protobuf_c_enum_descriptor_get_value) +# define protobuf_c_enum_descriptor_get_value_by_name PLNS(protobuf_c_enum_descriptor_get_value_by_name) +# define protobuf_c_message_check PLNS(protobuf_c_message_check) +# define protobuf_c_message_descriptor_get_field PLNS(protobuf_c_message_descriptor_get_field) +# define protobuf_c_message_descriptor_get_field_by_name PLNS(protobuf_c_message_descriptor_get_field_by_name) +# define protobuf_c_message_free_unpacked PLNS(protobuf_c_message_free_unpacked) +# define protobuf_c_message_get_packed_size PLNS(protobuf_c_message_get_packed_size) +# define protobuf_c_message_init PLNS(protobuf_c_message_init) +# define protobuf_c_message_pack PLNS(protobuf_c_message_pack) +# define protobuf_c_message_pack_to_buffer PLNS(protobuf_c_message_pack_to_buffer) +# define protobuf_c_message_unpack PLNS(protobuf_c_message_unpack) +# define protobuf_c_service_descriptor_get_method_by_name PLNS(protobuf_c_service_descriptor_get_method_by_name) +# define protobuf_c_service_destroy PLNS(protobuf_c_service_destroy) +# define protobuf_c_service_generated_init PLNS(protobuf_c_service_generated_init) +# define protobuf_c_service_invoke_internal PLNS(protobuf_c_service_invoke_internal) +# define protobuf_c_version PLNS(protobuf_c_version) +# define protobuf_c_version_number PLNS(protobuf_c_version_number) +#endif /* PLCR_PRIVATE */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReport.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReport.h new file mode 100644 index 0000000..f710c3f --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReport.h @@ -0,0 +1,230 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_H +#define PLCRASH_REPORT_H + +#if __has_include() +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#else +#import "PLCrashReportApplicationInfo.h" +#import "PLCrashReportBinaryImageInfo.h" +#import "PLCrashReportExceptionInfo.h" +#import "PLCrashReportMachineInfo.h" +#import "PLCrashReportMachExceptionInfo.h" +#import "PLCrashReportProcessInfo.h" +#import "PLCrashReportProcessorInfo.h" +#import "PLCrashReportRegisterInfo.h" +#import "PLCrashReportSignalInfo.h" +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportSymbolInfo.h" +#import "PLCrashReportSystemInfo.h" +#import "PLCrashReportThreadInfo.h" +#endif + +/** + * @ingroup constants + * Crash file magic identifier */ +#define PLCRASH_REPORT_FILE_MAGIC "plcrash" + +/** + * @ingroup constants + * Crash format version byte identifier. Will not change outside of the introduction of + * an entirely new crash log format. */ +#define PLCRASH_REPORT_FILE_VERSION 1 + +/** + * @ingroup types + * Crash log file header format. + * + * Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC), + * followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION). + * The crash log message format itself is extensible, so this version number will only + * be incremented in the event of an incompatible encoding or format change. + */ +struct PLCrashReportFileHeader { + /** Crash log magic identifier, not NULL terminated */ + const char magic[7]; + + /** Crash log encoding/format version */ + const uint8_t version; + + /** File data */ + const uint8_t data[]; +} __attribute__((packed)); + + +/** + * @internal + * Private decoder instance variables (used to hide the underlying protobuf parser). + */ +typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; + +@interface PLCrashReport : NSObject { +@private + /** Private implementation variables (used to hide the underlying protobuf parser) */ + _PLCrashReportDecoder *_decoder; + + /** System info */ + __strong PLCrashReportSystemInfo *_systemInfo; + + /** Machine info */ + __strong PLCrashReportMachineInfo *_machineInfo; + + /** Application info */ + __strong PLCrashReportApplicationInfo *_applicationInfo; + + /** Process info */ + __strong PLCrashReportProcessInfo *_processInfo; + + /** Signal info */ + __strong PLCrashReportSignalInfo *_signalInfo; + + /** Mach exception info */ + __strong PLCrashReportMachExceptionInfo *_machExceptionInfo; + + /** Thread info (PLCrashReportThreadInfo instances) */ + __strong NSArray *_threads; + + /** Binary images (PLCrashReportBinaryImageInfo instances */ + __strong NSArray *_images; + + /** Exception information (may be nil) */ + __strong PLCrashReportExceptionInfo *_exceptionInfo; + + /** User defined information (may be nil) */ + __strong NSData *_customData; + + /** Report UUID */ + CFUUIDRef _uuid; +} + +- (id) initWithData: (NSData *) encodedData error: (NSError **) outError; + +- (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address; + +/** + * System information. + */ +@property(nonatomic, readonly, strong) PLCrashReportSystemInfo *systemInfo; + +/** + * YES if machine information is available. + */ +@property(nonatomic, readonly) BOOL hasMachineInfo; + +/** + * Machine information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachineInfo *machineInfo; + +/** + * Application information. + */ +@property(nonatomic, readonly, strong) PLCrashReportApplicationInfo *applicationInfo; + +/** + * YES if process information is available. + */ +@property(nonatomic, readonly) BOOL hasProcessInfo; + +/** + * Process information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessInfo *processInfo; + +/** + * Signal information. This provides the signal and signal code of the fatal signal. + */ +@property(nonatomic, readonly, strong) PLCrashReportSignalInfo *signalInfo; + +/** + * Mach exception information, if available. This will only be included in the + * case that encoding crash reporter's exception-based reporting was enabled, and a Mach + * exception was caught. + * + * @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this + * s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the + * Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal + * mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachExceptionInfo *machExceptionInfo; + +/** + * Thread information. Returns a list of PLCrashReportThreadInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *threads; + +/** + * Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *images; + +/** + * YES if exception information is available. + */ +@property(nonatomic, readonly) BOOL hasExceptionInfo; + +/** + * Exception information. Only available if a crash was caused by an uncaught exception, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportExceptionInfo *exceptionInfo; + +/** + * Custom user data. Only available if user explicitly assigned it before crash happened, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) NSData *customData; + +/** + * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated + * by a single client. Only available in later (v1.2+) crash report format versions. If not available, + * will be NULL. + */ +@property(nonatomic, readonly) CFUUIDRef uuidRef; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportApplicationInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportApplicationInfo.h new file mode 100644 index 0000000..787a286 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportApplicationInfo.h @@ -0,0 +1,62 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportApplicationInfo : NSObject { +@private + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; +} + +- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier + applicationVersion: (NSString *) applicationVersion + applicationMarketingVersion: (NSString *) applicationMarketingVersion; + +/** + * The application identifier. This is usually the application's CFBundleIdentifier value. + */ +@property(nonatomic, readonly, strong) NSString *applicationIdentifier; + +/** + * The application version. This is usually the application's CFBundleVersion value. + */ +@property(nonatomic, readonly, strong) NSString *applicationVersion; + +/** + * The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil. + */ +@property(nonatomic, readonly, strong) NSString *applicationMarketingVersion; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportBinaryImageInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportBinaryImageInfo.h new file mode 100644 index 0000000..1a75051 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportBinaryImageInfo.h @@ -0,0 +1,95 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportBinaryImageInfo : NSObject { +@private + /** Code type */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /** Base image address */ + uint64_t _baseAddress; + + /** Image segment size */ + uint64_t _imageSize; + + /** Name of binary image */ + __strong NSString *_imageName; + + /** If the UUID is available */ + BOOL _hasImageUUID; + + /** 128-bit object UUID. May be nil. */ + __strong NSString *_imageUUID; +} + +- (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo + baseAddress: (uint64_t) baseAddress + size: (uint64_t) imageSize + name: (NSString *) imageName + uuid: (NSData *) uuid; + +/** + * Image code type, or nil if unavailable. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *codeType; + +/** + * Image base address. + */ +@property(nonatomic, readonly) uint64_t imageBaseAddress; + +/** + * Segment size. + */ +@property(nonatomic, readonly) uint64_t imageSize; + +/** + * Image name (absolute path) + */ +@property(nonatomic, readonly, strong) NSString *imageName; + + +/** + * YES if this image has an associated UUID. + */ +@property(nonatomic, readonly) BOOL hasImageUUID; + +/** + * 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable. + */ +@property(nonatomic, readonly, strong) NSString *imageUUID; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportExceptionInfo.h new file mode 100644 index 0000000..7423ca9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportExceptionInfo.h @@ -0,0 +1,69 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportThreadInfo.h" +#endif + +@interface PLCrashReportExceptionInfo : NSObject { +@private + /** Name */ + __strong NSString *_name; + + /** Reason */ + __strong NSString *_reason; + + /** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */ + __strong NSArray *_stackFrames; +} + +- (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason; + +- (id) initWithExceptionName: (NSString *) name + reason: (NSString *) reason + stackFrames: (NSArray *) stackFrames; + +/** + * The exception name. + */ +@property(nonatomic, readonly, strong) NSString *exceptionName; + +/** + * The exception reason. + */ +@property(nonatomic, readonly, strong) NSString *exceptionReason; + +/* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable. + * This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportFormatter.h new file mode 100644 index 0000000..5cdf01b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportFormatter.h @@ -0,0 +1,55 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReport.h" +#endif + +/** + * A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules, + * (such as implementing text output support), and returns the result. + */ +@protocol PLCrashReportFormatter + +/** + * Format the provided @a report. + * + * @param report Report to be formatted. + * @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error + * object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will + * be left unmodified. You may specify nil for this parameter, and no error information will be provided. + * + * @return Returns the formatted report data on success, or nil on failure. + */ +- (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachExceptionInfo.h new file mode 100644 index 0000000..19461a5 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachExceptionInfo.h @@ -0,0 +1,48 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportMachExceptionInfo : NSObject { +@private + /** The Mach exception type. */ + uint64_t _type; + + /** The Mach exception codes, represented as an ordered array of NSNumber instances. */ + __strong NSArray *_codes; +} + +- (id) initWithType: (uint64_t) type codes: (NSArray *) codes; + +/** The Mach exception type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */ +@property(nonatomic, readonly, strong) NSArray *codes; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachineInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachineInfo.h new file mode 100644 index 0000000..ab6fee9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachineInfo.h @@ -0,0 +1,77 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportMachineInfo : NSObject { +@private + /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ + __strong NSString *_modelName; + + /** The processor type. */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /* The number of actual physical processor cores. */ + NSUInteger _processorCount; + + /* The number of logical processors. */ + NSUInteger _logicalProcessorCount; +} + +- (id) initWithModelName: (NSString *) modelName + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + processorCount: (NSUInteger) processorCount + logicalProcessorCount: (NSUInteger) logicalProcessorCount; + +/** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *modelName; + +/** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +/* + * The number of actual physical processor cores. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger processorCount; + +/* + * The number of logical processors. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger logicalProcessorCount; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessInfo.h new file mode 100644 index 0000000..802e8d4 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessInfo.h @@ -0,0 +1,103 @@ +/* + * Author: Damian Morris + * + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportProcessInfo : NSObject { +@private + /** Process name, or nil if unavailable. */ + __strong NSString *_processName; + + /** Process ID */ + NSUInteger _processID; + + /** Process path */ + __strong NSString* _processPath; + + /** Date and time that the crashing process was started. This may be unavailable, and this property + * will be nil. */ + __strong NSDate *_processStartTime; + + /** Parent process name, or nil if unavailable. */ + __strong NSString *_parentProcessName; + + /** Parent process ID */ + NSUInteger _parentProcessID; + + /** If false, the process is being run via process-level CPU emulation (such as Rosetta). */ + BOOL _native; +} + +- (id) initWithProcessName: (NSString *) processName + processID: (NSUInteger) processID + processPath: (NSString *) processPath + processStartTime: (NSDate *) processStartTime + parentProcessName: (NSString *) parentProcessName + parentProcessID: (NSUInteger) parentProcessID + native: (BOOL) native; + +/** + * The process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processName; + +/** + * The process ID. + */ +@property(nonatomic, readonly) NSUInteger processID; + +/** + * The path to the process executable. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processPath; + +/** + * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSDate *processStartTime; + +/** + * The parent process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *parentProcessName; + +/** + * The parent process ID. + */ +@property(nonatomic, readonly) NSUInteger parentProcessID; + +/** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */ +@property(nonatomic, readonly) BOOL native; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessorInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessorInfo.h new file mode 100644 index 0000000..03d570b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessorInfo.h @@ -0,0 +1,74 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +/** + * @ingroup constants + * + * The type encodings supported for CPU types and subtypes. Currently only Apple + * Mach-O defined encodings are supported. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Unknown cpu type encoding. */ + PLCrashReportProcessorTypeEncodingUnknown = 0, + + /** Apple Mach-defined processor types. */ + PLCrashReportProcessorTypeEncodingMach = 1 +} PLCrashReportProcessorTypeEncoding; + +@interface PLCrashReportProcessorInfo : NSObject { +@private + /** Type encoding */ + PLCrashReportProcessorTypeEncoding _typeEncoding; + + /** CPU type */ + uint64_t _type; + + /** CPU subtype */ + uint64_t _subtype; +} + +- (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding + type: (uint64_t) type + subtype: (uint64_t) subtype; + +/** The CPU type encoding. */ +@property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding; + +/** The CPU type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The CPU subtype. */ +@property(nonatomic, readonly) uint64_t subtype; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportRegisterInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportRegisterInfo.h new file mode 100644 index 0000000..e0a1ca1 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportRegisterInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportRegisterInfo : NSObject { +@private + /** Register name */ + __strong NSString *_registerName; + + /** Register value */ + uint64_t _registerValue; +} + +- (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; + +/** + * Register name. + */ +@property(nonatomic, readonly, strong) NSString *registerName; + +/** + * Register value. + */ +@property(nonatomic, readonly) uint64_t registerValue; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSignalInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSignalInfo.h new file mode 100644 index 0000000..d949211 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSignalInfo.h @@ -0,0 +1,60 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSignalInfo : NSObject { +@private + /** Signal name */ + __strong NSString *_name; + + /** Signal code */ + __strong NSString *_code; + + /** Fauling instruction or address */ + uint64_t _address; +} + +- (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address; + +/** + * The signal name. + */ +@property(nonatomic, readonly, strong) NSString *name; + +/** + * The signal code. + */ +@property(nonatomic, readonly, strong) NSString *code; + +/** + * The faulting instruction or address. + */ +@property(nonatomic, readonly) uint64_t address; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportStackFrameInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000..5fd4acc --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,57 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportSymbolInfo.h" +#endif + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + __strong PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSymbolInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000..bdb367c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + __strong NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly, strong) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSystemInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSystemInfo.h new file mode 100644 index 0000000..eb8a447 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSystemInfo.h @@ -0,0 +1,177 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashMacros.h" +#endif + +@class PLCrashReportProcessorInfo; + +/** + * @ingroup constants + * + * Indicates the Operating System under which a Crash Log was generated. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Mac OS X. */ + PLCrashReportOperatingSystemMacOSX = 0, + + /** iPhone OS */ + PLCrashReportOperatingSystemiPhoneOS = 1, + + /** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */ + PLCrashReportOperatingSystemiPhoneSimulator = 2, + + /** Unknown operating system */ + PLCrashReportOperatingSystemUnknown = 3, + + /** Apple tvOS */ + PLCrashReportOperatingSystemAppleTVOS = 4, + +} PLCrashReportOperatingSystem; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** + * @ingroup constants + * + * Indicates the architecture under which a Crash Log was generated. + * + * @note The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * will make use of the new PLCrashReportProcessorInfo CPU type encodings. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** x86-32. */ + PLCrashReportArchitectureX86_32 = 0, + + /** x86-64 */ + PLCrashReportArchitectureX86_64 = 1, + + /** ARMv6 */ + PLCrashReportArchitectureARMv6 = 2, + + /** + * ARMv6 + * @deprecated This value has been deprecated in favor of ARM subtype-specific + * values. + * @sa PLCrashReportArchitectureARMv6 + */ + PLCrashReportArchitectureARM PLCR_DEPRECATED = PLCrashReportArchitectureARMv6, + + /** PPC */ + PLCrashReportArchitecturePPC = 3, + + /** PPC64 */ + PLCrashReportArchitecturePPC64 = 4, + + /** ARMv7 */ + PLCrashReportArchitectureARMv7 = 5, + + /** Unknown */ + PLCrashReportArchitectureUnknown = 6 +} PLCrashReportArchitecture; +#pragma clang diagnostic pop + +extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); +extern PLCrashReportArchitecture PLCrashReportHostArchitecture PLCR_EXTERNAL_DEPRECATED; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); + +@interface PLCrashReportSystemInfo : NSObject { +@private + /** Operating system */ + PLCrashReportOperatingSystem _operatingSystem; + + /** Operating system version */ + __strong NSString *_osVersion; + + /** OS build. May be nil. */ + __strong NSString *_osBuild; + + /** Architecture */ + PLCrashReportArchitecture _architecture; + + /** Date crash report was generated. May be nil if the date is unknown. */ + __strong NSDate *_timestamp; + + /** Processor information. */ + __strong PLCrashReportProcessorInfo *_processorInfo; +} + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + timestamp: (NSDate *) timestamp; + +/** The operating system. */ +@property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem; + +/** The operating system's release version. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemVersion; + +/** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemBuild; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo + * extensible encoding. */ +@property(nonatomic, readonly) PLCrashReportArchitecture architecture PLCR_DEPRECATED; + +/** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSDate *timestamp; + +/** The processor type. For v1.2 reports and later, this is an alias to the machine info's processorInfo. + * For earlier reports, this will be synthesized from the deprecated architecture property. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportTextFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportTextFormatter.h new file mode 100644 index 0000000..adbc251 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportTextFormatter.h @@ -0,0 +1,66 @@ +/* + * Authors: + * Landon Fuller + * Damian Morris + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportFormatter.h" +#endif + +/** + * Supported text output formats. + * + * @ingroup enums + */ +typedef enum { + /** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available + * through iTunes Connect. */ + PLCrashReportTextFormatiOS = 0 +} PLCrashReportTextFormat; + + +@interface PLCrashReportTextFormatter : NSObject { +@private + /** Text output format. */ + PLCrashReportTextFormat _textFormat; + + /** Encoding to use for string output. */ + NSStringEncoding _stringEncoding; +} + ++ (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat; + +- (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportThreadInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportThreadInfo.h new file mode 100644 index 0000000..b9092e2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReportThreadInfo.h @@ -0,0 +1,88 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_THREAD_INFO_H +#define PLCRASH_REPORT_THREAD_INFO_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportRegisterInfo.h" +#endif + + +@interface PLCrashReportThreadInfo : NSObject { +@private + /** The thread number. Should be unique within a given crash log. */ + NSInteger _threadNumber; + + /** Ordered list of PLCrashReportStackFrame instances */ + __strong NSArray *_stackFrames; + + /** YES if this thread crashed. */ + BOOL _crashed; + + /** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */ + __strong NSArray *_registers; +} + +- (id) initWithThreadNumber: (NSInteger) threadNumber + stackFrames: (NSArray *) stackFrames + crashed: (BOOL) crashed + registers: (NSArray *) registers; + +/** + * Application thread number. + */ +@property(nonatomic, readonly) NSInteger threadNumber; + +/** + * Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances. + * The array is ordered, last callee to first. + */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +/** + * If this thread crashed, set to YES. + */ +@property(nonatomic, readonly) BOOL crashed; + +/** + * State of the general purpose and related registers, as a list of + * PLCrashReportRegister instances. If this thead did not crash (crashed returns NO), + * this list will be empty. + */ +@property(nonatomic, readonly, strong) NSArray *registers; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReporter.h new file mode 100644 index 0000000..bdc8f83 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReporter.h @@ -0,0 +1,159 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +#ifndef PLCRASH_REPORTER_H +#define PLCRASH_REPORTER_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReporterConfig.h" +#import "PLCrashMacros.h" +#endif + +@class PLCrashMachExceptionServer; +@class PLCrashMachExceptionPortSet; + +/** + * @ingroup functions + * + * Prototype of a callback function used to execute additional user code with signal information as provided + * by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk. + * + * @param info The signal info. + * @param uap The crash's threads context. + * @param context The API client's supplied context value. + * + * @sa The @ref async_safety documentation. + * @sa PLCrashReporter::setPostCrashCallbacks: + */ +typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context); + +/** + * @ingroup types + * + * This structure contains callbacks supported by PLCrashReporter to allow the host application to perform + * additional tasks prior to program termination after a crash has occurred. + * + * @sa The @ref async_safety documentation. + */ +typedef struct PLCrashReporterCallbacks { + /** The version number of this structure. If not one of the defined version numbers for this type, the behavior + * is undefined. The current version of this structure is 0. */ + uint16_t version; + + /** An arbitrary user-supplied context value. This value may be NULL. */ + void *context; + + /** + * The callback used to report caught signal information. In version 0 of this structure, all crashes will be + * reported via this function. + * + * @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived + * from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via + * PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will + * not provide valid thread state. + * + * This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained + * here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions. + */ + PLCrashReporterPostCrashSignalCallback handleSignal; +} PLCrashReporterCallbacks; + +@interface PLCrashReporter : NSObject { +@private + /** Reporter configuration */ + __strong PLCrashReporterConfig *_config; + + /** YES if the crash reporter has been enabled */ + BOOL _enabled; + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if + * the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */ + __strong PLCrashMachExceptionServer *_machServer; + + /** Previously registered Mach exception ports, if any. */ + __strong PLCrashMachExceptionPortSet *_previousMachPorts; +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ + + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; + + /** Path to the crash reporter internal data directory */ + __strong NSString *_crashReportDirectory; +} + ++ (PLCrashReporter *) sharedReporter PLCR_DEPRECATED; + +- (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config; + +- (BOOL) hasPendingCrashReport; + +- (NSData *) loadPendingCrashReportData; +- (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; + +- (NSData *) generateLiveReportWithThread: (thread_t) thread; +- (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; +- (NSData *) generateLiveReportWithThread: (thread_t) thread exception: (NSException *) exception error: (NSError **) outError; + +- (NSData *) generateLiveReport; +- (NSData *) generateLiveReportAndReturnError: (NSError **) outError; +- (NSData *) generateLiveReportWithException: (NSException *) exception error: (NSError **) outError; + +- (BOOL) purgePendingCrashReport; +- (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; + +- (BOOL) enableCrashReporter; +- (BOOL) enableCrashReporterAndReturnError: (NSError **) outError; + +- (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks; + +/** + * Return the path to live crash report (which may not yet, or ever, exist). + */ +- (NSString *) crashReportPath; + +/** + * Custom data to save in the crash report. + */ +@property(nonatomic, strong) NSData *customData; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReporterConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReporterConfig.h new file mode 100644 index 0000000..f151e56 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Headers/PLCrashReporterConfig.h @@ -0,0 +1,197 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashFeatureConfig.h" +#endif + +/** + * @ingroup enums + * Supported mechanisms for trapping and handling crashes. + */ +typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) { + /** + * Trap fatal signals via a sigaction(2)-registered BSD signal handler. + * + * PLCrashReporter's signal handler will supersede previously registered handlers; existing + * handlers will not be called. This behavior may be modified in a future release, and should + * not be relied upon as a mechanism to prevent existing signal handlers from being called. + * + * There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically: + * + * - On Mac OS X, stack overflows will only be handled on the thread on which + * the crash reporter was initialized. This should generally be the main thread. + * - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being + * non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS). + * - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting + * in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal + * handlers prior to raising SIGABRT). These __abort()-based checks are: + * - Implemented for unsafe memcpy/strcpy/snprintf C functions. + * - Only enabled when operating on a fixed-width target buffer (in which case the + * compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument). + * - Only trigger in the case that the source data exceeds the size of the fixed width target + * buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy), + * or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer), + * AND that argument can't be checked at compile-time. + */ + PLCrashReporterSignalHandlerTypeBSD = 0, + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** + * Trap fatal signals via a Mach exception server. + * + * If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that + * exception handler. Should the exceptions be handled by an existing handler, no report will be generated + * by PLCrashReporter. + * + * @par Mac OS X + * + * On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note, + * however, that some kernel-internal constants, as well as architecture-specific trap information, + * may be required to fully interpret a Mach exception's root cause. + * + * @par iOS + * + * On iOS, the APIs required for a complete implementation are not fully public. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included + * Mach exception handling as an optional feature, with both build-time and runtime configuration + * to disable its inclusion or use, respectively. + * + * @par Debugger Incompatibility + * + * The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to + * suspend all active threads (which will include the Mach exception handler). Mach-based handling + * should not be used when a debugger is attached. + * + * @par More Details + * + * For more information, refer to @ref mach_exceptions. + */ + PLCrashReporterSignalHandlerTypeMach = 1 +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ +}; + +/** + * @ingroup enums + * Supported mechanisms for performing local symbolication. + * + * Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may + * return information that is incorrect. This may still be useful in the case where DWARF data is unavailable + * for a given build; in that case, it can provide function and method names (though not line numbers) for a + * crash report that may otherwise be unusable. + * + * Note, however, this comes at the cost of a significant increase in code that must run within the critical + * crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In + * addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may + * change in future iOS releases. Given that DWARF symbolication data will always be more accurate, and + * the risks inherent in executing considerably more code at crash time, it is strongly recommended that local + * symbolication only be enabled for non-release builds. + * + * Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the + * results. + */ +typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) { + /** No symbolication. */ + PLCrashReporterSymbolicationStrategyNone = 0, + + /** + * Use the standard binary symbol table. On iOS, this alone will return + * incomplete results, as most symbols are rewritten to the common '\' string. + */ + PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0, + + /** + * Use Objective-C metadata to find method and class names. This relies on detailed parsing + * of the Objective-C runtime data, including undefined flags and other runtime internals. As such, + * it may return incorrect data should the runtime be changed incompatibly. + */ + PLCrashReporterSymbolicationStrategyObjC = 1 << 1, + + /** + * Enable all available symbolication strategies. + */ + PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC) +}; + +@interface PLCrashReporterConfig : NSObject { +@private + /** The configured signal handler type. */ + PLCrashReporterSignalHandlerType _signalHandlerType; + + /** The configured symbolication strategy. */ + PLCrashReporterSymbolicationStrategy _symbolicationStrategy; + + /** + * Flag indicating if the uncaughtExceptionHandler should be initialized or not. It usually is, except in a + * Xamarin environment. + */ + BOOL _shouldRegisterUncaughtExceptionHandler; +} + ++ (instancetype) defaultConfiguration; + +- (instancetype) init; + +- (instancetype) initWithBasePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + basePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler + basePath: (NSString *) basePath; + +/** The base path to save the crash data. */ +@property(nonatomic, readonly) NSString *basePath; + +/** The configured signal handler type. */ +@property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType; + +/** The configured symbolication strategy. */ +@property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy; + +/** Should PLCrashReporter regiser an uncaught exception handler? This is entended to be used in Xamarin apps */ +@property(nonatomic, readonly) BOOL shouldRegisterUncaughtExceptionHandler; + +@end + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Modules/module.modulemap b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Modules/module.modulemap new file mode 100644 index 0000000..4fa4304 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module CrashReporter { + umbrella header "CrashReporter.h" + + export * + module * { export * } + + link framework "Foundation" +} diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Resources/Info.plist b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Resources/Info.plist new file mode 100644 index 0000000..3ce348a --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-maccatalyst/CrashReporter.framework/Versions/Current/Resources/Info.plist @@ -0,0 +1,52 @@ + + + + + BuildMachineOSBuild + 21G531 + CFBundleDevelopmentRegion + English + CFBundleExecutable + CrashReporter + CFBundleIdentifier + com.microsoft.CrashReporter + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CrashReporter + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.11.1 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1.11.1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 13C100 + DTPlatformName + macosx + DTPlatformVersion + 12.1 + DTSDKBuild + 21C46 + DTSDKName + macosx12.1 + DTXcode + 1321 + DTXcodeBuild + 13C100 + LSMinimumSystemVersion + 10.15 + UIDeviceFamily + + 2 + + + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/CrashReporter b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/CrashReporter new file mode 100644 index 0000000..76d4bfc Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/CrashReporter differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/CrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/CrashReporter.h new file mode 100644 index 0000000..99878d3 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/CrashReporter.h @@ -0,0 +1,366 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifdef __APPLE__ +#import +#endif + +#if __has_include() + +// This must be included before any other PLCrashReporter includes, as +// it redefines symbol names +#import + +/* Library Imports */ +#import +#import +#import +#else +#import "PLCrashNamespace.h" +#import "PLCrashReporter.h" +#import "PLCrashReport.h" +#import "PLCrashReportTextFormatter.h" +#endif + +/** + * @defgroup functions Crash Reporter Functions Reference + */ + +/** + * @defgroup types Crash Reporter Data Types Reference + */ + +/** + * @defgroup constants Crash Reporter Constants Reference + */ + +/** + * @internal + * @defgroup plcrash_internal Crash Reporter Internal Documentation + */ + +/** + * @defgroup enums Enumerations + * @ingroup constants + */ + +/** + * @defgroup globals Global Variables + * @ingroup constants + */ + +/** + * @defgroup exceptions Exceptions + * @ingroup constants + */ + +/* Exceptions */ +extern NSString *PLCrashReporterException; + +/* Error Domain and Codes */ +extern NSString *PLCrashReporterErrorDomain; + +/** + * NSError codes in the Plausible Crash Reporter error domain. + * @ingroup enums + */ +typedef enum { + /** An unknown error has occured. If this + * code is received, it is a bug, and should be reported. */ + PLCrashReporterErrorUnknown = 0, + + /** An Mach or POSIX operating system error has occured. The underlying NSError cause may be fetched from the userInfo + * dictionary using the NSUnderlyingErrorKey key. */ + PLCrashReporterErrorOperatingSystem = 1, + + /** The crash report log file is corrupt or invalid */ + PLCrashReporterErrorCrashReportInvalid = 2, + + /** An attempt to use a resource which was in use at the time in a manner which would have conflicted with the request. */ + PLCrashReporterErrorResourceBusy = 3 +} PLCrashReporterError; + +/** + * @mainpage Plausible Crash Reporter + * + * @section intro_sec Introduction + * + * Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X. + * + * The following features are supported: + * + * - Implemented as an in-process signal handler. + * - Does not interfer with debugging in gdb.. + * - Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc). + * - Full thread state for all active threads (backtraces, register dumps) is provided. + * + * If your application crashes, a crash report will be written. When the application is next run, you may check for a + * pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the + * report locally. + * + * @section intro_encoding Crash Report Format + * + * Crash logs are encoded using google protobuf, and may be decoded + * using the provided PLCrashReport API. Additionally, the include plcrashutil handles conversion of binary crash reports to the + * symbolicate-compatible iPhone text format. + * + * @section doc_sections Documentation Sections + * - @subpage example_usage_iphone + * - @subpage error_handling + * - @subpage async_safety + */ + +/** + * @page example_usage_iphone Example iPhone Usage + * + * @code + * // + * // Called to handle a pending crash report. + * // + * - (void) handleCrashReport { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSData *crashData; + * NSError *error; + * + * // Try loading the crash report + * crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error]; + * if (crashData == nil) { + * NSLog(@"Could not load crash report: %@", error); + * goto finish; + * } + * + * // We could send the report from here, but we'll just print out + * // some debugging info instead + * PLCrashReport *report = [[[PLCrashReport alloc] initWithData: crashData error: &error] autorelease]; + * if (report == nil) { + * NSLog(@"Could not parse crash report"); + * goto finish; + * } + * + * NSLog(@"Crashed on %@", report.systemInfo.timestamp); + * NSLog(@"Crashed with signal %@ (code %@, address=0x%" PRIx64 ")", report.signalInfo.name, + * report.signalInfo.code, report.signalInfo.address); + * + * // Purge the report + * finish: + * [crashReporter purgePendingCrashReport]; + * return; + * } + * + * // from UIApplicationDelegate protocol + * - (void) applicationDidFinishLaunching: (UIApplication *) application { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSError *error; + * + * // Check if we previously crashed + * if ([crashReporter hasPendingCrashReport]) + * [self handleCrashReport]; + + * // Enable the Crash Reporter + * if (![crashReporter enableCrashReporterAndReturnError: &error]) + * NSLog(@"Warning: Could not enable crash reporter: %@", error); + * + * } + * @endcode + * + */ + +/** + * @page error_handling Error Handling Programming Guide + * + * Where a method may return an error, Plausible Crash Reporter provides access to the underlying + * cause via an optional NSError argument. + * + * All returned errors will be a member of one of the below defined domains, however, new domains and + * error codes may be added at any time. If you do not wish to report on the error cause, many methods + * support a simple form that requires no NSError argument. + * + * @section error_domains Error Domains, Codes, and User Info + * + * @subsection crashreporter_errors Crash Reporter Errors + * + * Any errors in Plausible Crash Reporter use the #PLCrashReporterErrorDomain error domain, and and one + * of the error codes defined in #PLCrashReporterError. + */ + +/** + * @page async_safety Async-Safe Programming Guide + * + * Plausible CrashReporter provides support for executing an application specified function in the context of the + * crash reporter's signal handler, after the crash report has been written to disk. This was a regularly requested + * feature, and provides the ability to implement application finalization in the event of a crash. However, writing + * code intended for execution inside of a signal handler is exceptionally difficult, and is not recommended. + * + * @section program_flow Program Flow and Signal Handlers + * + * When the signal handler is called the normal flow of the program is interrupted, and your program is an unknown + * state. Locks may be held, the heap may be corrupt (or in the process of being updated), and your signal + * handler may invoke a function that was being executed at the time of the signal. This may result in deadlocks, + * data corruption, and program termination. + * + * @section functions Async-Safe Functions + * + * A subset of functions are defined to be async-safe by the OS, and are safely callable from within a signal handler. If + * you do implement a custom post-crash handler, it must be async-safe. A table of POSIX-defined async-safe functions + * and additional information is available from the + * CERT programming guide - SIG30-C + * + * Most notably, the Objective-C runtime itself is not async-safe, and Objective-C may not be used within a signal + * handler. + * + * @sa PLCrashReporter::setCrashCallbacks: + */ + +/** + * @page mach_exceptions Mach Exceptions on Mac OS X and iOS + * + * PLCrashReporter includes support for monitoring crashes via an in-process Mach exception handler. There are a small + * number of crash cases that will not be caught with via a POSIX signal handler, but can be caught via a Mach + * exception handler: + * + * - Stack overflow. sigaltstack() is broken in later iOS releases, and even if functional, must be configured + * on a per-thread basis. + * - Internal Apple assertions that call libSystem's __assert. These include compiler-checked constraints + * for built-in functions, such as strcpy_chk(). The __abort() implementation actually disables the SIGABRT + * signal handler (resetting it to SIG_DFL) prior to to issueing a SIGABRT, bypassing signal-based crash + * reporters entirely. + * + * Unfortunately, the latter issue (__assert) can not be handled on iOS; trapping abort requires that + * a Mach exception handler operate out-of-process, which is impossible on iOS. On Mac OS X, this will + * only be handled once we've implemented fully out-of-process crash excution. + * + * On Mac OS X, the Mach exception implementation is fully supported using entirely public API. On iOS, + * the APIs required are not fully public -- more details on the implications of this for exception handling on + * iOS may be found in @ref mach_exceptions_ios below. It is worth noting that even where the Mach exception APIs + * are fully supported, kernel-internal constants, as well + * as architecture-specific trap information, may be required to fully interpret a Mach exception's root cause. + * + * For example, the EXC_SOFTWARE exception is dispatched for four different failure types, using the exception + * code to differentiate failure types: + * - Non-existent system call invoked (SIGSYS) + * - Write on a pipe with no reader (SIGPIPE) + * - Abort program (SIGABRT -- unused) + * - Kill program (SIGKILL) + * + * Of those four types, only the constant required to interpret the SIGKILL behavior (EXC_SOFT_SIGNAL) is publicly defined. + * Of the remaining three failure types, the constant values are kernel implementation-private, defined only in the available + * kernel sources. On iOS, these sources are unavailable, and while they generally do match the Mac OS X implementation, there + * are no gaurantees that this is -- or will remain -- the case in the future. + * + * Likewise, interpretation of particular fault types requires information regarding the underlying machine traps + * that triggered the Mach exceptions. For example, a floating point trap on x86/x86-64 will trigger an EXC_ARITHMETIC, + * with a subcode value containing the value of the FPU status register. Determining the exact FPU cause requires + * extracting the actual exception flags from status register as per the x86 architecture documentation. The exact format + * of this subcode value is not actually documented outside the kernel, and may change in future releases. + * + * While we have the advantage of access to the x86 kernel sources, the situation on ARM is even less clear. The actual + * use of the Mach exception codes and subcodes is largely undefined by both headers and publicly available documentation, + * and the available x86 kernel sources are of little use in interpreting this data. + * + * As such, while Mach exceptions may catch some cases that BSD signals can not, they are not a perfect solution, + * and may also provide less insight into the actual failures that occur. By comparison, the BSD signal interface + * is both fully defined and architecture independent, with any necessary interpretation of the Mach exception + * codes handled in-kernel at the time of exception dispatch. It is generally recommended by Apple as the preferred + * interface, and should generally be preferred by PLCrashReporter API clients. + * + * @section mach_exceptions_compatibility Compatibility Issues + * + * @subsection Debuggers + * + * Enabling in-process Mach exception handlers will conflict with any attached debuggers; the debugger + * may suspend the processes Mach exception handling thread, which will result in any exception messages + * sent via the debugger being lost, as the in-process handler will be unable to receive and forward + * the messages. + * + * @subsection Managed Runtimes (Xamarin, Unity) + * + * A Mach exception handler may conflict with any managed runtime that registers a BSD signal handler that + * can safely handle otherwise fatal signals, allowing execution to proceed. This includes products + * such as Xamarin for iOS. + * + * In such a case, PLCrashReporter will write a crash report for non-fatal signals, as there is no + * immediate mechanism for determining whether a signal handler exists and that it can safely + * handle the failure. This can result in unexpected delays in application execution, increased I/O to + * disk, and other undesirable operations. + * + * @section mach_exceptions_ios Mach Exceptions on iOS + * + * The APIs required for Mach exception handling are not fully public on iOS. After filing a request with + * Apple DTS to clarify the status of the Mach exception APIs on iOS, and implementing a Mach Exception + * handler using only supported API, they provided the following guidance: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited undefined API on iOS. The reporter + * may be excluded entirely at build time by modifying the PLCRASH_FEATURE_MACH_EXCEPTIONS build configuration; it + * may also be disabled at runtime by configuring the PLCrashReporter instance appropriately via PLCrashReporterConfig. + * + * The iOS implementation is implemented almost entirely using public API, and links against no actual private symbols; + * the use of undocumented functionality is limited to assuming the use of specific msgh_id values (see below + * for details). As a result, it may be considered perfectly safe to include the Mach Exception code in the + * standard build, and enable/disable it at runtime. + * + * The following issues exist in the iOS implementation: + * - The msgh_id values required for an exception reply message are not available from the available + * headers and must be hard-coded. This prevents one from safely replying to exception messages, which + * means that it is impossible to (correctly) inform the server that an exception has *not* been + * handled. + * + * Impact: + * This can lead to the process locking up and not dispatching to the host exception handler (eg, Apple's + * crash reporter), depending on the behavior of the kernel exception code. + * + * - The mach_* structure/type variants required by MACH_EXCEPTION_CODES are not publicly defined (on Mac OS X, + * these are provided by mach_exc.defs). This prevents one from forwarding exception messages to an existing + * handler that was registered with a MACH_EXCEPTION_CODES behavior (eg, forwarding is entirely non-functional + * on ARM64 devices). + * + * Impact: + * This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES, + * including other handlers registered within the current process, eg, by a managed runtime. This could + * also result in misinterpretation of a Mach exception message, in the case where the message format is + * modified by Apple to be incompatible with the existing 32-bit format. + * + * This is the case with LLDB; it will register a task exception handler with MACH_EXCEPTION_CODES set. Failure + * to correctly forward these exceptions will result in the debugger breaking in interesting ways; for example, + * changes to the set of dyld-loaded images are detected by setting a breakpoint on the dyld image registration + * funtions, and this functionality will break if the exception is not correctly forwarded. + * + * Since Mach exception handling is important for a fully functional crash reporter, we have also filed a radar + * to request that the API be made public: + * Radar: rdar://12939497 RFE: Provide mach_exc.defs for iOS + * + * At the time of this writing, the radar remains open/unresolved. + */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashFeatureConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashFeatureConfig.h new file mode 100644 index 0000000..7bcaebf --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashFeatureConfig.h @@ -0,0 +1,108 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_FEATURE_CONFIG_H +#define PLCRASH_FEATURE_CONFIG_H + +#include + +/** + * @internal + * + * Build-time configuration for PLCrashReporter. + * + * This is used to automatically enable/disable features on a per-platform and per-configuration + * basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter. + * + * @defgroup build_config Build Configuration + * @ingroup constants + * @{ + */ + +/* + * Defaults + */ + +/* + * For release builds, disable unused unwind implementations on targets that do not use them. For non-release + * builds, we include the unwind implementations to allow testing on a broader range of targets. + */ +#ifdef PLCF_RELEASE_BUILD +# if defined(__arm__) +# ifndef PLCRASH_FEATURE_UNWIND_DWARF +# define PLCRASH_FEATURE_UNWIND_DWARF 0 +# endif +# ifndef PLCRASH_FEATURE_UNWIND_COMPACT +# define PLCRASH_FEATURE_UNWIND_COMPACT 0 +# endif +# endif +#endif + +/* + * Configuration Flags + */ + + +#ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS +/** + * If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported, + * using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a + * popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either + * they've received special dispensation to use private APIs / private structures, they've found another way to do + * it, or they're just using undocumented functionality and hoping for the best. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled + * Mach exception handling by default, and provided both build-time and runtime configuration + * to disable its use. + * + * For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions. + */ +#if TARGET_OS_TV +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 0 +#else +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 1 +#endif +#endif + +#ifndef PLCRASH_FEATURE_UNWIND_DWARF +/** If true, enable DWARF unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_DWARF 1 +#endif + + +#ifndef PLCRASH_FEATURE_UNWIND_COMPACT +/** If true, enable compact unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_COMPACT 1 +#endif + +/* + * @} + */ + +#endif /* PLCRASH_FEATURE_CONFIG_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashMacros.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashMacros.h new file mode 100644 index 0000000..556e1c2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashMacros.h @@ -0,0 +1,143 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_CONSTANTS_H +#define PLCRASH_CONSTANTS_H + +#include +#include + +#if defined(__cplusplus) +# define PLCR_EXPORT extern "C" +# define PLCR_C_BEGIN_DECLS extern "C" { +# define PLCR_C_END_DECLS } +#else +# define PLCR_EXPORT extern +# define PLCR_C_BEGIN_DECLS +# define PLCR_C_END_DECLS +#endif + +#if defined(__cplusplus) +# define NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ +# define IS_EMPTY_(name) defined(NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ ## name) +# define IS_EMPTY(name) IS_EMPTY_(name) +# if defined(PLCRASHREPORTER_PREFIX) && !IS_EMPTY(PLCRASHREPORTER_PREFIX) + /** @internal Define the plcrash namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ +# define PLCR_CPP_BEGIN_NS namespace plcrash { inline namespace PLCRASHREPORTER_PREFIX { + + /** @internal Close the definition of the `plcrash` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ +# define PLCR_CPP_END_NS }} +# else +# define PLCR_CPP_BEGIN_NS namespace plcrash { +# define PLCR_CPP_END_NS } +# endif +#endif + +#ifdef __clang__ +# define PLCR_PRAGMA_CLANG(_p) _Pragma(_p) +#else +# define PLCR_PRAGMA_CLANG(_p) +#endif + +#ifdef __clang__ +# define PLCR_DEPRECATED __attribute__((deprecated)) +#else +# define PLCR_DEPRECATED +#endif + +#if defined(__clang__) || defined(__GNUC__) +# define PLCR_UNUSED __attribute__((unused)) +#else +# define PLCR_UNUSED +#endif + +#ifdef PLCR_PRIVATE +/** + * Marks a definition as deprecated only for for external clients, allowing + * uses of it internal fo the framework. + */ +# define PLCR_EXTERNAL_DEPRECATED + +/** + * @internal + * A macro to put above a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() \ + PLCR_PRAGMA_CLANG("clang diagnostic push"); \ + PLCR_PRAGMA_CLANG("clang diagnostic ignored \"-Wdocumentation-deprecated-sync\"") + +/** + * @internal + * A macro to put below a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_POP() PLCR_PRAGMA_CLANG("clang diagnostic pop") + +#else + +# define PLCR_EXTERNAL_DEPRECATED PLCR_DEPRECATED +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() + +#endif /* PLCR_PRIVATE */ + +#ifdef PLCR_PRIVATE +# if defined(__clang__) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") +# define PLCR_FALLTHROUGH [[clang::fallthrough]] +# else +# define PLCR_FALLTHROUGH do {} while (0) +# endif +#endif + +#ifdef PLCR_PRIVATE +/** + * @internal + * Static compile-time assertion. + * + * @param name The assertion name; must be valid for use within a C identifier. + * @param cond Assertion condition + */ +# define PLCR_ASSERT_STATIC(name, cond) PLCR_ASSERT_STATIC_(name, cond, __LINE__) +/* + * C++11 and C11 both provide a static_assert(). + * + * Otherwise, we have to use typedef-based static assertions. + */ +# if (defined(__cplusplus) && __cplusplus >= 201103L) || (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(#name, cond) +# define PLCR_ASSERT_STATIC__(name, cond) static_assert(cond, #name) +# else +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(name, cond, line) +# define PLCR_ASSERT_STATIC__(name, cond, line) typedef int plcf_static_assert_##name##_##line [(cond) ? 1 : -1] PLCR_UNUSED +# endif +#endif /* PLCR_PRIVATE */ + +#endif /* PLCRASH_CONSTANTS_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashNamespace.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashNamespace.h new file mode 100644 index 0000000..f4c263c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashNamespace.h @@ -0,0 +1,320 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +// #define PLCRASHREPORTER_PREFIX AcmeCo + + +// We need two extra layers of indirection to make CPP substitute +// the PLCRASHREPORTER_PREFIX define. +#define PLNS_impl2(prefix, symbol) prefix ## symbol +#define PLNS_impl(prefix, symbol) PLNS_impl2(prefix, symbol) +#define PLNS(symbol) PLNS_impl(PLCRASHREPORTER_PREFIX, symbol) + + +/* + * Rewrite all ObjC/C symbols. + * + * For C++ symbol handling, refer to the PLCR_CPP_BEGIN_NS and PLCR_CPP_END_NS + * macros. + */ +#ifdef PLCRASHREPORTER_PREFIX + +/* Objective-C Classes */ +#define PLCrashMachExceptionServer PLNS(PLCrashMachExceptionServer) +#define PLCrashReport PLNS(PLCrashReport) +#define PLCrashReportApplicationInfo PLNS(PLCrashReportApplicationInfo) +#define PLCrashReportBinaryImageInfo PLNS(PLCrashReportBinaryImageInfo) +#define PLCrashReportExceptionInfo PLNS(PLCrashReportExceptionInfo) +#define PLCrashReportMachExceptionInfo PLNS(PLCrashReportMachExceptionInfo) +#define PLCrashReportMachineInfo PLNS(PLCrashReportMachineInfo) +#define PLCrashReportProcessInfo PLNS(PLCrashReportProcessInfo) +#define PLCrashReportProcessorInfo PLNS(PLCrashReportProcessorInfo) +#define PLCrashReportRegisterInfo PLNS(PLCrashReportRegisterInfo) +#define PLCrashReportSignalInfo PLNS(PLCrashReportSignalInfo) +#define PLCrashReportStackFrameInfo PLNS(PLCrashReportStackFrameInfo) +#define PLCrashReportSymbolInfo PLNS(PLCrashReportSymbolInfo) +#define PLCrashReportSystemInfo PLNS(PLCrashReportSystemInfo) +#define PLCrashReportTextFormatter PLNS(PLCrashReportTextFormatter) +#define PLCrashReportThreadInfo PLNS(PLCrashReportThreadInfo) +#define PLCrashReporter PLNS(PLCrashReporter) +#define PLCrashSignalHandler PLNS(PLCrashSignalHandler) +#define PLCrashHostInfo PLNS(PLCrashHostInfo) +#define PLCrashMachExceptionPort PLNS(PLCrashMachExceptionPort) +#define PLCrashMachExceptionPortSet PLNS(PLCrashMachExceptionPortSet) +#define PLCrashProcessInfo PLNS(PLCrashProcessInfo) +#define PLCrashReporterConfig PLNS(PLCrashReporterConfig) +#define PLCrashUncaughtExceptionHandler PLNS(PLCrashUncaughtExceptionHandler) +#define PLCrashReportFormatter PLNS(PLCrashReportFormatter) + +/* Public C functions */ +#define PLCrashMachExceptionForward PLNS(PLCrashMachExceptionForward) +#define PLCrashSignalHandlerForward PLNS(PLCrashSignalHandlerForward) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) + + +/* Public C global symbols */ +#define PLCrashReporterErrorDomain PLNS(PLCrashReporterErrorDomain) +#define PLCrashReportHostArchitecture PLNS(PLCrashReportHostArchitecture) +#define PLCrashReportHostOperatingSystem PLNS(PLCrashReportHostOperatingSystem) +#define PLCrashReporterException PLNS(PLCrashReporterException) + +/* For backwards compatibility, plcrash_async_byteorder vends C++ methods when included under C++. We have + * to handle this distinctly from our PLCR_CPP_BEGIN_NS C++ namespacing mechanism. */ +#define plcrash_async_byteorder PLNS(plcrash_async_byteorder) + +/* + * All private C symbols. Once these are migrated to C++, we'll be able to use the much simpler + * PLCR_CPP_BEGIN_NS machinery. + * + * This list was automatically generated (and can be updated) by setting PLCRASHREPORTER_PREFIX to 'AcmeCo', + * building the library, and executing the following: + * nm -g -U | grep '^[0-9]' | c++filt | grep -v AcmeCo | grep -E '_pl|_PL' | awk '{print $3}' | cut -c 2- | sort | uniq | awk '{print "#define",$1,"PLNS("$1")"}' + */ +#define pl_mach_thread_self PLNS(pl_mach_thread_self) +#define plcrash__architecture__descriptor PLNS(plcrash__architecture__descriptor) +#define plcrash__crash_report__application_info__descriptor PLNS(plcrash__crash_report__application_info__descriptor) +#define plcrash__crash_report__application_info__init PLNS(plcrash__crash_report__application_info__init) +#define plcrash__crash_report__binary_image__descriptor PLNS(plcrash__crash_report__binary_image__descriptor) +#define plcrash__crash_report__binary_image__init PLNS(plcrash__crash_report__binary_image__init) +#define plcrash__crash_report__descriptor PLNS(plcrash__crash_report__descriptor) +#define plcrash__crash_report__exception__descriptor PLNS(plcrash__crash_report__exception__descriptor) +#define plcrash__crash_report__exception__init PLNS(plcrash__crash_report__exception__init) +#define plcrash__crash_report__free_unpacked PLNS(plcrash__crash_report__free_unpacked) +#define plcrash__crash_report__get_packed_size PLNS(plcrash__crash_report__get_packed_size) +#define plcrash__crash_report__init PLNS(plcrash__crash_report__init) +#define plcrash__crash_report__machine_info__descriptor PLNS(plcrash__crash_report__machine_info__descriptor) +#define plcrash__crash_report__machine_info__init PLNS(plcrash__crash_report__machine_info__init) +#define plcrash__crash_report__pack PLNS(plcrash__crash_report__pack) +#define plcrash__crash_report__pack_to_buffer PLNS(plcrash__crash_report__pack_to_buffer) +#define plcrash__crash_report__process_info__descriptor PLNS(plcrash__crash_report__process_info__descriptor) +#define plcrash__crash_report__process_info__init PLNS(plcrash__crash_report__process_info__init) +#define plcrash__crash_report__processor__descriptor PLNS(plcrash__crash_report__processor__descriptor) +#define plcrash__crash_report__processor__init PLNS(plcrash__crash_report__processor__init) +#define plcrash__crash_report__processor__type_encoding__descriptor PLNS(plcrash__crash_report__processor__type_encoding__descriptor) +#define plcrash__crash_report__report_info__descriptor PLNS(plcrash__crash_report__report_info__descriptor) +#define plcrash__crash_report__report_info__init PLNS(plcrash__crash_report__report_info__init) +#define plcrash__crash_report__signal__descriptor PLNS(plcrash__crash_report__signal__descriptor) +#define plcrash__crash_report__signal__init PLNS(plcrash__crash_report__signal__init) +#define plcrash__crash_report__signal__mach_exception__descriptor PLNS(plcrash__crash_report__signal__mach_exception__descriptor) +#define plcrash__crash_report__signal__mach_exception__init PLNS(plcrash__crash_report__signal__mach_exception__init) +#define plcrash__crash_report__symbol__descriptor PLNS(plcrash__crash_report__symbol__descriptor) +#define plcrash__crash_report__symbol__init PLNS(plcrash__crash_report__symbol__init) +#define plcrash__crash_report__system_info__descriptor PLNS(plcrash__crash_report__system_info__descriptor) +#define plcrash__crash_report__system_info__init PLNS(plcrash__crash_report__system_info__init) +#define plcrash__crash_report__system_info__operating_system__descriptor PLNS(plcrash__crash_report__system_info__operating_system__descriptor) +#define plcrash__crash_report__thread__descriptor PLNS(plcrash__crash_report__thread__descriptor) +#define plcrash__crash_report__thread__init PLNS(plcrash__crash_report__thread__init) +#define plcrash__crash_report__thread__register_value__descriptor PLNS(plcrash__crash_report__thread__register_value__descriptor) +#define plcrash__crash_report__thread__register_value__init PLNS(plcrash__crash_report__thread__register_value__init) +#define plcrash__crash_report__thread__stack_frame__descriptor PLNS(plcrash__crash_report__thread__stack_frame__descriptor) +#define plcrash__crash_report__thread__stack_frame__init PLNS(plcrash__crash_report__thread__stack_frame__init) +#define plcrash__crash_report__unpack PLNS(plcrash__crash_report__unpack) +#define plcrash_async_address_apply_offset PLNS(plcrash_async_address_apply_offset) +#define plcrash_async_byteorder_big_endian PLNS(plcrash_async_byteorder_big_endian) +#define plcrash_async_byteorder_direct PLNS(plcrash_async_byteorder_direct) +#define plcrash_async_byteorder_little_endian PLNS(plcrash_async_byteorder_little_endian) +#define plcrash_async_byteorder_swapped PLNS(plcrash_async_byteorder_swapped) +#define plcrash_async_cfe_entry_apply PLNS(plcrash_async_cfe_entry_apply) +#define plcrash_async_cfe_entry_free PLNS(plcrash_async_cfe_entry_free) +#define plcrash_async_cfe_entry_init PLNS(plcrash_async_cfe_entry_init) +#define plcrash_async_cfe_entry_register_count PLNS(plcrash_async_cfe_entry_register_count) +#define plcrash_async_cfe_entry_register_list PLNS(plcrash_async_cfe_entry_register_list) +#define plcrash_async_cfe_entry_return_address_register PLNS(plcrash_async_cfe_entry_return_address_register) +#define plcrash_async_cfe_entry_stack_adjustment PLNS(plcrash_async_cfe_entry_stack_adjustment) +#define plcrash_async_cfe_entry_stack_offset PLNS(plcrash_async_cfe_entry_stack_offset) +#define plcrash_async_cfe_entry_type PLNS(plcrash_async_cfe_entry_type) +#define plcrash_async_cfe_reader_find_pc PLNS(plcrash_async_cfe_reader_find_pc) +#define plcrash_async_cfe_reader_free PLNS(plcrash_async_cfe_reader_free) +#define plcrash_async_cfe_reader_init PLNS(plcrash_async_cfe_reader_init) +#define plcrash_async_cfe_register_decode PLNS(plcrash_async_cfe_register_decode) +#define plcrash_async_cfe_register_encode PLNS(plcrash_async_cfe_register_encode) +#define plcrash_async_file_close PLNS(plcrash_async_file_close) +#define plcrash_async_file_flush PLNS(plcrash_async_file_flush) +#define plcrash_async_file_init PLNS(plcrash_async_file_init) +#define plcrash_async_file_write PLNS(plcrash_async_file_write) +#define plcrash_async_find_symbol PLNS(plcrash_async_find_symbol) +#define plcrash_async_image_containing_address PLNS(plcrash_async_image_containing_address) +#define plcrash_async_image_list_next PLNS(plcrash_async_image_list_next) +#define plcrash_async_image_list_set_reading PLNS(plcrash_async_image_list_set_reading) +#define plcrash_async_mach_exception_get_siginfo PLNS(plcrash_async_mach_exception_get_siginfo) +#define plcrash_async_macho_byteorder PLNS(plcrash_async_macho_byteorder) +#define plcrash_async_macho_contains_address PLNS(plcrash_async_macho_contains_address) +#define plcrash_async_macho_cpu_subtype PLNS(plcrash_async_macho_cpu_subtype) +#define plcrash_async_macho_cpu_type PLNS(plcrash_async_macho_cpu_type) +#define plcrash_async_macho_find_command PLNS(plcrash_async_macho_find_command) +#define plcrash_async_macho_find_segment_cmd PLNS(plcrash_async_macho_find_segment_cmd) +#define plcrash_async_macho_find_symbol_by_name PLNS(plcrash_async_macho_find_symbol_by_name) +#define plcrash_async_macho_find_symbol_by_pc PLNS(plcrash_async_macho_find_symbol_by_pc) +#define plcrash_async_macho_header PLNS(plcrash_async_macho_header) +#define plcrash_async_macho_header_size PLNS(plcrash_async_macho_header_size) +#define plcrash_async_macho_map_section PLNS(plcrash_async_macho_map_section) +#define plcrash_async_macho_map_segment PLNS(plcrash_async_macho_map_segment) +#define plcrash_async_macho_mapped_segment_free PLNS(plcrash_async_macho_mapped_segment_free) +#define plcrash_async_macho_next_command PLNS(plcrash_async_macho_next_command) +#define plcrash_async_macho_next_command_type PLNS(plcrash_async_macho_next_command_type) +#define plcrash_async_macho_string_free PLNS(plcrash_async_macho_string_free) +#define plcrash_async_macho_string_get_length PLNS(plcrash_async_macho_string_get_length) +#define plcrash_async_macho_string_get_pointer PLNS(plcrash_async_macho_string_get_pointer) +#define plcrash_async_macho_string_init PLNS(plcrash_async_macho_string_init) +#define plcrash_async_macho_symtab_reader_free PLNS(plcrash_async_macho_symtab_reader_free) +#define plcrash_async_macho_symtab_reader_init PLNS(plcrash_async_macho_symtab_reader_init) +#define plcrash_async_macho_symtab_reader_read PLNS(plcrash_async_macho_symtab_reader_read) +#define plcrash_async_macho_symtab_reader_symbol_name PLNS(plcrash_async_macho_symtab_reader_symbol_name) +#define plcrash_async_memcpy PLNS(plcrash_async_memcpy) +#define plcrash_async_memset PLNS(plcrash_async_memset) +#define plcrash_async_mobject_base_address PLNS(plcrash_async_mobject_base_address) +#define plcrash_async_mobject_free PLNS(plcrash_async_mobject_free) +#define plcrash_async_mobject_init PLNS(plcrash_async_mobject_init) +#define plcrash_async_mobject_length PLNS(plcrash_async_mobject_length) +#define plcrash_async_mobject_read_uint16 PLNS(plcrash_async_mobject_read_uint16) +#define plcrash_async_mobject_read_uint32 PLNS(plcrash_async_mobject_read_uint32) +#define plcrash_async_mobject_read_uint64 PLNS(plcrash_async_mobject_read_uint64) +#define plcrash_async_mobject_read_uint8 PLNS(plcrash_async_mobject_read_uint8) +#define plcrash_async_mobject_remap_address PLNS(plcrash_async_mobject_remap_address) +#define plcrash_async_mobject_task PLNS(plcrash_async_mobject_task) +#define plcrash_async_mobject_verify_local_pointer PLNS(plcrash_async_mobject_verify_local_pointer) +#define plcrash_async_objc_cache_free PLNS(plcrash_async_objc_cache_free) +#define plcrash_async_objc_cache_init PLNS(plcrash_async_objc_cache_init) +#define plcrash_async_objc_find_method PLNS(plcrash_async_objc_find_method) +#define plcrash_async_signal_sigcode PLNS(plcrash_async_signal_sigcode) +#define plcrash_async_signal_signame PLNS(plcrash_async_signal_signame) +#define plcrash_async_strcmp PLNS(plcrash_async_strcmp) +#define plcrash_async_strerror PLNS(plcrash_async_strerror) +#define plcrash_async_strncmp PLNS(plcrash_async_strncmp) +#define plcrash_async_symbol_cache_free PLNS(plcrash_async_symbol_cache_free) +#define plcrash_async_symbol_cache_init PLNS(plcrash_async_symbol_cache_init) +#define plcrash_async_task_memcpy PLNS(plcrash_async_task_memcpy) +#define plcrash_async_task_read_uint16 PLNS(plcrash_async_task_read_uint16) +#define plcrash_async_task_read_uint32 PLNS(plcrash_async_task_read_uint32) +#define plcrash_async_task_read_uint64 PLNS(plcrash_async_task_read_uint64) +#define plcrash_async_task_read_uint8 PLNS(plcrash_async_task_read_uint8) +#define plcrash_async_thread_state_clear_all_regs PLNS(plcrash_async_thread_state_clear_all_regs) +#define plcrash_async_thread_state_clear_reg PLNS(plcrash_async_thread_state_clear_reg) +#define plcrash_async_thread_state_clear_volatile_regs PLNS(plcrash_async_thread_state_clear_volatile_regs) +#define plcrash_async_thread_state_copy PLNS(plcrash_async_thread_state_copy) +#define plcrash_async_thread_state_current PLNS(plcrash_async_thread_state_current) +#define plcrash_async_thread_state_current_stub PLNS(plcrash_async_thread_state_current_stub) +#define plcrash_async_thread_state_get_greg_size PLNS(plcrash_async_thread_state_get_greg_size) +#define plcrash_async_thread_state_get_reg PLNS(plcrash_async_thread_state_get_reg) +#define plcrash_async_thread_state_get_reg_count PLNS(plcrash_async_thread_state_get_reg_count) +#define plcrash_async_thread_state_get_reg_name PLNS(plcrash_async_thread_state_get_reg_name) +#define plcrash_async_thread_state_get_stack_direction PLNS(plcrash_async_thread_state_get_stack_direction) +#define plcrash_async_thread_state_has_reg PLNS(plcrash_async_thread_state_has_reg) +#define plcrash_async_thread_state_init PLNS(plcrash_async_thread_state_init) +#define plcrash_async_thread_state_mach_thread_init PLNS(plcrash_async_thread_state_mach_thread_init) +#define plcrash_async_thread_state_map_dwarf_to_reg PLNS(plcrash_async_thread_state_map_dwarf_to_reg) +#define plcrash_async_thread_state_map_reg_to_dwarf PLNS(plcrash_async_thread_state_map_reg_to_dwarf) +#define plcrash_async_thread_state_mcontext_init PLNS(plcrash_async_thread_state_mcontext_init) +#define plcrash_async_thread_state_set_reg PLNS(plcrash_async_thread_state_set_reg) +#define plcrash_async_writen PLNS(plcrash_async_writen) +#define plcrash_log_writer_close PLNS(plcrash_log_writer_close) +#define plcrash_log_writer_free PLNS(plcrash_log_writer_free) +#define plcrash_log_writer_init PLNS(plcrash_log_writer_init) +#define plcrash_log_writer_set_exception PLNS(plcrash_log_writer_set_exception) +#define plcrash_log_writer_write PLNS(plcrash_log_writer_write) +#define plcrash_log_writer_set_custom_data PLNS(plcrash_log_writer_set_custom_data) +#define plcrash_nasync_image_list_append PLNS(plcrash_nasync_image_list_append) +#define plcrash_nasync_image_list_free PLNS(plcrash_nasync_image_list_free) +#define plcrash_nasync_image_list_init PLNS(plcrash_nasync_image_list_init) +#define plcrash_nasync_image_list_remove PLNS(plcrash_nasync_image_list_remove) +#define plcrash_nasync_macho_free PLNS(plcrash_nasync_macho_free) +#define plcrash_nasync_macho_init PLNS(plcrash_nasync_macho_init) +#define plcrash_populate_error PLNS(plcrash_populate_error) +#define plcrash_populate_mach_error PLNS(plcrash_populate_mach_error) +#define plcrash_populate_posix_error PLNS(plcrash_populate_posix_error) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) +#define plcrash_sysctl_int PLNS(plcrash_sysctl_int) +#define plcrash_sysctl_string PLNS(plcrash_sysctl_string) +#define plcrash_sysctl_valid_utf8_bytes PLNS(plcrash_sysctl_valid_utf8_bytes) +#define plcrash_sysctl_valid_utf8_bytes_max PLNS(plcrash_sysctl_valid_utf8_bytes_max) +#define plcrash_writer_pack PLNS(plcrash_writer_pack) +#define plframe_cursor_free PLNS(plframe_cursor_free) +#define plframe_cursor_get_reg PLNS(plframe_cursor_get_reg) +#define plframe_cursor_get_regcount PLNS(plframe_cursor_get_regcount) +#define plframe_cursor_get_regname PLNS(plframe_cursor_get_regname) +#define plframe_cursor_init PLNS(plframe_cursor_init) +#define plframe_cursor_next PLNS(plframe_cursor_next) +#define plframe_cursor_next_with_readers PLNS(plframe_cursor_next_with_readers) +#define plframe_cursor_read_compact_unwind PLNS(plframe_cursor_read_compact_unwind) +#define plframe_cursor_read_dwarf_unwind PLNS(plframe_cursor_read_dwarf_unwind) +#define plframe_cursor_read_frame_ptr PLNS(plframe_cursor_read_frame_ptr) +#define plframe_cursor_thread_init PLNS(plframe_cursor_thread_init) +#define plframe_strerror PLNS(plframe_strerror) + +#endif + +/* + * The following symbols are exported by the protobuf-c library. When building + * a shared library, we can hide these as private symbols. + * + * However, when building a static library, we can only do so if we use + * MH_OBJECT "single object prelink". The MH_OBJECT approach allows us to apply + * symbol hiding/aliasing/etc similar to that supported by dylibs, but because it is + * seemingly unused within Apple, the use thereof regularly introduces linking bugs + * and errors in new Xcode releases. + * + * Rather than fighting the linker, we use the namespacing machinery to rewrite these + * symbols, but only when explicitly compiling PLCrashReporter. Since protobuf-c is a library + * that may be used elsewhere, we don't want to rewrite these symbols if they're used + * independently by PLCrashReporter API clients. + */ +#ifdef PLCR_PRIVATE + /* If no prefix has been defined, we need to specify our own private prefix */ +# ifndef PLCRASHREPORTER_PREFIX +# define PLCRASHREPORTER_PREFIX PL_ +# endif + +# define protobuf_c_buffer_simple_append PLNS(protobuf_c_buffer_simple_append) +# define protobuf_c_empty_string PLNS(protobuf_c_empty_string) +# define protobuf_c_enum_descriptor_get_value PLNS(protobuf_c_enum_descriptor_get_value) +# define protobuf_c_enum_descriptor_get_value_by_name PLNS(protobuf_c_enum_descriptor_get_value_by_name) +# define protobuf_c_message_check PLNS(protobuf_c_message_check) +# define protobuf_c_message_descriptor_get_field PLNS(protobuf_c_message_descriptor_get_field) +# define protobuf_c_message_descriptor_get_field_by_name PLNS(protobuf_c_message_descriptor_get_field_by_name) +# define protobuf_c_message_free_unpacked PLNS(protobuf_c_message_free_unpacked) +# define protobuf_c_message_get_packed_size PLNS(protobuf_c_message_get_packed_size) +# define protobuf_c_message_init PLNS(protobuf_c_message_init) +# define protobuf_c_message_pack PLNS(protobuf_c_message_pack) +# define protobuf_c_message_pack_to_buffer PLNS(protobuf_c_message_pack_to_buffer) +# define protobuf_c_message_unpack PLNS(protobuf_c_message_unpack) +# define protobuf_c_service_descriptor_get_method_by_name PLNS(protobuf_c_service_descriptor_get_method_by_name) +# define protobuf_c_service_destroy PLNS(protobuf_c_service_destroy) +# define protobuf_c_service_generated_init PLNS(protobuf_c_service_generated_init) +# define protobuf_c_service_invoke_internal PLNS(protobuf_c_service_invoke_internal) +# define protobuf_c_version PLNS(protobuf_c_version) +# define protobuf_c_version_number PLNS(protobuf_c_version_number) +#endif /* PLCR_PRIVATE */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReport.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReport.h new file mode 100644 index 0000000..f710c3f --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReport.h @@ -0,0 +1,230 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_H +#define PLCRASH_REPORT_H + +#if __has_include() +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#else +#import "PLCrashReportApplicationInfo.h" +#import "PLCrashReportBinaryImageInfo.h" +#import "PLCrashReportExceptionInfo.h" +#import "PLCrashReportMachineInfo.h" +#import "PLCrashReportMachExceptionInfo.h" +#import "PLCrashReportProcessInfo.h" +#import "PLCrashReportProcessorInfo.h" +#import "PLCrashReportRegisterInfo.h" +#import "PLCrashReportSignalInfo.h" +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportSymbolInfo.h" +#import "PLCrashReportSystemInfo.h" +#import "PLCrashReportThreadInfo.h" +#endif + +/** + * @ingroup constants + * Crash file magic identifier */ +#define PLCRASH_REPORT_FILE_MAGIC "plcrash" + +/** + * @ingroup constants + * Crash format version byte identifier. Will not change outside of the introduction of + * an entirely new crash log format. */ +#define PLCRASH_REPORT_FILE_VERSION 1 + +/** + * @ingroup types + * Crash log file header format. + * + * Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC), + * followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION). + * The crash log message format itself is extensible, so this version number will only + * be incremented in the event of an incompatible encoding or format change. + */ +struct PLCrashReportFileHeader { + /** Crash log magic identifier, not NULL terminated */ + const char magic[7]; + + /** Crash log encoding/format version */ + const uint8_t version; + + /** File data */ + const uint8_t data[]; +} __attribute__((packed)); + + +/** + * @internal + * Private decoder instance variables (used to hide the underlying protobuf parser). + */ +typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; + +@interface PLCrashReport : NSObject { +@private + /** Private implementation variables (used to hide the underlying protobuf parser) */ + _PLCrashReportDecoder *_decoder; + + /** System info */ + __strong PLCrashReportSystemInfo *_systemInfo; + + /** Machine info */ + __strong PLCrashReportMachineInfo *_machineInfo; + + /** Application info */ + __strong PLCrashReportApplicationInfo *_applicationInfo; + + /** Process info */ + __strong PLCrashReportProcessInfo *_processInfo; + + /** Signal info */ + __strong PLCrashReportSignalInfo *_signalInfo; + + /** Mach exception info */ + __strong PLCrashReportMachExceptionInfo *_machExceptionInfo; + + /** Thread info (PLCrashReportThreadInfo instances) */ + __strong NSArray *_threads; + + /** Binary images (PLCrashReportBinaryImageInfo instances */ + __strong NSArray *_images; + + /** Exception information (may be nil) */ + __strong PLCrashReportExceptionInfo *_exceptionInfo; + + /** User defined information (may be nil) */ + __strong NSData *_customData; + + /** Report UUID */ + CFUUIDRef _uuid; +} + +- (id) initWithData: (NSData *) encodedData error: (NSError **) outError; + +- (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address; + +/** + * System information. + */ +@property(nonatomic, readonly, strong) PLCrashReportSystemInfo *systemInfo; + +/** + * YES if machine information is available. + */ +@property(nonatomic, readonly) BOOL hasMachineInfo; + +/** + * Machine information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachineInfo *machineInfo; + +/** + * Application information. + */ +@property(nonatomic, readonly, strong) PLCrashReportApplicationInfo *applicationInfo; + +/** + * YES if process information is available. + */ +@property(nonatomic, readonly) BOOL hasProcessInfo; + +/** + * Process information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessInfo *processInfo; + +/** + * Signal information. This provides the signal and signal code of the fatal signal. + */ +@property(nonatomic, readonly, strong) PLCrashReportSignalInfo *signalInfo; + +/** + * Mach exception information, if available. This will only be included in the + * case that encoding crash reporter's exception-based reporting was enabled, and a Mach + * exception was caught. + * + * @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this + * s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the + * Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal + * mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachExceptionInfo *machExceptionInfo; + +/** + * Thread information. Returns a list of PLCrashReportThreadInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *threads; + +/** + * Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *images; + +/** + * YES if exception information is available. + */ +@property(nonatomic, readonly) BOOL hasExceptionInfo; + +/** + * Exception information. Only available if a crash was caused by an uncaught exception, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportExceptionInfo *exceptionInfo; + +/** + * Custom user data. Only available if user explicitly assigned it before crash happened, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) NSData *customData; + +/** + * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated + * by a single client. Only available in later (v1.2+) crash report format versions. If not available, + * will be NULL. + */ +@property(nonatomic, readonly) CFUUIDRef uuidRef; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h new file mode 100644 index 0000000..787a286 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h @@ -0,0 +1,62 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportApplicationInfo : NSObject { +@private + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; +} + +- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier + applicationVersion: (NSString *) applicationVersion + applicationMarketingVersion: (NSString *) applicationMarketingVersion; + +/** + * The application identifier. This is usually the application's CFBundleIdentifier value. + */ +@property(nonatomic, readonly, strong) NSString *applicationIdentifier; + +/** + * The application version. This is usually the application's CFBundleVersion value. + */ +@property(nonatomic, readonly, strong) NSString *applicationVersion; + +/** + * The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil. + */ +@property(nonatomic, readonly, strong) NSString *applicationMarketingVersion; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h new file mode 100644 index 0000000..1a75051 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h @@ -0,0 +1,95 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportBinaryImageInfo : NSObject { +@private + /** Code type */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /** Base image address */ + uint64_t _baseAddress; + + /** Image segment size */ + uint64_t _imageSize; + + /** Name of binary image */ + __strong NSString *_imageName; + + /** If the UUID is available */ + BOOL _hasImageUUID; + + /** 128-bit object UUID. May be nil. */ + __strong NSString *_imageUUID; +} + +- (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo + baseAddress: (uint64_t) baseAddress + size: (uint64_t) imageSize + name: (NSString *) imageName + uuid: (NSData *) uuid; + +/** + * Image code type, or nil if unavailable. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *codeType; + +/** + * Image base address. + */ +@property(nonatomic, readonly) uint64_t imageBaseAddress; + +/** + * Segment size. + */ +@property(nonatomic, readonly) uint64_t imageSize; + +/** + * Image name (absolute path) + */ +@property(nonatomic, readonly, strong) NSString *imageName; + + +/** + * YES if this image has an associated UUID. + */ +@property(nonatomic, readonly) BOOL hasImageUUID; + +/** + * 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable. + */ +@property(nonatomic, readonly, strong) NSString *imageUUID; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h new file mode 100644 index 0000000..7423ca9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h @@ -0,0 +1,69 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportThreadInfo.h" +#endif + +@interface PLCrashReportExceptionInfo : NSObject { +@private + /** Name */ + __strong NSString *_name; + + /** Reason */ + __strong NSString *_reason; + + /** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */ + __strong NSArray *_stackFrames; +} + +- (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason; + +- (id) initWithExceptionName: (NSString *) name + reason: (NSString *) reason + stackFrames: (NSArray *) stackFrames; + +/** + * The exception name. + */ +@property(nonatomic, readonly, strong) NSString *exceptionName; + +/** + * The exception reason. + */ +@property(nonatomic, readonly, strong) NSString *exceptionReason; + +/* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable. + * This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportFormatter.h new file mode 100644 index 0000000..5cdf01b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportFormatter.h @@ -0,0 +1,55 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReport.h" +#endif + +/** + * A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules, + * (such as implementing text output support), and returns the result. + */ +@protocol PLCrashReportFormatter + +/** + * Format the provided @a report. + * + * @param report Report to be formatted. + * @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error + * object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will + * be left unmodified. You may specify nil for this parameter, and no error information will be provided. + * + * @return Returns the formatted report data on success, or nil on failure. + */ +- (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h new file mode 100644 index 0000000..19461a5 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h @@ -0,0 +1,48 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportMachExceptionInfo : NSObject { +@private + /** The Mach exception type. */ + uint64_t _type; + + /** The Mach exception codes, represented as an ordered array of NSNumber instances. */ + __strong NSArray *_codes; +} + +- (id) initWithType: (uint64_t) type codes: (NSArray *) codes; + +/** The Mach exception type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */ +@property(nonatomic, readonly, strong) NSArray *codes; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h new file mode 100644 index 0000000..ab6fee9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h @@ -0,0 +1,77 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportMachineInfo : NSObject { +@private + /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ + __strong NSString *_modelName; + + /** The processor type. */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /* The number of actual physical processor cores. */ + NSUInteger _processorCount; + + /* The number of logical processors. */ + NSUInteger _logicalProcessorCount; +} + +- (id) initWithModelName: (NSString *) modelName + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + processorCount: (NSUInteger) processorCount + logicalProcessorCount: (NSUInteger) logicalProcessorCount; + +/** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *modelName; + +/** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +/* + * The number of actual physical processor cores. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger processorCount; + +/* + * The number of logical processors. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger logicalProcessorCount; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h new file mode 100644 index 0000000..802e8d4 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h @@ -0,0 +1,103 @@ +/* + * Author: Damian Morris + * + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportProcessInfo : NSObject { +@private + /** Process name, or nil if unavailable. */ + __strong NSString *_processName; + + /** Process ID */ + NSUInteger _processID; + + /** Process path */ + __strong NSString* _processPath; + + /** Date and time that the crashing process was started. This may be unavailable, and this property + * will be nil. */ + __strong NSDate *_processStartTime; + + /** Parent process name, or nil if unavailable. */ + __strong NSString *_parentProcessName; + + /** Parent process ID */ + NSUInteger _parentProcessID; + + /** If false, the process is being run via process-level CPU emulation (such as Rosetta). */ + BOOL _native; +} + +- (id) initWithProcessName: (NSString *) processName + processID: (NSUInteger) processID + processPath: (NSString *) processPath + processStartTime: (NSDate *) processStartTime + parentProcessName: (NSString *) parentProcessName + parentProcessID: (NSUInteger) parentProcessID + native: (BOOL) native; + +/** + * The process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processName; + +/** + * The process ID. + */ +@property(nonatomic, readonly) NSUInteger processID; + +/** + * The path to the process executable. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processPath; + +/** + * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSDate *processStartTime; + +/** + * The parent process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *parentProcessName; + +/** + * The parent process ID. + */ +@property(nonatomic, readonly) NSUInteger parentProcessID; + +/** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */ +@property(nonatomic, readonly) BOOL native; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h new file mode 100644 index 0000000..03d570b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h @@ -0,0 +1,74 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +/** + * @ingroup constants + * + * The type encodings supported for CPU types and subtypes. Currently only Apple + * Mach-O defined encodings are supported. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Unknown cpu type encoding. */ + PLCrashReportProcessorTypeEncodingUnknown = 0, + + /** Apple Mach-defined processor types. */ + PLCrashReportProcessorTypeEncodingMach = 1 +} PLCrashReportProcessorTypeEncoding; + +@interface PLCrashReportProcessorInfo : NSObject { +@private + /** Type encoding */ + PLCrashReportProcessorTypeEncoding _typeEncoding; + + /** CPU type */ + uint64_t _type; + + /** CPU subtype */ + uint64_t _subtype; +} + +- (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding + type: (uint64_t) type + subtype: (uint64_t) subtype; + +/** The CPU type encoding. */ +@property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding; + +/** The CPU type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The CPU subtype. */ +@property(nonatomic, readonly) uint64_t subtype; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h new file mode 100644 index 0000000..e0a1ca1 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportRegisterInfo : NSObject { +@private + /** Register name */ + __strong NSString *_registerName; + + /** Register value */ + uint64_t _registerValue; +} + +- (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; + +/** + * Register name. + */ +@property(nonatomic, readonly, strong) NSString *registerName; + +/** + * Register value. + */ +@property(nonatomic, readonly) uint64_t registerValue; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h new file mode 100644 index 0000000..d949211 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h @@ -0,0 +1,60 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSignalInfo : NSObject { +@private + /** Signal name */ + __strong NSString *_name; + + /** Signal code */ + __strong NSString *_code; + + /** Fauling instruction or address */ + uint64_t _address; +} + +- (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address; + +/** + * The signal name. + */ +@property(nonatomic, readonly, strong) NSString *name; + +/** + * The signal code. + */ +@property(nonatomic, readonly, strong) NSString *code; + +/** + * The faulting instruction or address. + */ +@property(nonatomic, readonly) uint64_t address; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000..5fd4acc --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,57 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportSymbolInfo.h" +#endif + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + __strong PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000..bdb367c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + __strong NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly, strong) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h new file mode 100644 index 0000000..eb8a447 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h @@ -0,0 +1,177 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashMacros.h" +#endif + +@class PLCrashReportProcessorInfo; + +/** + * @ingroup constants + * + * Indicates the Operating System under which a Crash Log was generated. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Mac OS X. */ + PLCrashReportOperatingSystemMacOSX = 0, + + /** iPhone OS */ + PLCrashReportOperatingSystemiPhoneOS = 1, + + /** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */ + PLCrashReportOperatingSystemiPhoneSimulator = 2, + + /** Unknown operating system */ + PLCrashReportOperatingSystemUnknown = 3, + + /** Apple tvOS */ + PLCrashReportOperatingSystemAppleTVOS = 4, + +} PLCrashReportOperatingSystem; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** + * @ingroup constants + * + * Indicates the architecture under which a Crash Log was generated. + * + * @note The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * will make use of the new PLCrashReportProcessorInfo CPU type encodings. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** x86-32. */ + PLCrashReportArchitectureX86_32 = 0, + + /** x86-64 */ + PLCrashReportArchitectureX86_64 = 1, + + /** ARMv6 */ + PLCrashReportArchitectureARMv6 = 2, + + /** + * ARMv6 + * @deprecated This value has been deprecated in favor of ARM subtype-specific + * values. + * @sa PLCrashReportArchitectureARMv6 + */ + PLCrashReportArchitectureARM PLCR_DEPRECATED = PLCrashReportArchitectureARMv6, + + /** PPC */ + PLCrashReportArchitecturePPC = 3, + + /** PPC64 */ + PLCrashReportArchitecturePPC64 = 4, + + /** ARMv7 */ + PLCrashReportArchitectureARMv7 = 5, + + /** Unknown */ + PLCrashReportArchitectureUnknown = 6 +} PLCrashReportArchitecture; +#pragma clang diagnostic pop + +extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); +extern PLCrashReportArchitecture PLCrashReportHostArchitecture PLCR_EXTERNAL_DEPRECATED; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); + +@interface PLCrashReportSystemInfo : NSObject { +@private + /** Operating system */ + PLCrashReportOperatingSystem _operatingSystem; + + /** Operating system version */ + __strong NSString *_osVersion; + + /** OS build. May be nil. */ + __strong NSString *_osBuild; + + /** Architecture */ + PLCrashReportArchitecture _architecture; + + /** Date crash report was generated. May be nil if the date is unknown. */ + __strong NSDate *_timestamp; + + /** Processor information. */ + __strong PLCrashReportProcessorInfo *_processorInfo; +} + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + timestamp: (NSDate *) timestamp; + +/** The operating system. */ +@property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem; + +/** The operating system's release version. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemVersion; + +/** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemBuild; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo + * extensible encoding. */ +@property(nonatomic, readonly) PLCrashReportArchitecture architecture PLCR_DEPRECATED; + +/** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSDate *timestamp; + +/** The processor type. For v1.2 reports and later, this is an alias to the machine info's processorInfo. + * For earlier reports, this will be synthesized from the deprecated architecture property. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h new file mode 100644 index 0000000..adbc251 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h @@ -0,0 +1,66 @@ +/* + * Authors: + * Landon Fuller + * Damian Morris + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportFormatter.h" +#endif + +/** + * Supported text output formats. + * + * @ingroup enums + */ +typedef enum { + /** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available + * through iTunes Connect. */ + PLCrashReportTextFormatiOS = 0 +} PLCrashReportTextFormat; + + +@interface PLCrashReportTextFormatter : NSObject { +@private + /** Text output format. */ + PLCrashReportTextFormat _textFormat; + + /** Encoding to use for string output. */ + NSStringEncoding _stringEncoding; +} + ++ (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat; + +- (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h new file mode 100644 index 0000000..b9092e2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h @@ -0,0 +1,88 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_THREAD_INFO_H +#define PLCRASH_REPORT_THREAD_INFO_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportRegisterInfo.h" +#endif + + +@interface PLCrashReportThreadInfo : NSObject { +@private + /** The thread number. Should be unique within a given crash log. */ + NSInteger _threadNumber; + + /** Ordered list of PLCrashReportStackFrame instances */ + __strong NSArray *_stackFrames; + + /** YES if this thread crashed. */ + BOOL _crashed; + + /** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */ + __strong NSArray *_registers; +} + +- (id) initWithThreadNumber: (NSInteger) threadNumber + stackFrames: (NSArray *) stackFrames + crashed: (BOOL) crashed + registers: (NSArray *) registers; + +/** + * Application thread number. + */ +@property(nonatomic, readonly) NSInteger threadNumber; + +/** + * Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances. + * The array is ordered, last callee to first. + */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +/** + * If this thread crashed, set to YES. + */ +@property(nonatomic, readonly) BOOL crashed; + +/** + * State of the general purpose and related registers, as a list of + * PLCrashReportRegister instances. If this thead did not crash (crashed returns NO), + * this list will be empty. + */ +@property(nonatomic, readonly, strong) NSArray *registers; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReporter.h new file mode 100644 index 0000000..bdc8f83 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReporter.h @@ -0,0 +1,159 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +#ifndef PLCRASH_REPORTER_H +#define PLCRASH_REPORTER_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReporterConfig.h" +#import "PLCrashMacros.h" +#endif + +@class PLCrashMachExceptionServer; +@class PLCrashMachExceptionPortSet; + +/** + * @ingroup functions + * + * Prototype of a callback function used to execute additional user code with signal information as provided + * by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk. + * + * @param info The signal info. + * @param uap The crash's threads context. + * @param context The API client's supplied context value. + * + * @sa The @ref async_safety documentation. + * @sa PLCrashReporter::setPostCrashCallbacks: + */ +typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context); + +/** + * @ingroup types + * + * This structure contains callbacks supported by PLCrashReporter to allow the host application to perform + * additional tasks prior to program termination after a crash has occurred. + * + * @sa The @ref async_safety documentation. + */ +typedef struct PLCrashReporterCallbacks { + /** The version number of this structure. If not one of the defined version numbers for this type, the behavior + * is undefined. The current version of this structure is 0. */ + uint16_t version; + + /** An arbitrary user-supplied context value. This value may be NULL. */ + void *context; + + /** + * The callback used to report caught signal information. In version 0 of this structure, all crashes will be + * reported via this function. + * + * @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived + * from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via + * PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will + * not provide valid thread state. + * + * This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained + * here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions. + */ + PLCrashReporterPostCrashSignalCallback handleSignal; +} PLCrashReporterCallbacks; + +@interface PLCrashReporter : NSObject { +@private + /** Reporter configuration */ + __strong PLCrashReporterConfig *_config; + + /** YES if the crash reporter has been enabled */ + BOOL _enabled; + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if + * the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */ + __strong PLCrashMachExceptionServer *_machServer; + + /** Previously registered Mach exception ports, if any. */ + __strong PLCrashMachExceptionPortSet *_previousMachPorts; +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ + + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; + + /** Path to the crash reporter internal data directory */ + __strong NSString *_crashReportDirectory; +} + ++ (PLCrashReporter *) sharedReporter PLCR_DEPRECATED; + +- (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config; + +- (BOOL) hasPendingCrashReport; + +- (NSData *) loadPendingCrashReportData; +- (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; + +- (NSData *) generateLiveReportWithThread: (thread_t) thread; +- (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; +- (NSData *) generateLiveReportWithThread: (thread_t) thread exception: (NSException *) exception error: (NSError **) outError; + +- (NSData *) generateLiveReport; +- (NSData *) generateLiveReportAndReturnError: (NSError **) outError; +- (NSData *) generateLiveReportWithException: (NSException *) exception error: (NSError **) outError; + +- (BOOL) purgePendingCrashReport; +- (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; + +- (BOOL) enableCrashReporter; +- (BOOL) enableCrashReporterAndReturnError: (NSError **) outError; + +- (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks; + +/** + * Return the path to live crash report (which may not yet, or ever, exist). + */ +- (NSString *) crashReportPath; + +/** + * Custom data to save in the crash report. + */ +@property(nonatomic, strong) NSData *customData; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReporterConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReporterConfig.h new file mode 100644 index 0000000..f151e56 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReporterConfig.h @@ -0,0 +1,197 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashFeatureConfig.h" +#endif + +/** + * @ingroup enums + * Supported mechanisms for trapping and handling crashes. + */ +typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) { + /** + * Trap fatal signals via a sigaction(2)-registered BSD signal handler. + * + * PLCrashReporter's signal handler will supersede previously registered handlers; existing + * handlers will not be called. This behavior may be modified in a future release, and should + * not be relied upon as a mechanism to prevent existing signal handlers from being called. + * + * There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically: + * + * - On Mac OS X, stack overflows will only be handled on the thread on which + * the crash reporter was initialized. This should generally be the main thread. + * - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being + * non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS). + * - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting + * in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal + * handlers prior to raising SIGABRT). These __abort()-based checks are: + * - Implemented for unsafe memcpy/strcpy/snprintf C functions. + * - Only enabled when operating on a fixed-width target buffer (in which case the + * compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument). + * - Only trigger in the case that the source data exceeds the size of the fixed width target + * buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy), + * or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer), + * AND that argument can't be checked at compile-time. + */ + PLCrashReporterSignalHandlerTypeBSD = 0, + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** + * Trap fatal signals via a Mach exception server. + * + * If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that + * exception handler. Should the exceptions be handled by an existing handler, no report will be generated + * by PLCrashReporter. + * + * @par Mac OS X + * + * On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note, + * however, that some kernel-internal constants, as well as architecture-specific trap information, + * may be required to fully interpret a Mach exception's root cause. + * + * @par iOS + * + * On iOS, the APIs required for a complete implementation are not fully public. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included + * Mach exception handling as an optional feature, with both build-time and runtime configuration + * to disable its inclusion or use, respectively. + * + * @par Debugger Incompatibility + * + * The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to + * suspend all active threads (which will include the Mach exception handler). Mach-based handling + * should not be used when a debugger is attached. + * + * @par More Details + * + * For more information, refer to @ref mach_exceptions. + */ + PLCrashReporterSignalHandlerTypeMach = 1 +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ +}; + +/** + * @ingroup enums + * Supported mechanisms for performing local symbolication. + * + * Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may + * return information that is incorrect. This may still be useful in the case where DWARF data is unavailable + * for a given build; in that case, it can provide function and method names (though not line numbers) for a + * crash report that may otherwise be unusable. + * + * Note, however, this comes at the cost of a significant increase in code that must run within the critical + * crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In + * addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may + * change in future iOS releases. Given that DWARF symbolication data will always be more accurate, and + * the risks inherent in executing considerably more code at crash time, it is strongly recommended that local + * symbolication only be enabled for non-release builds. + * + * Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the + * results. + */ +typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) { + /** No symbolication. */ + PLCrashReporterSymbolicationStrategyNone = 0, + + /** + * Use the standard binary symbol table. On iOS, this alone will return + * incomplete results, as most symbols are rewritten to the common '\' string. + */ + PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0, + + /** + * Use Objective-C metadata to find method and class names. This relies on detailed parsing + * of the Objective-C runtime data, including undefined flags and other runtime internals. As such, + * it may return incorrect data should the runtime be changed incompatibly. + */ + PLCrashReporterSymbolicationStrategyObjC = 1 << 1, + + /** + * Enable all available symbolication strategies. + */ + PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC) +}; + +@interface PLCrashReporterConfig : NSObject { +@private + /** The configured signal handler type. */ + PLCrashReporterSignalHandlerType _signalHandlerType; + + /** The configured symbolication strategy. */ + PLCrashReporterSymbolicationStrategy _symbolicationStrategy; + + /** + * Flag indicating if the uncaughtExceptionHandler should be initialized or not. It usually is, except in a + * Xamarin environment. + */ + BOOL _shouldRegisterUncaughtExceptionHandler; +} + ++ (instancetype) defaultConfiguration; + +- (instancetype) init; + +- (instancetype) initWithBasePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + basePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler + basePath: (NSString *) basePath; + +/** The base path to save the crash data. */ +@property(nonatomic, readonly) NSString *basePath; + +/** The configured signal handler type. */ +@property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType; + +/** The configured symbolication strategy. */ +@property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy; + +/** Should PLCrashReporter regiser an uncaught exception handler? This is entended to be used in Xamarin apps */ +@property(nonatomic, readonly) BOOL shouldRegisterUncaughtExceptionHandler; + +@end + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Info.plist b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Info.plist new file mode 100644 index 0000000..07662e7 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Info.plist differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Modules/module.modulemap b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Modules/module.modulemap new file mode 100644 index 0000000..4fa4304 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module CrashReporter { + umbrella header "CrashReporter.h" + + export * + module * { export * } + + link framework "Foundation" +} diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeDirectory b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeDirectory new file mode 100644 index 0000000..b08bb7b Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeDirectory differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeRequirements b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeRequirements new file mode 100644 index 0000000..dbf9d61 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeRequirements differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeRequirements-1 b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeRequirements-1 new file mode 100644 index 0000000..ed8b3b9 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeRequirements-1 differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeResources b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..92c3209 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeResources @@ -0,0 +1,447 @@ + + + + + files + + Headers/CrashReporter.h + + oU1aDvwwGfw5VO+AJWhXmX6M0h0= + + Headers/PLCrashFeatureConfig.h + + n52MK11FnpreEtuoKRTG8TrBOA8= + + Headers/PLCrashMacros.h + + EgfEfSDoo+ipdGXg9d2sqTsTOgc= + + Headers/PLCrashNamespace.h + + iju+4ZZz8ziKAwQQqdBZLrALkGw= + + Headers/PLCrashReport.h + + Gy6IE4DKfujVP4s/bfcPp+TnPZw= + + Headers/PLCrashReportApplicationInfo.h + + rCQLAtwJCv/srYztEH5cfECm8nU= + + Headers/PLCrashReportBinaryImageInfo.h + + H6EGcFdy29+0QvrKgqdM4zWMnOk= + + Headers/PLCrashReportExceptionInfo.h + + COa2VFUf0SqrmXfs7P0LrKRuVNE= + + Headers/PLCrashReportFormatter.h + + vX2oRdkxfIkphwG2QZAMBk5eyqQ= + + Headers/PLCrashReportMachExceptionInfo.h + + W17FCxf8giHWOyLk1t95TdCIWwk= + + Headers/PLCrashReportMachineInfo.h + + p9+mHt6/82wDX2EzNaUTN4rPGr4= + + Headers/PLCrashReportProcessInfo.h + + jOUd4pc0gnpcOTKG5QAFHElxwNk= + + Headers/PLCrashReportProcessorInfo.h + + WEkRtOu12c0Wh4WByQj7lh686to= + + Headers/PLCrashReportRegisterInfo.h + + O9MYY+c9RFP62QneurY8OAUmYSI= + + Headers/PLCrashReportSignalInfo.h + + l6oXnbSlUBitgXtLnpViLTIwLz8= + + Headers/PLCrashReportStackFrameInfo.h + + eCwk4wpWqrrnMMI1dIzmATv3+D0= + + Headers/PLCrashReportSymbolInfo.h + + WdFQeKsVIkrDDFK1dlK5xt7JCpc= + + Headers/PLCrashReportSystemInfo.h + + X7hNYQDtDQpFKItKCflaXjT8Zas= + + Headers/PLCrashReportTextFormatter.h + + GioWs2cl5BonqBFrrdMkAu9DH8c= + + Headers/PLCrashReportThreadInfo.h + + onzgp2Mf0YWSOfmwEdjqileRTTg= + + Headers/PLCrashReporter.h + + UYRMI0IEWikT6CY3r9pziLDvmms= + + Headers/PLCrashReporterConfig.h + + yJB6jCUNlu0cnvq8C2sF6t1gDtc= + + Info.plist + + +N7l6YOYcLbOdvM6kHanK2DcihM= + + Modules/module.modulemap + + GevHSzc93CvcJCM//BXzSveGpGE= + + + files2 + + Headers/CrashReporter.h + + hash + + oU1aDvwwGfw5VO+AJWhXmX6M0h0= + + hash2 + + fJg+ghi2Wtl6wuJBTakT9vU+csdID4zshN5fDkm3RXQ= + + + Headers/PLCrashFeatureConfig.h + + hash + + n52MK11FnpreEtuoKRTG8TrBOA8= + + hash2 + + vm9fLELpj4LXkcSkP2mcp0HkR29lDezMCLbyVX/p524= + + + Headers/PLCrashMacros.h + + hash + + EgfEfSDoo+ipdGXg9d2sqTsTOgc= + + hash2 + + onONQ05LiikrFVtyJyeHxsRLgrz8/U0BLgGlQXvbeRE= + + + Headers/PLCrashNamespace.h + + hash + + iju+4ZZz8ziKAwQQqdBZLrALkGw= + + hash2 + + ZERqK4S7+eVGTv2RvTDivKwapSL6OiHx6nnGyb9+Kmw= + + + Headers/PLCrashReport.h + + hash + + Gy6IE4DKfujVP4s/bfcPp+TnPZw= + + hash2 + + dmFoK6TXfoq7iBIixwdjMxJLstvZrpaer7NkL4X4N4c= + + + Headers/PLCrashReportApplicationInfo.h + + hash + + rCQLAtwJCv/srYztEH5cfECm8nU= + + hash2 + + 7/uQ0EM0lh6buw1mRQ29F6oy0zj/5gfZEFGoq0OH7GM= + + + Headers/PLCrashReportBinaryImageInfo.h + + hash + + H6EGcFdy29+0QvrKgqdM4zWMnOk= + + hash2 + + qPKt+Vpvb5yKwy5YnDVQrtRiUXKDtMTz1eDwJzzWMW8= + + + Headers/PLCrashReportExceptionInfo.h + + hash + + COa2VFUf0SqrmXfs7P0LrKRuVNE= + + hash2 + + vhn8etGnXpXWwdC5COrFJ9Hc9OkgJHFDk85oWPgyQFc= + + + Headers/PLCrashReportFormatter.h + + hash + + vX2oRdkxfIkphwG2QZAMBk5eyqQ= + + hash2 + + JJT26JJEqQMNGhrYjRid8UfRBFNc5LJVMzZHHcJaSYA= + + + Headers/PLCrashReportMachExceptionInfo.h + + hash + + W17FCxf8giHWOyLk1t95TdCIWwk= + + hash2 + + JDIeCA5ip7MsJqCN4EqQa8FXR/jPN1C4eMMtv/0HD6s= + + + Headers/PLCrashReportMachineInfo.h + + hash + + p9+mHt6/82wDX2EzNaUTN4rPGr4= + + hash2 + + wzibgN5Dnn+3NpNUy4RxbLYb22YoN0Ma2xXHf06vLJ8= + + + Headers/PLCrashReportProcessInfo.h + + hash + + jOUd4pc0gnpcOTKG5QAFHElxwNk= + + hash2 + + T0EJVBBej8ulfhEtWVUCEXqylnw+QsYmw89lpCw7lF0= + + + Headers/PLCrashReportProcessorInfo.h + + hash + + WEkRtOu12c0Wh4WByQj7lh686to= + + hash2 + + hYUwvgD28VIk3GLO3Srhz6jgMF1wJBr+ASLY/4DCLww= + + + Headers/PLCrashReportRegisterInfo.h + + hash + + O9MYY+c9RFP62QneurY8OAUmYSI= + + hash2 + + 9ST+qLa/nu1YnrYtX5mrfHKp/607Xp9MYrbAVshb3l4= + + + Headers/PLCrashReportSignalInfo.h + + hash + + l6oXnbSlUBitgXtLnpViLTIwLz8= + + hash2 + + ycVcVPGO+newWVaHBGP7aFg7Y5cZ+UWdkUCF32rPQ+Y= + + + Headers/PLCrashReportStackFrameInfo.h + + hash + + eCwk4wpWqrrnMMI1dIzmATv3+D0= + + hash2 + + jYlHKqtsD4X4w4c77VfW9ImXG6SonGkWXtapgZeKEiA= + + + Headers/PLCrashReportSymbolInfo.h + + hash + + WdFQeKsVIkrDDFK1dlK5xt7JCpc= + + hash2 + + wm+QGSC8bSqrtAiMqfOsm2QOV3l1nhvw0oX/MH2YBFo= + + + Headers/PLCrashReportSystemInfo.h + + hash + + X7hNYQDtDQpFKItKCflaXjT8Zas= + + hash2 + + V+uaKx4KohhYCu8yqRGnAJKUHwkU3bA01/O8v9HD/L0= + + + Headers/PLCrashReportTextFormatter.h + + hash + + GioWs2cl5BonqBFrrdMkAu9DH8c= + + hash2 + + LxFU3hM5fCT+Puo1F44kuMORirDWpjTNzFL6BeSuF2k= + + + Headers/PLCrashReportThreadInfo.h + + hash + + onzgp2Mf0YWSOfmwEdjqileRTTg= + + hash2 + + b9XzFC1Nsx92T55WvW6cgS+3lvR8Eai7PbajhGslveA= + + + Headers/PLCrashReporter.h + + hash + + UYRMI0IEWikT6CY3r9pziLDvmms= + + hash2 + + aINUhmY4EmnBT0W5ddIwTRwI4tKT+beXKsBVNxZuO84= + + + Headers/PLCrashReporterConfig.h + + hash + + yJB6jCUNlu0cnvq8C2sF6t1gDtc= + + hash2 + + 83lSiMTxSMjOEnuD5nLWABoJKG/yc8G9UIKT8Mm6Ngg= + + + Modules/module.modulemap + + hash + + GevHSzc93CvcJCM//BXzSveGpGE= + + hash2 + + iru6hi0cnStthQ0L2aQ0Hxz0/f4aP3jQgCrN0ok2aUM= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeSignature b/packages/rum_sdk/ios/CrashReporter.xcframework/ios-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeSignature new file mode 100644 index 0000000..e69de29 diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/CrashReporter b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/CrashReporter new file mode 100644 index 0000000..568ad50 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/CrashReporter differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/CrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/CrashReporter.h new file mode 100644 index 0000000..99878d3 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/CrashReporter.h @@ -0,0 +1,366 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifdef __APPLE__ +#import +#endif + +#if __has_include() + +// This must be included before any other PLCrashReporter includes, as +// it redefines symbol names +#import + +/* Library Imports */ +#import +#import +#import +#else +#import "PLCrashNamespace.h" +#import "PLCrashReporter.h" +#import "PLCrashReport.h" +#import "PLCrashReportTextFormatter.h" +#endif + +/** + * @defgroup functions Crash Reporter Functions Reference + */ + +/** + * @defgroup types Crash Reporter Data Types Reference + */ + +/** + * @defgroup constants Crash Reporter Constants Reference + */ + +/** + * @internal + * @defgroup plcrash_internal Crash Reporter Internal Documentation + */ + +/** + * @defgroup enums Enumerations + * @ingroup constants + */ + +/** + * @defgroup globals Global Variables + * @ingroup constants + */ + +/** + * @defgroup exceptions Exceptions + * @ingroup constants + */ + +/* Exceptions */ +extern NSString *PLCrashReporterException; + +/* Error Domain and Codes */ +extern NSString *PLCrashReporterErrorDomain; + +/** + * NSError codes in the Plausible Crash Reporter error domain. + * @ingroup enums + */ +typedef enum { + /** An unknown error has occured. If this + * code is received, it is a bug, and should be reported. */ + PLCrashReporterErrorUnknown = 0, + + /** An Mach or POSIX operating system error has occured. The underlying NSError cause may be fetched from the userInfo + * dictionary using the NSUnderlyingErrorKey key. */ + PLCrashReporterErrorOperatingSystem = 1, + + /** The crash report log file is corrupt or invalid */ + PLCrashReporterErrorCrashReportInvalid = 2, + + /** An attempt to use a resource which was in use at the time in a manner which would have conflicted with the request. */ + PLCrashReporterErrorResourceBusy = 3 +} PLCrashReporterError; + +/** + * @mainpage Plausible Crash Reporter + * + * @section intro_sec Introduction + * + * Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X. + * + * The following features are supported: + * + * - Implemented as an in-process signal handler. + * - Does not interfer with debugging in gdb.. + * - Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc). + * - Full thread state for all active threads (backtraces, register dumps) is provided. + * + * If your application crashes, a crash report will be written. When the application is next run, you may check for a + * pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the + * report locally. + * + * @section intro_encoding Crash Report Format + * + * Crash logs are encoded using google protobuf, and may be decoded + * using the provided PLCrashReport API. Additionally, the include plcrashutil handles conversion of binary crash reports to the + * symbolicate-compatible iPhone text format. + * + * @section doc_sections Documentation Sections + * - @subpage example_usage_iphone + * - @subpage error_handling + * - @subpage async_safety + */ + +/** + * @page example_usage_iphone Example iPhone Usage + * + * @code + * // + * // Called to handle a pending crash report. + * // + * - (void) handleCrashReport { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSData *crashData; + * NSError *error; + * + * // Try loading the crash report + * crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error]; + * if (crashData == nil) { + * NSLog(@"Could not load crash report: %@", error); + * goto finish; + * } + * + * // We could send the report from here, but we'll just print out + * // some debugging info instead + * PLCrashReport *report = [[[PLCrashReport alloc] initWithData: crashData error: &error] autorelease]; + * if (report == nil) { + * NSLog(@"Could not parse crash report"); + * goto finish; + * } + * + * NSLog(@"Crashed on %@", report.systemInfo.timestamp); + * NSLog(@"Crashed with signal %@ (code %@, address=0x%" PRIx64 ")", report.signalInfo.name, + * report.signalInfo.code, report.signalInfo.address); + * + * // Purge the report + * finish: + * [crashReporter purgePendingCrashReport]; + * return; + * } + * + * // from UIApplicationDelegate protocol + * - (void) applicationDidFinishLaunching: (UIApplication *) application { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSError *error; + * + * // Check if we previously crashed + * if ([crashReporter hasPendingCrashReport]) + * [self handleCrashReport]; + + * // Enable the Crash Reporter + * if (![crashReporter enableCrashReporterAndReturnError: &error]) + * NSLog(@"Warning: Could not enable crash reporter: %@", error); + * + * } + * @endcode + * + */ + +/** + * @page error_handling Error Handling Programming Guide + * + * Where a method may return an error, Plausible Crash Reporter provides access to the underlying + * cause via an optional NSError argument. + * + * All returned errors will be a member of one of the below defined domains, however, new domains and + * error codes may be added at any time. If you do not wish to report on the error cause, many methods + * support a simple form that requires no NSError argument. + * + * @section error_domains Error Domains, Codes, and User Info + * + * @subsection crashreporter_errors Crash Reporter Errors + * + * Any errors in Plausible Crash Reporter use the #PLCrashReporterErrorDomain error domain, and and one + * of the error codes defined in #PLCrashReporterError. + */ + +/** + * @page async_safety Async-Safe Programming Guide + * + * Plausible CrashReporter provides support for executing an application specified function in the context of the + * crash reporter's signal handler, after the crash report has been written to disk. This was a regularly requested + * feature, and provides the ability to implement application finalization in the event of a crash. However, writing + * code intended for execution inside of a signal handler is exceptionally difficult, and is not recommended. + * + * @section program_flow Program Flow and Signal Handlers + * + * When the signal handler is called the normal flow of the program is interrupted, and your program is an unknown + * state. Locks may be held, the heap may be corrupt (or in the process of being updated), and your signal + * handler may invoke a function that was being executed at the time of the signal. This may result in deadlocks, + * data corruption, and program termination. + * + * @section functions Async-Safe Functions + * + * A subset of functions are defined to be async-safe by the OS, and are safely callable from within a signal handler. If + * you do implement a custom post-crash handler, it must be async-safe. A table of POSIX-defined async-safe functions + * and additional information is available from the + * CERT programming guide - SIG30-C + * + * Most notably, the Objective-C runtime itself is not async-safe, and Objective-C may not be used within a signal + * handler. + * + * @sa PLCrashReporter::setCrashCallbacks: + */ + +/** + * @page mach_exceptions Mach Exceptions on Mac OS X and iOS + * + * PLCrashReporter includes support for monitoring crashes via an in-process Mach exception handler. There are a small + * number of crash cases that will not be caught with via a POSIX signal handler, but can be caught via a Mach + * exception handler: + * + * - Stack overflow. sigaltstack() is broken in later iOS releases, and even if functional, must be configured + * on a per-thread basis. + * - Internal Apple assertions that call libSystem's __assert. These include compiler-checked constraints + * for built-in functions, such as strcpy_chk(). The __abort() implementation actually disables the SIGABRT + * signal handler (resetting it to SIG_DFL) prior to to issueing a SIGABRT, bypassing signal-based crash + * reporters entirely. + * + * Unfortunately, the latter issue (__assert) can not be handled on iOS; trapping abort requires that + * a Mach exception handler operate out-of-process, which is impossible on iOS. On Mac OS X, this will + * only be handled once we've implemented fully out-of-process crash excution. + * + * On Mac OS X, the Mach exception implementation is fully supported using entirely public API. On iOS, + * the APIs required are not fully public -- more details on the implications of this for exception handling on + * iOS may be found in @ref mach_exceptions_ios below. It is worth noting that even where the Mach exception APIs + * are fully supported, kernel-internal constants, as well + * as architecture-specific trap information, may be required to fully interpret a Mach exception's root cause. + * + * For example, the EXC_SOFTWARE exception is dispatched for four different failure types, using the exception + * code to differentiate failure types: + * - Non-existent system call invoked (SIGSYS) + * - Write on a pipe with no reader (SIGPIPE) + * - Abort program (SIGABRT -- unused) + * - Kill program (SIGKILL) + * + * Of those four types, only the constant required to interpret the SIGKILL behavior (EXC_SOFT_SIGNAL) is publicly defined. + * Of the remaining three failure types, the constant values are kernel implementation-private, defined only in the available + * kernel sources. On iOS, these sources are unavailable, and while they generally do match the Mac OS X implementation, there + * are no gaurantees that this is -- or will remain -- the case in the future. + * + * Likewise, interpretation of particular fault types requires information regarding the underlying machine traps + * that triggered the Mach exceptions. For example, a floating point trap on x86/x86-64 will trigger an EXC_ARITHMETIC, + * with a subcode value containing the value of the FPU status register. Determining the exact FPU cause requires + * extracting the actual exception flags from status register as per the x86 architecture documentation. The exact format + * of this subcode value is not actually documented outside the kernel, and may change in future releases. + * + * While we have the advantage of access to the x86 kernel sources, the situation on ARM is even less clear. The actual + * use of the Mach exception codes and subcodes is largely undefined by both headers and publicly available documentation, + * and the available x86 kernel sources are of little use in interpreting this data. + * + * As such, while Mach exceptions may catch some cases that BSD signals can not, they are not a perfect solution, + * and may also provide less insight into the actual failures that occur. By comparison, the BSD signal interface + * is both fully defined and architecture independent, with any necessary interpretation of the Mach exception + * codes handled in-kernel at the time of exception dispatch. It is generally recommended by Apple as the preferred + * interface, and should generally be preferred by PLCrashReporter API clients. + * + * @section mach_exceptions_compatibility Compatibility Issues + * + * @subsection Debuggers + * + * Enabling in-process Mach exception handlers will conflict with any attached debuggers; the debugger + * may suspend the processes Mach exception handling thread, which will result in any exception messages + * sent via the debugger being lost, as the in-process handler will be unable to receive and forward + * the messages. + * + * @subsection Managed Runtimes (Xamarin, Unity) + * + * A Mach exception handler may conflict with any managed runtime that registers a BSD signal handler that + * can safely handle otherwise fatal signals, allowing execution to proceed. This includes products + * such as Xamarin for iOS. + * + * In such a case, PLCrashReporter will write a crash report for non-fatal signals, as there is no + * immediate mechanism for determining whether a signal handler exists and that it can safely + * handle the failure. This can result in unexpected delays in application execution, increased I/O to + * disk, and other undesirable operations. + * + * @section mach_exceptions_ios Mach Exceptions on iOS + * + * The APIs required for Mach exception handling are not fully public on iOS. After filing a request with + * Apple DTS to clarify the status of the Mach exception APIs on iOS, and implementing a Mach Exception + * handler using only supported API, they provided the following guidance: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited undefined API on iOS. The reporter + * may be excluded entirely at build time by modifying the PLCRASH_FEATURE_MACH_EXCEPTIONS build configuration; it + * may also be disabled at runtime by configuring the PLCrashReporter instance appropriately via PLCrashReporterConfig. + * + * The iOS implementation is implemented almost entirely using public API, and links against no actual private symbols; + * the use of undocumented functionality is limited to assuming the use of specific msgh_id values (see below + * for details). As a result, it may be considered perfectly safe to include the Mach Exception code in the + * standard build, and enable/disable it at runtime. + * + * The following issues exist in the iOS implementation: + * - The msgh_id values required for an exception reply message are not available from the available + * headers and must be hard-coded. This prevents one from safely replying to exception messages, which + * means that it is impossible to (correctly) inform the server that an exception has *not* been + * handled. + * + * Impact: + * This can lead to the process locking up and not dispatching to the host exception handler (eg, Apple's + * crash reporter), depending on the behavior of the kernel exception code. + * + * - The mach_* structure/type variants required by MACH_EXCEPTION_CODES are not publicly defined (on Mac OS X, + * these are provided by mach_exc.defs). This prevents one from forwarding exception messages to an existing + * handler that was registered with a MACH_EXCEPTION_CODES behavior (eg, forwarding is entirely non-functional + * on ARM64 devices). + * + * Impact: + * This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES, + * including other handlers registered within the current process, eg, by a managed runtime. This could + * also result in misinterpretation of a Mach exception message, in the case where the message format is + * modified by Apple to be incompatible with the existing 32-bit format. + * + * This is the case with LLDB; it will register a task exception handler with MACH_EXCEPTION_CODES set. Failure + * to correctly forward these exceptions will result in the debugger breaking in interesting ways; for example, + * changes to the set of dyld-loaded images are detected by setting a breakpoint on the dyld image registration + * funtions, and this functionality will break if the exception is not correctly forwarded. + * + * Since Mach exception handling is important for a fully functional crash reporter, we have also filed a radar + * to request that the API be made public: + * Radar: rdar://12939497 RFE: Provide mach_exc.defs for iOS + * + * At the time of this writing, the radar remains open/unresolved. + */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashFeatureConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashFeatureConfig.h new file mode 100644 index 0000000..7bcaebf --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashFeatureConfig.h @@ -0,0 +1,108 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_FEATURE_CONFIG_H +#define PLCRASH_FEATURE_CONFIG_H + +#include + +/** + * @internal + * + * Build-time configuration for PLCrashReporter. + * + * This is used to automatically enable/disable features on a per-platform and per-configuration + * basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter. + * + * @defgroup build_config Build Configuration + * @ingroup constants + * @{ + */ + +/* + * Defaults + */ + +/* + * For release builds, disable unused unwind implementations on targets that do not use them. For non-release + * builds, we include the unwind implementations to allow testing on a broader range of targets. + */ +#ifdef PLCF_RELEASE_BUILD +# if defined(__arm__) +# ifndef PLCRASH_FEATURE_UNWIND_DWARF +# define PLCRASH_FEATURE_UNWIND_DWARF 0 +# endif +# ifndef PLCRASH_FEATURE_UNWIND_COMPACT +# define PLCRASH_FEATURE_UNWIND_COMPACT 0 +# endif +# endif +#endif + +/* + * Configuration Flags + */ + + +#ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS +/** + * If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported, + * using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a + * popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either + * they've received special dispensation to use private APIs / private structures, they've found another way to do + * it, or they're just using undocumented functionality and hoping for the best. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled + * Mach exception handling by default, and provided both build-time and runtime configuration + * to disable its use. + * + * For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions. + */ +#if TARGET_OS_TV +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 0 +#else +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 1 +#endif +#endif + +#ifndef PLCRASH_FEATURE_UNWIND_DWARF +/** If true, enable DWARF unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_DWARF 1 +#endif + + +#ifndef PLCRASH_FEATURE_UNWIND_COMPACT +/** If true, enable compact unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_COMPACT 1 +#endif + +/* + * @} + */ + +#endif /* PLCRASH_FEATURE_CONFIG_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashMacros.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashMacros.h new file mode 100644 index 0000000..556e1c2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashMacros.h @@ -0,0 +1,143 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_CONSTANTS_H +#define PLCRASH_CONSTANTS_H + +#include +#include + +#if defined(__cplusplus) +# define PLCR_EXPORT extern "C" +# define PLCR_C_BEGIN_DECLS extern "C" { +# define PLCR_C_END_DECLS } +#else +# define PLCR_EXPORT extern +# define PLCR_C_BEGIN_DECLS +# define PLCR_C_END_DECLS +#endif + +#if defined(__cplusplus) +# define NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ +# define IS_EMPTY_(name) defined(NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ ## name) +# define IS_EMPTY(name) IS_EMPTY_(name) +# if defined(PLCRASHREPORTER_PREFIX) && !IS_EMPTY(PLCRASHREPORTER_PREFIX) + /** @internal Define the plcrash namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ +# define PLCR_CPP_BEGIN_NS namespace plcrash { inline namespace PLCRASHREPORTER_PREFIX { + + /** @internal Close the definition of the `plcrash` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ +# define PLCR_CPP_END_NS }} +# else +# define PLCR_CPP_BEGIN_NS namespace plcrash { +# define PLCR_CPP_END_NS } +# endif +#endif + +#ifdef __clang__ +# define PLCR_PRAGMA_CLANG(_p) _Pragma(_p) +#else +# define PLCR_PRAGMA_CLANG(_p) +#endif + +#ifdef __clang__ +# define PLCR_DEPRECATED __attribute__((deprecated)) +#else +# define PLCR_DEPRECATED +#endif + +#if defined(__clang__) || defined(__GNUC__) +# define PLCR_UNUSED __attribute__((unused)) +#else +# define PLCR_UNUSED +#endif + +#ifdef PLCR_PRIVATE +/** + * Marks a definition as deprecated only for for external clients, allowing + * uses of it internal fo the framework. + */ +# define PLCR_EXTERNAL_DEPRECATED + +/** + * @internal + * A macro to put above a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() \ + PLCR_PRAGMA_CLANG("clang diagnostic push"); \ + PLCR_PRAGMA_CLANG("clang diagnostic ignored \"-Wdocumentation-deprecated-sync\"") + +/** + * @internal + * A macro to put below a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_POP() PLCR_PRAGMA_CLANG("clang diagnostic pop") + +#else + +# define PLCR_EXTERNAL_DEPRECATED PLCR_DEPRECATED +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() + +#endif /* PLCR_PRIVATE */ + +#ifdef PLCR_PRIVATE +# if defined(__clang__) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") +# define PLCR_FALLTHROUGH [[clang::fallthrough]] +# else +# define PLCR_FALLTHROUGH do {} while (0) +# endif +#endif + +#ifdef PLCR_PRIVATE +/** + * @internal + * Static compile-time assertion. + * + * @param name The assertion name; must be valid for use within a C identifier. + * @param cond Assertion condition + */ +# define PLCR_ASSERT_STATIC(name, cond) PLCR_ASSERT_STATIC_(name, cond, __LINE__) +/* + * C++11 and C11 both provide a static_assert(). + * + * Otherwise, we have to use typedef-based static assertions. + */ +# if (defined(__cplusplus) && __cplusplus >= 201103L) || (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(#name, cond) +# define PLCR_ASSERT_STATIC__(name, cond) static_assert(cond, #name) +# else +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(name, cond, line) +# define PLCR_ASSERT_STATIC__(name, cond, line) typedef int plcf_static_assert_##name##_##line [(cond) ? 1 : -1] PLCR_UNUSED +# endif +#endif /* PLCR_PRIVATE */ + +#endif /* PLCRASH_CONSTANTS_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashNamespace.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashNamespace.h new file mode 100644 index 0000000..f4c263c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashNamespace.h @@ -0,0 +1,320 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +// #define PLCRASHREPORTER_PREFIX AcmeCo + + +// We need two extra layers of indirection to make CPP substitute +// the PLCRASHREPORTER_PREFIX define. +#define PLNS_impl2(prefix, symbol) prefix ## symbol +#define PLNS_impl(prefix, symbol) PLNS_impl2(prefix, symbol) +#define PLNS(symbol) PLNS_impl(PLCRASHREPORTER_PREFIX, symbol) + + +/* + * Rewrite all ObjC/C symbols. + * + * For C++ symbol handling, refer to the PLCR_CPP_BEGIN_NS and PLCR_CPP_END_NS + * macros. + */ +#ifdef PLCRASHREPORTER_PREFIX + +/* Objective-C Classes */ +#define PLCrashMachExceptionServer PLNS(PLCrashMachExceptionServer) +#define PLCrashReport PLNS(PLCrashReport) +#define PLCrashReportApplicationInfo PLNS(PLCrashReportApplicationInfo) +#define PLCrashReportBinaryImageInfo PLNS(PLCrashReportBinaryImageInfo) +#define PLCrashReportExceptionInfo PLNS(PLCrashReportExceptionInfo) +#define PLCrashReportMachExceptionInfo PLNS(PLCrashReportMachExceptionInfo) +#define PLCrashReportMachineInfo PLNS(PLCrashReportMachineInfo) +#define PLCrashReportProcessInfo PLNS(PLCrashReportProcessInfo) +#define PLCrashReportProcessorInfo PLNS(PLCrashReportProcessorInfo) +#define PLCrashReportRegisterInfo PLNS(PLCrashReportRegisterInfo) +#define PLCrashReportSignalInfo PLNS(PLCrashReportSignalInfo) +#define PLCrashReportStackFrameInfo PLNS(PLCrashReportStackFrameInfo) +#define PLCrashReportSymbolInfo PLNS(PLCrashReportSymbolInfo) +#define PLCrashReportSystemInfo PLNS(PLCrashReportSystemInfo) +#define PLCrashReportTextFormatter PLNS(PLCrashReportTextFormatter) +#define PLCrashReportThreadInfo PLNS(PLCrashReportThreadInfo) +#define PLCrashReporter PLNS(PLCrashReporter) +#define PLCrashSignalHandler PLNS(PLCrashSignalHandler) +#define PLCrashHostInfo PLNS(PLCrashHostInfo) +#define PLCrashMachExceptionPort PLNS(PLCrashMachExceptionPort) +#define PLCrashMachExceptionPortSet PLNS(PLCrashMachExceptionPortSet) +#define PLCrashProcessInfo PLNS(PLCrashProcessInfo) +#define PLCrashReporterConfig PLNS(PLCrashReporterConfig) +#define PLCrashUncaughtExceptionHandler PLNS(PLCrashUncaughtExceptionHandler) +#define PLCrashReportFormatter PLNS(PLCrashReportFormatter) + +/* Public C functions */ +#define PLCrashMachExceptionForward PLNS(PLCrashMachExceptionForward) +#define PLCrashSignalHandlerForward PLNS(PLCrashSignalHandlerForward) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) + + +/* Public C global symbols */ +#define PLCrashReporterErrorDomain PLNS(PLCrashReporterErrorDomain) +#define PLCrashReportHostArchitecture PLNS(PLCrashReportHostArchitecture) +#define PLCrashReportHostOperatingSystem PLNS(PLCrashReportHostOperatingSystem) +#define PLCrashReporterException PLNS(PLCrashReporterException) + +/* For backwards compatibility, plcrash_async_byteorder vends C++ methods when included under C++. We have + * to handle this distinctly from our PLCR_CPP_BEGIN_NS C++ namespacing mechanism. */ +#define plcrash_async_byteorder PLNS(plcrash_async_byteorder) + +/* + * All private C symbols. Once these are migrated to C++, we'll be able to use the much simpler + * PLCR_CPP_BEGIN_NS machinery. + * + * This list was automatically generated (and can be updated) by setting PLCRASHREPORTER_PREFIX to 'AcmeCo', + * building the library, and executing the following: + * nm -g -U | grep '^[0-9]' | c++filt | grep -v AcmeCo | grep -E '_pl|_PL' | awk '{print $3}' | cut -c 2- | sort | uniq | awk '{print "#define",$1,"PLNS("$1")"}' + */ +#define pl_mach_thread_self PLNS(pl_mach_thread_self) +#define plcrash__architecture__descriptor PLNS(plcrash__architecture__descriptor) +#define plcrash__crash_report__application_info__descriptor PLNS(plcrash__crash_report__application_info__descriptor) +#define plcrash__crash_report__application_info__init PLNS(plcrash__crash_report__application_info__init) +#define plcrash__crash_report__binary_image__descriptor PLNS(plcrash__crash_report__binary_image__descriptor) +#define plcrash__crash_report__binary_image__init PLNS(plcrash__crash_report__binary_image__init) +#define plcrash__crash_report__descriptor PLNS(plcrash__crash_report__descriptor) +#define plcrash__crash_report__exception__descriptor PLNS(plcrash__crash_report__exception__descriptor) +#define plcrash__crash_report__exception__init PLNS(plcrash__crash_report__exception__init) +#define plcrash__crash_report__free_unpacked PLNS(plcrash__crash_report__free_unpacked) +#define plcrash__crash_report__get_packed_size PLNS(plcrash__crash_report__get_packed_size) +#define plcrash__crash_report__init PLNS(plcrash__crash_report__init) +#define plcrash__crash_report__machine_info__descriptor PLNS(plcrash__crash_report__machine_info__descriptor) +#define plcrash__crash_report__machine_info__init PLNS(plcrash__crash_report__machine_info__init) +#define plcrash__crash_report__pack PLNS(plcrash__crash_report__pack) +#define plcrash__crash_report__pack_to_buffer PLNS(plcrash__crash_report__pack_to_buffer) +#define plcrash__crash_report__process_info__descriptor PLNS(plcrash__crash_report__process_info__descriptor) +#define plcrash__crash_report__process_info__init PLNS(plcrash__crash_report__process_info__init) +#define plcrash__crash_report__processor__descriptor PLNS(plcrash__crash_report__processor__descriptor) +#define plcrash__crash_report__processor__init PLNS(plcrash__crash_report__processor__init) +#define plcrash__crash_report__processor__type_encoding__descriptor PLNS(plcrash__crash_report__processor__type_encoding__descriptor) +#define plcrash__crash_report__report_info__descriptor PLNS(plcrash__crash_report__report_info__descriptor) +#define plcrash__crash_report__report_info__init PLNS(plcrash__crash_report__report_info__init) +#define plcrash__crash_report__signal__descriptor PLNS(plcrash__crash_report__signal__descriptor) +#define plcrash__crash_report__signal__init PLNS(plcrash__crash_report__signal__init) +#define plcrash__crash_report__signal__mach_exception__descriptor PLNS(plcrash__crash_report__signal__mach_exception__descriptor) +#define plcrash__crash_report__signal__mach_exception__init PLNS(plcrash__crash_report__signal__mach_exception__init) +#define plcrash__crash_report__symbol__descriptor PLNS(plcrash__crash_report__symbol__descriptor) +#define plcrash__crash_report__symbol__init PLNS(plcrash__crash_report__symbol__init) +#define plcrash__crash_report__system_info__descriptor PLNS(plcrash__crash_report__system_info__descriptor) +#define plcrash__crash_report__system_info__init PLNS(plcrash__crash_report__system_info__init) +#define plcrash__crash_report__system_info__operating_system__descriptor PLNS(plcrash__crash_report__system_info__operating_system__descriptor) +#define plcrash__crash_report__thread__descriptor PLNS(plcrash__crash_report__thread__descriptor) +#define plcrash__crash_report__thread__init PLNS(plcrash__crash_report__thread__init) +#define plcrash__crash_report__thread__register_value__descriptor PLNS(plcrash__crash_report__thread__register_value__descriptor) +#define plcrash__crash_report__thread__register_value__init PLNS(plcrash__crash_report__thread__register_value__init) +#define plcrash__crash_report__thread__stack_frame__descriptor PLNS(plcrash__crash_report__thread__stack_frame__descriptor) +#define plcrash__crash_report__thread__stack_frame__init PLNS(plcrash__crash_report__thread__stack_frame__init) +#define plcrash__crash_report__unpack PLNS(plcrash__crash_report__unpack) +#define plcrash_async_address_apply_offset PLNS(plcrash_async_address_apply_offset) +#define plcrash_async_byteorder_big_endian PLNS(plcrash_async_byteorder_big_endian) +#define plcrash_async_byteorder_direct PLNS(plcrash_async_byteorder_direct) +#define plcrash_async_byteorder_little_endian PLNS(plcrash_async_byteorder_little_endian) +#define plcrash_async_byteorder_swapped PLNS(plcrash_async_byteorder_swapped) +#define plcrash_async_cfe_entry_apply PLNS(plcrash_async_cfe_entry_apply) +#define plcrash_async_cfe_entry_free PLNS(plcrash_async_cfe_entry_free) +#define plcrash_async_cfe_entry_init PLNS(plcrash_async_cfe_entry_init) +#define plcrash_async_cfe_entry_register_count PLNS(plcrash_async_cfe_entry_register_count) +#define plcrash_async_cfe_entry_register_list PLNS(plcrash_async_cfe_entry_register_list) +#define plcrash_async_cfe_entry_return_address_register PLNS(plcrash_async_cfe_entry_return_address_register) +#define plcrash_async_cfe_entry_stack_adjustment PLNS(plcrash_async_cfe_entry_stack_adjustment) +#define plcrash_async_cfe_entry_stack_offset PLNS(plcrash_async_cfe_entry_stack_offset) +#define plcrash_async_cfe_entry_type PLNS(plcrash_async_cfe_entry_type) +#define plcrash_async_cfe_reader_find_pc PLNS(plcrash_async_cfe_reader_find_pc) +#define plcrash_async_cfe_reader_free PLNS(plcrash_async_cfe_reader_free) +#define plcrash_async_cfe_reader_init PLNS(plcrash_async_cfe_reader_init) +#define plcrash_async_cfe_register_decode PLNS(plcrash_async_cfe_register_decode) +#define plcrash_async_cfe_register_encode PLNS(plcrash_async_cfe_register_encode) +#define plcrash_async_file_close PLNS(plcrash_async_file_close) +#define plcrash_async_file_flush PLNS(plcrash_async_file_flush) +#define plcrash_async_file_init PLNS(plcrash_async_file_init) +#define plcrash_async_file_write PLNS(plcrash_async_file_write) +#define plcrash_async_find_symbol PLNS(plcrash_async_find_symbol) +#define plcrash_async_image_containing_address PLNS(plcrash_async_image_containing_address) +#define plcrash_async_image_list_next PLNS(plcrash_async_image_list_next) +#define plcrash_async_image_list_set_reading PLNS(plcrash_async_image_list_set_reading) +#define plcrash_async_mach_exception_get_siginfo PLNS(plcrash_async_mach_exception_get_siginfo) +#define plcrash_async_macho_byteorder PLNS(plcrash_async_macho_byteorder) +#define plcrash_async_macho_contains_address PLNS(plcrash_async_macho_contains_address) +#define plcrash_async_macho_cpu_subtype PLNS(plcrash_async_macho_cpu_subtype) +#define plcrash_async_macho_cpu_type PLNS(plcrash_async_macho_cpu_type) +#define plcrash_async_macho_find_command PLNS(plcrash_async_macho_find_command) +#define plcrash_async_macho_find_segment_cmd PLNS(plcrash_async_macho_find_segment_cmd) +#define plcrash_async_macho_find_symbol_by_name PLNS(plcrash_async_macho_find_symbol_by_name) +#define plcrash_async_macho_find_symbol_by_pc PLNS(plcrash_async_macho_find_symbol_by_pc) +#define plcrash_async_macho_header PLNS(plcrash_async_macho_header) +#define plcrash_async_macho_header_size PLNS(plcrash_async_macho_header_size) +#define plcrash_async_macho_map_section PLNS(plcrash_async_macho_map_section) +#define plcrash_async_macho_map_segment PLNS(plcrash_async_macho_map_segment) +#define plcrash_async_macho_mapped_segment_free PLNS(plcrash_async_macho_mapped_segment_free) +#define plcrash_async_macho_next_command PLNS(plcrash_async_macho_next_command) +#define plcrash_async_macho_next_command_type PLNS(plcrash_async_macho_next_command_type) +#define plcrash_async_macho_string_free PLNS(plcrash_async_macho_string_free) +#define plcrash_async_macho_string_get_length PLNS(plcrash_async_macho_string_get_length) +#define plcrash_async_macho_string_get_pointer PLNS(plcrash_async_macho_string_get_pointer) +#define plcrash_async_macho_string_init PLNS(plcrash_async_macho_string_init) +#define plcrash_async_macho_symtab_reader_free PLNS(plcrash_async_macho_symtab_reader_free) +#define plcrash_async_macho_symtab_reader_init PLNS(plcrash_async_macho_symtab_reader_init) +#define plcrash_async_macho_symtab_reader_read PLNS(plcrash_async_macho_symtab_reader_read) +#define plcrash_async_macho_symtab_reader_symbol_name PLNS(plcrash_async_macho_symtab_reader_symbol_name) +#define plcrash_async_memcpy PLNS(plcrash_async_memcpy) +#define plcrash_async_memset PLNS(plcrash_async_memset) +#define plcrash_async_mobject_base_address PLNS(plcrash_async_mobject_base_address) +#define plcrash_async_mobject_free PLNS(plcrash_async_mobject_free) +#define plcrash_async_mobject_init PLNS(plcrash_async_mobject_init) +#define plcrash_async_mobject_length PLNS(plcrash_async_mobject_length) +#define plcrash_async_mobject_read_uint16 PLNS(plcrash_async_mobject_read_uint16) +#define plcrash_async_mobject_read_uint32 PLNS(plcrash_async_mobject_read_uint32) +#define plcrash_async_mobject_read_uint64 PLNS(plcrash_async_mobject_read_uint64) +#define plcrash_async_mobject_read_uint8 PLNS(plcrash_async_mobject_read_uint8) +#define plcrash_async_mobject_remap_address PLNS(plcrash_async_mobject_remap_address) +#define plcrash_async_mobject_task PLNS(plcrash_async_mobject_task) +#define plcrash_async_mobject_verify_local_pointer PLNS(plcrash_async_mobject_verify_local_pointer) +#define plcrash_async_objc_cache_free PLNS(plcrash_async_objc_cache_free) +#define plcrash_async_objc_cache_init PLNS(plcrash_async_objc_cache_init) +#define plcrash_async_objc_find_method PLNS(plcrash_async_objc_find_method) +#define plcrash_async_signal_sigcode PLNS(plcrash_async_signal_sigcode) +#define plcrash_async_signal_signame PLNS(plcrash_async_signal_signame) +#define plcrash_async_strcmp PLNS(plcrash_async_strcmp) +#define plcrash_async_strerror PLNS(plcrash_async_strerror) +#define plcrash_async_strncmp PLNS(plcrash_async_strncmp) +#define plcrash_async_symbol_cache_free PLNS(plcrash_async_symbol_cache_free) +#define plcrash_async_symbol_cache_init PLNS(plcrash_async_symbol_cache_init) +#define plcrash_async_task_memcpy PLNS(plcrash_async_task_memcpy) +#define plcrash_async_task_read_uint16 PLNS(plcrash_async_task_read_uint16) +#define plcrash_async_task_read_uint32 PLNS(plcrash_async_task_read_uint32) +#define plcrash_async_task_read_uint64 PLNS(plcrash_async_task_read_uint64) +#define plcrash_async_task_read_uint8 PLNS(plcrash_async_task_read_uint8) +#define plcrash_async_thread_state_clear_all_regs PLNS(plcrash_async_thread_state_clear_all_regs) +#define plcrash_async_thread_state_clear_reg PLNS(plcrash_async_thread_state_clear_reg) +#define plcrash_async_thread_state_clear_volatile_regs PLNS(plcrash_async_thread_state_clear_volatile_regs) +#define plcrash_async_thread_state_copy PLNS(plcrash_async_thread_state_copy) +#define plcrash_async_thread_state_current PLNS(plcrash_async_thread_state_current) +#define plcrash_async_thread_state_current_stub PLNS(plcrash_async_thread_state_current_stub) +#define plcrash_async_thread_state_get_greg_size PLNS(plcrash_async_thread_state_get_greg_size) +#define plcrash_async_thread_state_get_reg PLNS(plcrash_async_thread_state_get_reg) +#define plcrash_async_thread_state_get_reg_count PLNS(plcrash_async_thread_state_get_reg_count) +#define plcrash_async_thread_state_get_reg_name PLNS(plcrash_async_thread_state_get_reg_name) +#define plcrash_async_thread_state_get_stack_direction PLNS(plcrash_async_thread_state_get_stack_direction) +#define plcrash_async_thread_state_has_reg PLNS(plcrash_async_thread_state_has_reg) +#define plcrash_async_thread_state_init PLNS(plcrash_async_thread_state_init) +#define plcrash_async_thread_state_mach_thread_init PLNS(plcrash_async_thread_state_mach_thread_init) +#define plcrash_async_thread_state_map_dwarf_to_reg PLNS(plcrash_async_thread_state_map_dwarf_to_reg) +#define plcrash_async_thread_state_map_reg_to_dwarf PLNS(plcrash_async_thread_state_map_reg_to_dwarf) +#define plcrash_async_thread_state_mcontext_init PLNS(plcrash_async_thread_state_mcontext_init) +#define plcrash_async_thread_state_set_reg PLNS(plcrash_async_thread_state_set_reg) +#define plcrash_async_writen PLNS(plcrash_async_writen) +#define plcrash_log_writer_close PLNS(plcrash_log_writer_close) +#define plcrash_log_writer_free PLNS(plcrash_log_writer_free) +#define plcrash_log_writer_init PLNS(plcrash_log_writer_init) +#define plcrash_log_writer_set_exception PLNS(plcrash_log_writer_set_exception) +#define plcrash_log_writer_write PLNS(plcrash_log_writer_write) +#define plcrash_log_writer_set_custom_data PLNS(plcrash_log_writer_set_custom_data) +#define plcrash_nasync_image_list_append PLNS(plcrash_nasync_image_list_append) +#define plcrash_nasync_image_list_free PLNS(plcrash_nasync_image_list_free) +#define plcrash_nasync_image_list_init PLNS(plcrash_nasync_image_list_init) +#define plcrash_nasync_image_list_remove PLNS(plcrash_nasync_image_list_remove) +#define plcrash_nasync_macho_free PLNS(plcrash_nasync_macho_free) +#define plcrash_nasync_macho_init PLNS(plcrash_nasync_macho_init) +#define plcrash_populate_error PLNS(plcrash_populate_error) +#define plcrash_populate_mach_error PLNS(plcrash_populate_mach_error) +#define plcrash_populate_posix_error PLNS(plcrash_populate_posix_error) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) +#define plcrash_sysctl_int PLNS(plcrash_sysctl_int) +#define plcrash_sysctl_string PLNS(plcrash_sysctl_string) +#define plcrash_sysctl_valid_utf8_bytes PLNS(plcrash_sysctl_valid_utf8_bytes) +#define plcrash_sysctl_valid_utf8_bytes_max PLNS(plcrash_sysctl_valid_utf8_bytes_max) +#define plcrash_writer_pack PLNS(plcrash_writer_pack) +#define plframe_cursor_free PLNS(plframe_cursor_free) +#define plframe_cursor_get_reg PLNS(plframe_cursor_get_reg) +#define plframe_cursor_get_regcount PLNS(plframe_cursor_get_regcount) +#define plframe_cursor_get_regname PLNS(plframe_cursor_get_regname) +#define plframe_cursor_init PLNS(plframe_cursor_init) +#define plframe_cursor_next PLNS(plframe_cursor_next) +#define plframe_cursor_next_with_readers PLNS(plframe_cursor_next_with_readers) +#define plframe_cursor_read_compact_unwind PLNS(plframe_cursor_read_compact_unwind) +#define plframe_cursor_read_dwarf_unwind PLNS(plframe_cursor_read_dwarf_unwind) +#define plframe_cursor_read_frame_ptr PLNS(plframe_cursor_read_frame_ptr) +#define plframe_cursor_thread_init PLNS(plframe_cursor_thread_init) +#define plframe_strerror PLNS(plframe_strerror) + +#endif + +/* + * The following symbols are exported by the protobuf-c library. When building + * a shared library, we can hide these as private symbols. + * + * However, when building a static library, we can only do so if we use + * MH_OBJECT "single object prelink". The MH_OBJECT approach allows us to apply + * symbol hiding/aliasing/etc similar to that supported by dylibs, but because it is + * seemingly unused within Apple, the use thereof regularly introduces linking bugs + * and errors in new Xcode releases. + * + * Rather than fighting the linker, we use the namespacing machinery to rewrite these + * symbols, but only when explicitly compiling PLCrashReporter. Since protobuf-c is a library + * that may be used elsewhere, we don't want to rewrite these symbols if they're used + * independently by PLCrashReporter API clients. + */ +#ifdef PLCR_PRIVATE + /* If no prefix has been defined, we need to specify our own private prefix */ +# ifndef PLCRASHREPORTER_PREFIX +# define PLCRASHREPORTER_PREFIX PL_ +# endif + +# define protobuf_c_buffer_simple_append PLNS(protobuf_c_buffer_simple_append) +# define protobuf_c_empty_string PLNS(protobuf_c_empty_string) +# define protobuf_c_enum_descriptor_get_value PLNS(protobuf_c_enum_descriptor_get_value) +# define protobuf_c_enum_descriptor_get_value_by_name PLNS(protobuf_c_enum_descriptor_get_value_by_name) +# define protobuf_c_message_check PLNS(protobuf_c_message_check) +# define protobuf_c_message_descriptor_get_field PLNS(protobuf_c_message_descriptor_get_field) +# define protobuf_c_message_descriptor_get_field_by_name PLNS(protobuf_c_message_descriptor_get_field_by_name) +# define protobuf_c_message_free_unpacked PLNS(protobuf_c_message_free_unpacked) +# define protobuf_c_message_get_packed_size PLNS(protobuf_c_message_get_packed_size) +# define protobuf_c_message_init PLNS(protobuf_c_message_init) +# define protobuf_c_message_pack PLNS(protobuf_c_message_pack) +# define protobuf_c_message_pack_to_buffer PLNS(protobuf_c_message_pack_to_buffer) +# define protobuf_c_message_unpack PLNS(protobuf_c_message_unpack) +# define protobuf_c_service_descriptor_get_method_by_name PLNS(protobuf_c_service_descriptor_get_method_by_name) +# define protobuf_c_service_destroy PLNS(protobuf_c_service_destroy) +# define protobuf_c_service_generated_init PLNS(protobuf_c_service_generated_init) +# define protobuf_c_service_invoke_internal PLNS(protobuf_c_service_invoke_internal) +# define protobuf_c_version PLNS(protobuf_c_version) +# define protobuf_c_version_number PLNS(protobuf_c_version_number) +#endif /* PLCR_PRIVATE */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReport.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReport.h new file mode 100644 index 0000000..f710c3f --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReport.h @@ -0,0 +1,230 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_H +#define PLCRASH_REPORT_H + +#if __has_include() +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#else +#import "PLCrashReportApplicationInfo.h" +#import "PLCrashReportBinaryImageInfo.h" +#import "PLCrashReportExceptionInfo.h" +#import "PLCrashReportMachineInfo.h" +#import "PLCrashReportMachExceptionInfo.h" +#import "PLCrashReportProcessInfo.h" +#import "PLCrashReportProcessorInfo.h" +#import "PLCrashReportRegisterInfo.h" +#import "PLCrashReportSignalInfo.h" +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportSymbolInfo.h" +#import "PLCrashReportSystemInfo.h" +#import "PLCrashReportThreadInfo.h" +#endif + +/** + * @ingroup constants + * Crash file magic identifier */ +#define PLCRASH_REPORT_FILE_MAGIC "plcrash" + +/** + * @ingroup constants + * Crash format version byte identifier. Will not change outside of the introduction of + * an entirely new crash log format. */ +#define PLCRASH_REPORT_FILE_VERSION 1 + +/** + * @ingroup types + * Crash log file header format. + * + * Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC), + * followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION). + * The crash log message format itself is extensible, so this version number will only + * be incremented in the event of an incompatible encoding or format change. + */ +struct PLCrashReportFileHeader { + /** Crash log magic identifier, not NULL terminated */ + const char magic[7]; + + /** Crash log encoding/format version */ + const uint8_t version; + + /** File data */ + const uint8_t data[]; +} __attribute__((packed)); + + +/** + * @internal + * Private decoder instance variables (used to hide the underlying protobuf parser). + */ +typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; + +@interface PLCrashReport : NSObject { +@private + /** Private implementation variables (used to hide the underlying protobuf parser) */ + _PLCrashReportDecoder *_decoder; + + /** System info */ + __strong PLCrashReportSystemInfo *_systemInfo; + + /** Machine info */ + __strong PLCrashReportMachineInfo *_machineInfo; + + /** Application info */ + __strong PLCrashReportApplicationInfo *_applicationInfo; + + /** Process info */ + __strong PLCrashReportProcessInfo *_processInfo; + + /** Signal info */ + __strong PLCrashReportSignalInfo *_signalInfo; + + /** Mach exception info */ + __strong PLCrashReportMachExceptionInfo *_machExceptionInfo; + + /** Thread info (PLCrashReportThreadInfo instances) */ + __strong NSArray *_threads; + + /** Binary images (PLCrashReportBinaryImageInfo instances */ + __strong NSArray *_images; + + /** Exception information (may be nil) */ + __strong PLCrashReportExceptionInfo *_exceptionInfo; + + /** User defined information (may be nil) */ + __strong NSData *_customData; + + /** Report UUID */ + CFUUIDRef _uuid; +} + +- (id) initWithData: (NSData *) encodedData error: (NSError **) outError; + +- (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address; + +/** + * System information. + */ +@property(nonatomic, readonly, strong) PLCrashReportSystemInfo *systemInfo; + +/** + * YES if machine information is available. + */ +@property(nonatomic, readonly) BOOL hasMachineInfo; + +/** + * Machine information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachineInfo *machineInfo; + +/** + * Application information. + */ +@property(nonatomic, readonly, strong) PLCrashReportApplicationInfo *applicationInfo; + +/** + * YES if process information is available. + */ +@property(nonatomic, readonly) BOOL hasProcessInfo; + +/** + * Process information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessInfo *processInfo; + +/** + * Signal information. This provides the signal and signal code of the fatal signal. + */ +@property(nonatomic, readonly, strong) PLCrashReportSignalInfo *signalInfo; + +/** + * Mach exception information, if available. This will only be included in the + * case that encoding crash reporter's exception-based reporting was enabled, and a Mach + * exception was caught. + * + * @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this + * s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the + * Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal + * mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachExceptionInfo *machExceptionInfo; + +/** + * Thread information. Returns a list of PLCrashReportThreadInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *threads; + +/** + * Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *images; + +/** + * YES if exception information is available. + */ +@property(nonatomic, readonly) BOOL hasExceptionInfo; + +/** + * Exception information. Only available if a crash was caused by an uncaught exception, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportExceptionInfo *exceptionInfo; + +/** + * Custom user data. Only available if user explicitly assigned it before crash happened, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) NSData *customData; + +/** + * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated + * by a single client. Only available in later (v1.2+) crash report format versions. If not available, + * will be NULL. + */ +@property(nonatomic, readonly) CFUUIDRef uuidRef; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h new file mode 100644 index 0000000..787a286 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h @@ -0,0 +1,62 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportApplicationInfo : NSObject { +@private + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; +} + +- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier + applicationVersion: (NSString *) applicationVersion + applicationMarketingVersion: (NSString *) applicationMarketingVersion; + +/** + * The application identifier. This is usually the application's CFBundleIdentifier value. + */ +@property(nonatomic, readonly, strong) NSString *applicationIdentifier; + +/** + * The application version. This is usually the application's CFBundleVersion value. + */ +@property(nonatomic, readonly, strong) NSString *applicationVersion; + +/** + * The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil. + */ +@property(nonatomic, readonly, strong) NSString *applicationMarketingVersion; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h new file mode 100644 index 0000000..1a75051 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h @@ -0,0 +1,95 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportBinaryImageInfo : NSObject { +@private + /** Code type */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /** Base image address */ + uint64_t _baseAddress; + + /** Image segment size */ + uint64_t _imageSize; + + /** Name of binary image */ + __strong NSString *_imageName; + + /** If the UUID is available */ + BOOL _hasImageUUID; + + /** 128-bit object UUID. May be nil. */ + __strong NSString *_imageUUID; +} + +- (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo + baseAddress: (uint64_t) baseAddress + size: (uint64_t) imageSize + name: (NSString *) imageName + uuid: (NSData *) uuid; + +/** + * Image code type, or nil if unavailable. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *codeType; + +/** + * Image base address. + */ +@property(nonatomic, readonly) uint64_t imageBaseAddress; + +/** + * Segment size. + */ +@property(nonatomic, readonly) uint64_t imageSize; + +/** + * Image name (absolute path) + */ +@property(nonatomic, readonly, strong) NSString *imageName; + + +/** + * YES if this image has an associated UUID. + */ +@property(nonatomic, readonly) BOOL hasImageUUID; + +/** + * 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable. + */ +@property(nonatomic, readonly, strong) NSString *imageUUID; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h new file mode 100644 index 0000000..7423ca9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h @@ -0,0 +1,69 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportThreadInfo.h" +#endif + +@interface PLCrashReportExceptionInfo : NSObject { +@private + /** Name */ + __strong NSString *_name; + + /** Reason */ + __strong NSString *_reason; + + /** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */ + __strong NSArray *_stackFrames; +} + +- (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason; + +- (id) initWithExceptionName: (NSString *) name + reason: (NSString *) reason + stackFrames: (NSArray *) stackFrames; + +/** + * The exception name. + */ +@property(nonatomic, readonly, strong) NSString *exceptionName; + +/** + * The exception reason. + */ +@property(nonatomic, readonly, strong) NSString *exceptionReason; + +/* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable. + * This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportFormatter.h new file mode 100644 index 0000000..5cdf01b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportFormatter.h @@ -0,0 +1,55 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReport.h" +#endif + +/** + * A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules, + * (such as implementing text output support), and returns the result. + */ +@protocol PLCrashReportFormatter + +/** + * Format the provided @a report. + * + * @param report Report to be formatted. + * @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error + * object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will + * be left unmodified. You may specify nil for this parameter, and no error information will be provided. + * + * @return Returns the formatted report data on success, or nil on failure. + */ +- (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h new file mode 100644 index 0000000..19461a5 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h @@ -0,0 +1,48 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportMachExceptionInfo : NSObject { +@private + /** The Mach exception type. */ + uint64_t _type; + + /** The Mach exception codes, represented as an ordered array of NSNumber instances. */ + __strong NSArray *_codes; +} + +- (id) initWithType: (uint64_t) type codes: (NSArray *) codes; + +/** The Mach exception type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */ +@property(nonatomic, readonly, strong) NSArray *codes; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h new file mode 100644 index 0000000..ab6fee9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h @@ -0,0 +1,77 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportMachineInfo : NSObject { +@private + /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ + __strong NSString *_modelName; + + /** The processor type. */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /* The number of actual physical processor cores. */ + NSUInteger _processorCount; + + /* The number of logical processors. */ + NSUInteger _logicalProcessorCount; +} + +- (id) initWithModelName: (NSString *) modelName + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + processorCount: (NSUInteger) processorCount + logicalProcessorCount: (NSUInteger) logicalProcessorCount; + +/** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *modelName; + +/** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +/* + * The number of actual physical processor cores. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger processorCount; + +/* + * The number of logical processors. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger logicalProcessorCount; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h new file mode 100644 index 0000000..802e8d4 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h @@ -0,0 +1,103 @@ +/* + * Author: Damian Morris + * + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportProcessInfo : NSObject { +@private + /** Process name, or nil if unavailable. */ + __strong NSString *_processName; + + /** Process ID */ + NSUInteger _processID; + + /** Process path */ + __strong NSString* _processPath; + + /** Date and time that the crashing process was started. This may be unavailable, and this property + * will be nil. */ + __strong NSDate *_processStartTime; + + /** Parent process name, or nil if unavailable. */ + __strong NSString *_parentProcessName; + + /** Parent process ID */ + NSUInteger _parentProcessID; + + /** If false, the process is being run via process-level CPU emulation (such as Rosetta). */ + BOOL _native; +} + +- (id) initWithProcessName: (NSString *) processName + processID: (NSUInteger) processID + processPath: (NSString *) processPath + processStartTime: (NSDate *) processStartTime + parentProcessName: (NSString *) parentProcessName + parentProcessID: (NSUInteger) parentProcessID + native: (BOOL) native; + +/** + * The process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processName; + +/** + * The process ID. + */ +@property(nonatomic, readonly) NSUInteger processID; + +/** + * The path to the process executable. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processPath; + +/** + * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSDate *processStartTime; + +/** + * The parent process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *parentProcessName; + +/** + * The parent process ID. + */ +@property(nonatomic, readonly) NSUInteger parentProcessID; + +/** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */ +@property(nonatomic, readonly) BOOL native; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h new file mode 100644 index 0000000..03d570b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h @@ -0,0 +1,74 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +/** + * @ingroup constants + * + * The type encodings supported for CPU types and subtypes. Currently only Apple + * Mach-O defined encodings are supported. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Unknown cpu type encoding. */ + PLCrashReportProcessorTypeEncodingUnknown = 0, + + /** Apple Mach-defined processor types. */ + PLCrashReportProcessorTypeEncodingMach = 1 +} PLCrashReportProcessorTypeEncoding; + +@interface PLCrashReportProcessorInfo : NSObject { +@private + /** Type encoding */ + PLCrashReportProcessorTypeEncoding _typeEncoding; + + /** CPU type */ + uint64_t _type; + + /** CPU subtype */ + uint64_t _subtype; +} + +- (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding + type: (uint64_t) type + subtype: (uint64_t) subtype; + +/** The CPU type encoding. */ +@property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding; + +/** The CPU type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The CPU subtype. */ +@property(nonatomic, readonly) uint64_t subtype; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h new file mode 100644 index 0000000..e0a1ca1 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportRegisterInfo : NSObject { +@private + /** Register name */ + __strong NSString *_registerName; + + /** Register value */ + uint64_t _registerValue; +} + +- (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; + +/** + * Register name. + */ +@property(nonatomic, readonly, strong) NSString *registerName; + +/** + * Register value. + */ +@property(nonatomic, readonly) uint64_t registerValue; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h new file mode 100644 index 0000000..d949211 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h @@ -0,0 +1,60 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSignalInfo : NSObject { +@private + /** Signal name */ + __strong NSString *_name; + + /** Signal code */ + __strong NSString *_code; + + /** Fauling instruction or address */ + uint64_t _address; +} + +- (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address; + +/** + * The signal name. + */ +@property(nonatomic, readonly, strong) NSString *name; + +/** + * The signal code. + */ +@property(nonatomic, readonly, strong) NSString *code; + +/** + * The faulting instruction or address. + */ +@property(nonatomic, readonly) uint64_t address; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000..5fd4acc --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,57 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportSymbolInfo.h" +#endif + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + __strong PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000..bdb367c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + __strong NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly, strong) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h new file mode 100644 index 0000000..eb8a447 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h @@ -0,0 +1,177 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashMacros.h" +#endif + +@class PLCrashReportProcessorInfo; + +/** + * @ingroup constants + * + * Indicates the Operating System under which a Crash Log was generated. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Mac OS X. */ + PLCrashReportOperatingSystemMacOSX = 0, + + /** iPhone OS */ + PLCrashReportOperatingSystemiPhoneOS = 1, + + /** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */ + PLCrashReportOperatingSystemiPhoneSimulator = 2, + + /** Unknown operating system */ + PLCrashReportOperatingSystemUnknown = 3, + + /** Apple tvOS */ + PLCrashReportOperatingSystemAppleTVOS = 4, + +} PLCrashReportOperatingSystem; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** + * @ingroup constants + * + * Indicates the architecture under which a Crash Log was generated. + * + * @note The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * will make use of the new PLCrashReportProcessorInfo CPU type encodings. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** x86-32. */ + PLCrashReportArchitectureX86_32 = 0, + + /** x86-64 */ + PLCrashReportArchitectureX86_64 = 1, + + /** ARMv6 */ + PLCrashReportArchitectureARMv6 = 2, + + /** + * ARMv6 + * @deprecated This value has been deprecated in favor of ARM subtype-specific + * values. + * @sa PLCrashReportArchitectureARMv6 + */ + PLCrashReportArchitectureARM PLCR_DEPRECATED = PLCrashReportArchitectureARMv6, + + /** PPC */ + PLCrashReportArchitecturePPC = 3, + + /** PPC64 */ + PLCrashReportArchitecturePPC64 = 4, + + /** ARMv7 */ + PLCrashReportArchitectureARMv7 = 5, + + /** Unknown */ + PLCrashReportArchitectureUnknown = 6 +} PLCrashReportArchitecture; +#pragma clang diagnostic pop + +extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); +extern PLCrashReportArchitecture PLCrashReportHostArchitecture PLCR_EXTERNAL_DEPRECATED; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); + +@interface PLCrashReportSystemInfo : NSObject { +@private + /** Operating system */ + PLCrashReportOperatingSystem _operatingSystem; + + /** Operating system version */ + __strong NSString *_osVersion; + + /** OS build. May be nil. */ + __strong NSString *_osBuild; + + /** Architecture */ + PLCrashReportArchitecture _architecture; + + /** Date crash report was generated. May be nil if the date is unknown. */ + __strong NSDate *_timestamp; + + /** Processor information. */ + __strong PLCrashReportProcessorInfo *_processorInfo; +} + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + timestamp: (NSDate *) timestamp; + +/** The operating system. */ +@property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem; + +/** The operating system's release version. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemVersion; + +/** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemBuild; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo + * extensible encoding. */ +@property(nonatomic, readonly) PLCrashReportArchitecture architecture PLCR_DEPRECATED; + +/** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSDate *timestamp; + +/** The processor type. For v1.2 reports and later, this is an alias to the machine info's processorInfo. + * For earlier reports, this will be synthesized from the deprecated architecture property. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h new file mode 100644 index 0000000..adbc251 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h @@ -0,0 +1,66 @@ +/* + * Authors: + * Landon Fuller + * Damian Morris + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportFormatter.h" +#endif + +/** + * Supported text output formats. + * + * @ingroup enums + */ +typedef enum { + /** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available + * through iTunes Connect. */ + PLCrashReportTextFormatiOS = 0 +} PLCrashReportTextFormat; + + +@interface PLCrashReportTextFormatter : NSObject { +@private + /** Text output format. */ + PLCrashReportTextFormat _textFormat; + + /** Encoding to use for string output. */ + NSStringEncoding _stringEncoding; +} + ++ (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat; + +- (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h new file mode 100644 index 0000000..b9092e2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h @@ -0,0 +1,88 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_THREAD_INFO_H +#define PLCRASH_REPORT_THREAD_INFO_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportRegisterInfo.h" +#endif + + +@interface PLCrashReportThreadInfo : NSObject { +@private + /** The thread number. Should be unique within a given crash log. */ + NSInteger _threadNumber; + + /** Ordered list of PLCrashReportStackFrame instances */ + __strong NSArray *_stackFrames; + + /** YES if this thread crashed. */ + BOOL _crashed; + + /** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */ + __strong NSArray *_registers; +} + +- (id) initWithThreadNumber: (NSInteger) threadNumber + stackFrames: (NSArray *) stackFrames + crashed: (BOOL) crashed + registers: (NSArray *) registers; + +/** + * Application thread number. + */ +@property(nonatomic, readonly) NSInteger threadNumber; + +/** + * Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances. + * The array is ordered, last callee to first. + */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +/** + * If this thread crashed, set to YES. + */ +@property(nonatomic, readonly) BOOL crashed; + +/** + * State of the general purpose and related registers, as a list of + * PLCrashReportRegister instances. If this thead did not crash (crashed returns NO), + * this list will be empty. + */ +@property(nonatomic, readonly, strong) NSArray *registers; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReporter.h new file mode 100644 index 0000000..bdc8f83 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReporter.h @@ -0,0 +1,159 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +#ifndef PLCRASH_REPORTER_H +#define PLCRASH_REPORTER_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReporterConfig.h" +#import "PLCrashMacros.h" +#endif + +@class PLCrashMachExceptionServer; +@class PLCrashMachExceptionPortSet; + +/** + * @ingroup functions + * + * Prototype of a callback function used to execute additional user code with signal information as provided + * by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk. + * + * @param info The signal info. + * @param uap The crash's threads context. + * @param context The API client's supplied context value. + * + * @sa The @ref async_safety documentation. + * @sa PLCrashReporter::setPostCrashCallbacks: + */ +typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context); + +/** + * @ingroup types + * + * This structure contains callbacks supported by PLCrashReporter to allow the host application to perform + * additional tasks prior to program termination after a crash has occurred. + * + * @sa The @ref async_safety documentation. + */ +typedef struct PLCrashReporterCallbacks { + /** The version number of this structure. If not one of the defined version numbers for this type, the behavior + * is undefined. The current version of this structure is 0. */ + uint16_t version; + + /** An arbitrary user-supplied context value. This value may be NULL. */ + void *context; + + /** + * The callback used to report caught signal information. In version 0 of this structure, all crashes will be + * reported via this function. + * + * @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived + * from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via + * PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will + * not provide valid thread state. + * + * This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained + * here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions. + */ + PLCrashReporterPostCrashSignalCallback handleSignal; +} PLCrashReporterCallbacks; + +@interface PLCrashReporter : NSObject { +@private + /** Reporter configuration */ + __strong PLCrashReporterConfig *_config; + + /** YES if the crash reporter has been enabled */ + BOOL _enabled; + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if + * the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */ + __strong PLCrashMachExceptionServer *_machServer; + + /** Previously registered Mach exception ports, if any. */ + __strong PLCrashMachExceptionPortSet *_previousMachPorts; +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ + + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; + + /** Path to the crash reporter internal data directory */ + __strong NSString *_crashReportDirectory; +} + ++ (PLCrashReporter *) sharedReporter PLCR_DEPRECATED; + +- (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config; + +- (BOOL) hasPendingCrashReport; + +- (NSData *) loadPendingCrashReportData; +- (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; + +- (NSData *) generateLiveReportWithThread: (thread_t) thread; +- (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; +- (NSData *) generateLiveReportWithThread: (thread_t) thread exception: (NSException *) exception error: (NSError **) outError; + +- (NSData *) generateLiveReport; +- (NSData *) generateLiveReportAndReturnError: (NSError **) outError; +- (NSData *) generateLiveReportWithException: (NSException *) exception error: (NSError **) outError; + +- (BOOL) purgePendingCrashReport; +- (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; + +- (BOOL) enableCrashReporter; +- (BOOL) enableCrashReporterAndReturnError: (NSError **) outError; + +- (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks; + +/** + * Return the path to live crash report (which may not yet, or ever, exist). + */ +- (NSString *) crashReportPath; + +/** + * Custom data to save in the crash report. + */ +@property(nonatomic, strong) NSData *customData; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReporterConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReporterConfig.h new file mode 100644 index 0000000..f151e56 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Headers/PLCrashReporterConfig.h @@ -0,0 +1,197 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashFeatureConfig.h" +#endif + +/** + * @ingroup enums + * Supported mechanisms for trapping and handling crashes. + */ +typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) { + /** + * Trap fatal signals via a sigaction(2)-registered BSD signal handler. + * + * PLCrashReporter's signal handler will supersede previously registered handlers; existing + * handlers will not be called. This behavior may be modified in a future release, and should + * not be relied upon as a mechanism to prevent existing signal handlers from being called. + * + * There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically: + * + * - On Mac OS X, stack overflows will only be handled on the thread on which + * the crash reporter was initialized. This should generally be the main thread. + * - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being + * non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS). + * - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting + * in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal + * handlers prior to raising SIGABRT). These __abort()-based checks are: + * - Implemented for unsafe memcpy/strcpy/snprintf C functions. + * - Only enabled when operating on a fixed-width target buffer (in which case the + * compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument). + * - Only trigger in the case that the source data exceeds the size of the fixed width target + * buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy), + * or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer), + * AND that argument can't be checked at compile-time. + */ + PLCrashReporterSignalHandlerTypeBSD = 0, + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** + * Trap fatal signals via a Mach exception server. + * + * If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that + * exception handler. Should the exceptions be handled by an existing handler, no report will be generated + * by PLCrashReporter. + * + * @par Mac OS X + * + * On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note, + * however, that some kernel-internal constants, as well as architecture-specific trap information, + * may be required to fully interpret a Mach exception's root cause. + * + * @par iOS + * + * On iOS, the APIs required for a complete implementation are not fully public. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included + * Mach exception handling as an optional feature, with both build-time and runtime configuration + * to disable its inclusion or use, respectively. + * + * @par Debugger Incompatibility + * + * The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to + * suspend all active threads (which will include the Mach exception handler). Mach-based handling + * should not be used when a debugger is attached. + * + * @par More Details + * + * For more information, refer to @ref mach_exceptions. + */ + PLCrashReporterSignalHandlerTypeMach = 1 +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ +}; + +/** + * @ingroup enums + * Supported mechanisms for performing local symbolication. + * + * Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may + * return information that is incorrect. This may still be useful in the case where DWARF data is unavailable + * for a given build; in that case, it can provide function and method names (though not line numbers) for a + * crash report that may otherwise be unusable. + * + * Note, however, this comes at the cost of a significant increase in code that must run within the critical + * crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In + * addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may + * change in future iOS releases. Given that DWARF symbolication data will always be more accurate, and + * the risks inherent in executing considerably more code at crash time, it is strongly recommended that local + * symbolication only be enabled for non-release builds. + * + * Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the + * results. + */ +typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) { + /** No symbolication. */ + PLCrashReporterSymbolicationStrategyNone = 0, + + /** + * Use the standard binary symbol table. On iOS, this alone will return + * incomplete results, as most symbols are rewritten to the common '\' string. + */ + PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0, + + /** + * Use Objective-C metadata to find method and class names. This relies on detailed parsing + * of the Objective-C runtime data, including undefined flags and other runtime internals. As such, + * it may return incorrect data should the runtime be changed incompatibly. + */ + PLCrashReporterSymbolicationStrategyObjC = 1 << 1, + + /** + * Enable all available symbolication strategies. + */ + PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC) +}; + +@interface PLCrashReporterConfig : NSObject { +@private + /** The configured signal handler type. */ + PLCrashReporterSignalHandlerType _signalHandlerType; + + /** The configured symbolication strategy. */ + PLCrashReporterSymbolicationStrategy _symbolicationStrategy; + + /** + * Flag indicating if the uncaughtExceptionHandler should be initialized or not. It usually is, except in a + * Xamarin environment. + */ + BOOL _shouldRegisterUncaughtExceptionHandler; +} + ++ (instancetype) defaultConfiguration; + +- (instancetype) init; + +- (instancetype) initWithBasePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + basePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler + basePath: (NSString *) basePath; + +/** The base path to save the crash data. */ +@property(nonatomic, readonly) NSString *basePath; + +/** The configured signal handler type. */ +@property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType; + +/** The configured symbolication strategy. */ +@property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy; + +/** Should PLCrashReporter regiser an uncaught exception handler? This is entended to be used in Xamarin apps */ +@property(nonatomic, readonly) BOOL shouldRegisterUncaughtExceptionHandler; + +@end + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Modules/module.modulemap b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Modules/module.modulemap new file mode 100644 index 0000000..4fa4304 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module CrashReporter { + umbrella header "CrashReporter.h" + + export * + module * { export * } + + link framework "Foundation" +} diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Resources/Info.plist b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Resources/Info.plist new file mode 100644 index 0000000..6d222e8 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Resources/Info.plist @@ -0,0 +1,48 @@ + + + + + BuildMachineOSBuild + 21G531 + CFBundleDevelopmentRegion + English + CFBundleExecutable + CrashReporter + CFBundleIdentifier + com.microsoft.CrashReporter + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CrashReporter + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.11.1 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1.11.1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 13C100 + DTPlatformName + macosx + DTPlatformVersion + 12.1 + DTSDKBuild + 21C46 + DTSDKName + macosx12.1 + DTXcode + 1321 + DTXcodeBuild + 13C100 + LSMinimumSystemVersion + 10.9 + + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/CrashReporter b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/CrashReporter new file mode 100644 index 0000000..568ad50 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/CrashReporter differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/CrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/CrashReporter.h new file mode 100644 index 0000000..99878d3 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/CrashReporter.h @@ -0,0 +1,366 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifdef __APPLE__ +#import +#endif + +#if __has_include() + +// This must be included before any other PLCrashReporter includes, as +// it redefines symbol names +#import + +/* Library Imports */ +#import +#import +#import +#else +#import "PLCrashNamespace.h" +#import "PLCrashReporter.h" +#import "PLCrashReport.h" +#import "PLCrashReportTextFormatter.h" +#endif + +/** + * @defgroup functions Crash Reporter Functions Reference + */ + +/** + * @defgroup types Crash Reporter Data Types Reference + */ + +/** + * @defgroup constants Crash Reporter Constants Reference + */ + +/** + * @internal + * @defgroup plcrash_internal Crash Reporter Internal Documentation + */ + +/** + * @defgroup enums Enumerations + * @ingroup constants + */ + +/** + * @defgroup globals Global Variables + * @ingroup constants + */ + +/** + * @defgroup exceptions Exceptions + * @ingroup constants + */ + +/* Exceptions */ +extern NSString *PLCrashReporterException; + +/* Error Domain and Codes */ +extern NSString *PLCrashReporterErrorDomain; + +/** + * NSError codes in the Plausible Crash Reporter error domain. + * @ingroup enums + */ +typedef enum { + /** An unknown error has occured. If this + * code is received, it is a bug, and should be reported. */ + PLCrashReporterErrorUnknown = 0, + + /** An Mach or POSIX operating system error has occured. The underlying NSError cause may be fetched from the userInfo + * dictionary using the NSUnderlyingErrorKey key. */ + PLCrashReporterErrorOperatingSystem = 1, + + /** The crash report log file is corrupt or invalid */ + PLCrashReporterErrorCrashReportInvalid = 2, + + /** An attempt to use a resource which was in use at the time in a manner which would have conflicted with the request. */ + PLCrashReporterErrorResourceBusy = 3 +} PLCrashReporterError; + +/** + * @mainpage Plausible Crash Reporter + * + * @section intro_sec Introduction + * + * Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X. + * + * The following features are supported: + * + * - Implemented as an in-process signal handler. + * - Does not interfer with debugging in gdb.. + * - Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc). + * - Full thread state for all active threads (backtraces, register dumps) is provided. + * + * If your application crashes, a crash report will be written. When the application is next run, you may check for a + * pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the + * report locally. + * + * @section intro_encoding Crash Report Format + * + * Crash logs are encoded using google protobuf, and may be decoded + * using the provided PLCrashReport API. Additionally, the include plcrashutil handles conversion of binary crash reports to the + * symbolicate-compatible iPhone text format. + * + * @section doc_sections Documentation Sections + * - @subpage example_usage_iphone + * - @subpage error_handling + * - @subpage async_safety + */ + +/** + * @page example_usage_iphone Example iPhone Usage + * + * @code + * // + * // Called to handle a pending crash report. + * // + * - (void) handleCrashReport { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSData *crashData; + * NSError *error; + * + * // Try loading the crash report + * crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error]; + * if (crashData == nil) { + * NSLog(@"Could not load crash report: %@", error); + * goto finish; + * } + * + * // We could send the report from here, but we'll just print out + * // some debugging info instead + * PLCrashReport *report = [[[PLCrashReport alloc] initWithData: crashData error: &error] autorelease]; + * if (report == nil) { + * NSLog(@"Could not parse crash report"); + * goto finish; + * } + * + * NSLog(@"Crashed on %@", report.systemInfo.timestamp); + * NSLog(@"Crashed with signal %@ (code %@, address=0x%" PRIx64 ")", report.signalInfo.name, + * report.signalInfo.code, report.signalInfo.address); + * + * // Purge the report + * finish: + * [crashReporter purgePendingCrashReport]; + * return; + * } + * + * // from UIApplicationDelegate protocol + * - (void) applicationDidFinishLaunching: (UIApplication *) application { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSError *error; + * + * // Check if we previously crashed + * if ([crashReporter hasPendingCrashReport]) + * [self handleCrashReport]; + + * // Enable the Crash Reporter + * if (![crashReporter enableCrashReporterAndReturnError: &error]) + * NSLog(@"Warning: Could not enable crash reporter: %@", error); + * + * } + * @endcode + * + */ + +/** + * @page error_handling Error Handling Programming Guide + * + * Where a method may return an error, Plausible Crash Reporter provides access to the underlying + * cause via an optional NSError argument. + * + * All returned errors will be a member of one of the below defined domains, however, new domains and + * error codes may be added at any time. If you do not wish to report on the error cause, many methods + * support a simple form that requires no NSError argument. + * + * @section error_domains Error Domains, Codes, and User Info + * + * @subsection crashreporter_errors Crash Reporter Errors + * + * Any errors in Plausible Crash Reporter use the #PLCrashReporterErrorDomain error domain, and and one + * of the error codes defined in #PLCrashReporterError. + */ + +/** + * @page async_safety Async-Safe Programming Guide + * + * Plausible CrashReporter provides support for executing an application specified function in the context of the + * crash reporter's signal handler, after the crash report has been written to disk. This was a regularly requested + * feature, and provides the ability to implement application finalization in the event of a crash. However, writing + * code intended for execution inside of a signal handler is exceptionally difficult, and is not recommended. + * + * @section program_flow Program Flow and Signal Handlers + * + * When the signal handler is called the normal flow of the program is interrupted, and your program is an unknown + * state. Locks may be held, the heap may be corrupt (or in the process of being updated), and your signal + * handler may invoke a function that was being executed at the time of the signal. This may result in deadlocks, + * data corruption, and program termination. + * + * @section functions Async-Safe Functions + * + * A subset of functions are defined to be async-safe by the OS, and are safely callable from within a signal handler. If + * you do implement a custom post-crash handler, it must be async-safe. A table of POSIX-defined async-safe functions + * and additional information is available from the + * CERT programming guide - SIG30-C + * + * Most notably, the Objective-C runtime itself is not async-safe, and Objective-C may not be used within a signal + * handler. + * + * @sa PLCrashReporter::setCrashCallbacks: + */ + +/** + * @page mach_exceptions Mach Exceptions on Mac OS X and iOS + * + * PLCrashReporter includes support for monitoring crashes via an in-process Mach exception handler. There are a small + * number of crash cases that will not be caught with via a POSIX signal handler, but can be caught via a Mach + * exception handler: + * + * - Stack overflow. sigaltstack() is broken in later iOS releases, and even if functional, must be configured + * on a per-thread basis. + * - Internal Apple assertions that call libSystem's __assert. These include compiler-checked constraints + * for built-in functions, such as strcpy_chk(). The __abort() implementation actually disables the SIGABRT + * signal handler (resetting it to SIG_DFL) prior to to issueing a SIGABRT, bypassing signal-based crash + * reporters entirely. + * + * Unfortunately, the latter issue (__assert) can not be handled on iOS; trapping abort requires that + * a Mach exception handler operate out-of-process, which is impossible on iOS. On Mac OS X, this will + * only be handled once we've implemented fully out-of-process crash excution. + * + * On Mac OS X, the Mach exception implementation is fully supported using entirely public API. On iOS, + * the APIs required are not fully public -- more details on the implications of this for exception handling on + * iOS may be found in @ref mach_exceptions_ios below. It is worth noting that even where the Mach exception APIs + * are fully supported, kernel-internal constants, as well + * as architecture-specific trap information, may be required to fully interpret a Mach exception's root cause. + * + * For example, the EXC_SOFTWARE exception is dispatched for four different failure types, using the exception + * code to differentiate failure types: + * - Non-existent system call invoked (SIGSYS) + * - Write on a pipe with no reader (SIGPIPE) + * - Abort program (SIGABRT -- unused) + * - Kill program (SIGKILL) + * + * Of those four types, only the constant required to interpret the SIGKILL behavior (EXC_SOFT_SIGNAL) is publicly defined. + * Of the remaining three failure types, the constant values are kernel implementation-private, defined only in the available + * kernel sources. On iOS, these sources are unavailable, and while they generally do match the Mac OS X implementation, there + * are no gaurantees that this is -- or will remain -- the case in the future. + * + * Likewise, interpretation of particular fault types requires information regarding the underlying machine traps + * that triggered the Mach exceptions. For example, a floating point trap on x86/x86-64 will trigger an EXC_ARITHMETIC, + * with a subcode value containing the value of the FPU status register. Determining the exact FPU cause requires + * extracting the actual exception flags from status register as per the x86 architecture documentation. The exact format + * of this subcode value is not actually documented outside the kernel, and may change in future releases. + * + * While we have the advantage of access to the x86 kernel sources, the situation on ARM is even less clear. The actual + * use of the Mach exception codes and subcodes is largely undefined by both headers and publicly available documentation, + * and the available x86 kernel sources are of little use in interpreting this data. + * + * As such, while Mach exceptions may catch some cases that BSD signals can not, they are not a perfect solution, + * and may also provide less insight into the actual failures that occur. By comparison, the BSD signal interface + * is both fully defined and architecture independent, with any necessary interpretation of the Mach exception + * codes handled in-kernel at the time of exception dispatch. It is generally recommended by Apple as the preferred + * interface, and should generally be preferred by PLCrashReporter API clients. + * + * @section mach_exceptions_compatibility Compatibility Issues + * + * @subsection Debuggers + * + * Enabling in-process Mach exception handlers will conflict with any attached debuggers; the debugger + * may suspend the processes Mach exception handling thread, which will result in any exception messages + * sent via the debugger being lost, as the in-process handler will be unable to receive and forward + * the messages. + * + * @subsection Managed Runtimes (Xamarin, Unity) + * + * A Mach exception handler may conflict with any managed runtime that registers a BSD signal handler that + * can safely handle otherwise fatal signals, allowing execution to proceed. This includes products + * such as Xamarin for iOS. + * + * In such a case, PLCrashReporter will write a crash report for non-fatal signals, as there is no + * immediate mechanism for determining whether a signal handler exists and that it can safely + * handle the failure. This can result in unexpected delays in application execution, increased I/O to + * disk, and other undesirable operations. + * + * @section mach_exceptions_ios Mach Exceptions on iOS + * + * The APIs required for Mach exception handling are not fully public on iOS. After filing a request with + * Apple DTS to clarify the status of the Mach exception APIs on iOS, and implementing a Mach Exception + * handler using only supported API, they provided the following guidance: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited undefined API on iOS. The reporter + * may be excluded entirely at build time by modifying the PLCRASH_FEATURE_MACH_EXCEPTIONS build configuration; it + * may also be disabled at runtime by configuring the PLCrashReporter instance appropriately via PLCrashReporterConfig. + * + * The iOS implementation is implemented almost entirely using public API, and links against no actual private symbols; + * the use of undocumented functionality is limited to assuming the use of specific msgh_id values (see below + * for details). As a result, it may be considered perfectly safe to include the Mach Exception code in the + * standard build, and enable/disable it at runtime. + * + * The following issues exist in the iOS implementation: + * - The msgh_id values required for an exception reply message are not available from the available + * headers and must be hard-coded. This prevents one from safely replying to exception messages, which + * means that it is impossible to (correctly) inform the server that an exception has *not* been + * handled. + * + * Impact: + * This can lead to the process locking up and not dispatching to the host exception handler (eg, Apple's + * crash reporter), depending on the behavior of the kernel exception code. + * + * - The mach_* structure/type variants required by MACH_EXCEPTION_CODES are not publicly defined (on Mac OS X, + * these are provided by mach_exc.defs). This prevents one from forwarding exception messages to an existing + * handler that was registered with a MACH_EXCEPTION_CODES behavior (eg, forwarding is entirely non-functional + * on ARM64 devices). + * + * Impact: + * This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES, + * including other handlers registered within the current process, eg, by a managed runtime. This could + * also result in misinterpretation of a Mach exception message, in the case where the message format is + * modified by Apple to be incompatible with the existing 32-bit format. + * + * This is the case with LLDB; it will register a task exception handler with MACH_EXCEPTION_CODES set. Failure + * to correctly forward these exceptions will result in the debugger breaking in interesting ways; for example, + * changes to the set of dyld-loaded images are detected by setting a breakpoint on the dyld image registration + * funtions, and this functionality will break if the exception is not correctly forwarded. + * + * Since Mach exception handling is important for a fully functional crash reporter, we have also filed a radar + * to request that the API be made public: + * Radar: rdar://12939497 RFE: Provide mach_exc.defs for iOS + * + * At the time of this writing, the radar remains open/unresolved. + */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h new file mode 100644 index 0000000..7bcaebf --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashFeatureConfig.h @@ -0,0 +1,108 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_FEATURE_CONFIG_H +#define PLCRASH_FEATURE_CONFIG_H + +#include + +/** + * @internal + * + * Build-time configuration for PLCrashReporter. + * + * This is used to automatically enable/disable features on a per-platform and per-configuration + * basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter. + * + * @defgroup build_config Build Configuration + * @ingroup constants + * @{ + */ + +/* + * Defaults + */ + +/* + * For release builds, disable unused unwind implementations on targets that do not use them. For non-release + * builds, we include the unwind implementations to allow testing on a broader range of targets. + */ +#ifdef PLCF_RELEASE_BUILD +# if defined(__arm__) +# ifndef PLCRASH_FEATURE_UNWIND_DWARF +# define PLCRASH_FEATURE_UNWIND_DWARF 0 +# endif +# ifndef PLCRASH_FEATURE_UNWIND_COMPACT +# define PLCRASH_FEATURE_UNWIND_COMPACT 0 +# endif +# endif +#endif + +/* + * Configuration Flags + */ + + +#ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS +/** + * If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported, + * using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a + * popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either + * they've received special dispensation to use private APIs / private structures, they've found another way to do + * it, or they're just using undocumented functionality and hoping for the best. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled + * Mach exception handling by default, and provided both build-time and runtime configuration + * to disable its use. + * + * For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions. + */ +#if TARGET_OS_TV +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 0 +#else +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 1 +#endif +#endif + +#ifndef PLCRASH_FEATURE_UNWIND_DWARF +/** If true, enable DWARF unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_DWARF 1 +#endif + + +#ifndef PLCRASH_FEATURE_UNWIND_COMPACT +/** If true, enable compact unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_COMPACT 1 +#endif + +/* + * @} + */ + +#endif /* PLCRASH_FEATURE_CONFIG_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashMacros.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashMacros.h new file mode 100644 index 0000000..556e1c2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashMacros.h @@ -0,0 +1,143 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_CONSTANTS_H +#define PLCRASH_CONSTANTS_H + +#include +#include + +#if defined(__cplusplus) +# define PLCR_EXPORT extern "C" +# define PLCR_C_BEGIN_DECLS extern "C" { +# define PLCR_C_END_DECLS } +#else +# define PLCR_EXPORT extern +# define PLCR_C_BEGIN_DECLS +# define PLCR_C_END_DECLS +#endif + +#if defined(__cplusplus) +# define NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ +# define IS_EMPTY_(name) defined(NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ ## name) +# define IS_EMPTY(name) IS_EMPTY_(name) +# if defined(PLCRASHREPORTER_PREFIX) && !IS_EMPTY(PLCRASHREPORTER_PREFIX) + /** @internal Define the plcrash namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ +# define PLCR_CPP_BEGIN_NS namespace plcrash { inline namespace PLCRASHREPORTER_PREFIX { + + /** @internal Close the definition of the `plcrash` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ +# define PLCR_CPP_END_NS }} +# else +# define PLCR_CPP_BEGIN_NS namespace plcrash { +# define PLCR_CPP_END_NS } +# endif +#endif + +#ifdef __clang__ +# define PLCR_PRAGMA_CLANG(_p) _Pragma(_p) +#else +# define PLCR_PRAGMA_CLANG(_p) +#endif + +#ifdef __clang__ +# define PLCR_DEPRECATED __attribute__((deprecated)) +#else +# define PLCR_DEPRECATED +#endif + +#if defined(__clang__) || defined(__GNUC__) +# define PLCR_UNUSED __attribute__((unused)) +#else +# define PLCR_UNUSED +#endif + +#ifdef PLCR_PRIVATE +/** + * Marks a definition as deprecated only for for external clients, allowing + * uses of it internal fo the framework. + */ +# define PLCR_EXTERNAL_DEPRECATED + +/** + * @internal + * A macro to put above a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() \ + PLCR_PRAGMA_CLANG("clang diagnostic push"); \ + PLCR_PRAGMA_CLANG("clang diagnostic ignored \"-Wdocumentation-deprecated-sync\"") + +/** + * @internal + * A macro to put below a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_POP() PLCR_PRAGMA_CLANG("clang diagnostic pop") + +#else + +# define PLCR_EXTERNAL_DEPRECATED PLCR_DEPRECATED +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() + +#endif /* PLCR_PRIVATE */ + +#ifdef PLCR_PRIVATE +# if defined(__clang__) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") +# define PLCR_FALLTHROUGH [[clang::fallthrough]] +# else +# define PLCR_FALLTHROUGH do {} while (0) +# endif +#endif + +#ifdef PLCR_PRIVATE +/** + * @internal + * Static compile-time assertion. + * + * @param name The assertion name; must be valid for use within a C identifier. + * @param cond Assertion condition + */ +# define PLCR_ASSERT_STATIC(name, cond) PLCR_ASSERT_STATIC_(name, cond, __LINE__) +/* + * C++11 and C11 both provide a static_assert(). + * + * Otherwise, we have to use typedef-based static assertions. + */ +# if (defined(__cplusplus) && __cplusplus >= 201103L) || (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(#name, cond) +# define PLCR_ASSERT_STATIC__(name, cond) static_assert(cond, #name) +# else +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(name, cond, line) +# define PLCR_ASSERT_STATIC__(name, cond, line) typedef int plcf_static_assert_##name##_##line [(cond) ? 1 : -1] PLCR_UNUSED +# endif +#endif /* PLCR_PRIVATE */ + +#endif /* PLCRASH_CONSTANTS_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashNamespace.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashNamespace.h new file mode 100644 index 0000000..f4c263c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashNamespace.h @@ -0,0 +1,320 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +// #define PLCRASHREPORTER_PREFIX AcmeCo + + +// We need two extra layers of indirection to make CPP substitute +// the PLCRASHREPORTER_PREFIX define. +#define PLNS_impl2(prefix, symbol) prefix ## symbol +#define PLNS_impl(prefix, symbol) PLNS_impl2(prefix, symbol) +#define PLNS(symbol) PLNS_impl(PLCRASHREPORTER_PREFIX, symbol) + + +/* + * Rewrite all ObjC/C symbols. + * + * For C++ symbol handling, refer to the PLCR_CPP_BEGIN_NS and PLCR_CPP_END_NS + * macros. + */ +#ifdef PLCRASHREPORTER_PREFIX + +/* Objective-C Classes */ +#define PLCrashMachExceptionServer PLNS(PLCrashMachExceptionServer) +#define PLCrashReport PLNS(PLCrashReport) +#define PLCrashReportApplicationInfo PLNS(PLCrashReportApplicationInfo) +#define PLCrashReportBinaryImageInfo PLNS(PLCrashReportBinaryImageInfo) +#define PLCrashReportExceptionInfo PLNS(PLCrashReportExceptionInfo) +#define PLCrashReportMachExceptionInfo PLNS(PLCrashReportMachExceptionInfo) +#define PLCrashReportMachineInfo PLNS(PLCrashReportMachineInfo) +#define PLCrashReportProcessInfo PLNS(PLCrashReportProcessInfo) +#define PLCrashReportProcessorInfo PLNS(PLCrashReportProcessorInfo) +#define PLCrashReportRegisterInfo PLNS(PLCrashReportRegisterInfo) +#define PLCrashReportSignalInfo PLNS(PLCrashReportSignalInfo) +#define PLCrashReportStackFrameInfo PLNS(PLCrashReportStackFrameInfo) +#define PLCrashReportSymbolInfo PLNS(PLCrashReportSymbolInfo) +#define PLCrashReportSystemInfo PLNS(PLCrashReportSystemInfo) +#define PLCrashReportTextFormatter PLNS(PLCrashReportTextFormatter) +#define PLCrashReportThreadInfo PLNS(PLCrashReportThreadInfo) +#define PLCrashReporter PLNS(PLCrashReporter) +#define PLCrashSignalHandler PLNS(PLCrashSignalHandler) +#define PLCrashHostInfo PLNS(PLCrashHostInfo) +#define PLCrashMachExceptionPort PLNS(PLCrashMachExceptionPort) +#define PLCrashMachExceptionPortSet PLNS(PLCrashMachExceptionPortSet) +#define PLCrashProcessInfo PLNS(PLCrashProcessInfo) +#define PLCrashReporterConfig PLNS(PLCrashReporterConfig) +#define PLCrashUncaughtExceptionHandler PLNS(PLCrashUncaughtExceptionHandler) +#define PLCrashReportFormatter PLNS(PLCrashReportFormatter) + +/* Public C functions */ +#define PLCrashMachExceptionForward PLNS(PLCrashMachExceptionForward) +#define PLCrashSignalHandlerForward PLNS(PLCrashSignalHandlerForward) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) + + +/* Public C global symbols */ +#define PLCrashReporterErrorDomain PLNS(PLCrashReporterErrorDomain) +#define PLCrashReportHostArchitecture PLNS(PLCrashReportHostArchitecture) +#define PLCrashReportHostOperatingSystem PLNS(PLCrashReportHostOperatingSystem) +#define PLCrashReporterException PLNS(PLCrashReporterException) + +/* For backwards compatibility, plcrash_async_byteorder vends C++ methods when included under C++. We have + * to handle this distinctly from our PLCR_CPP_BEGIN_NS C++ namespacing mechanism. */ +#define plcrash_async_byteorder PLNS(plcrash_async_byteorder) + +/* + * All private C symbols. Once these are migrated to C++, we'll be able to use the much simpler + * PLCR_CPP_BEGIN_NS machinery. + * + * This list was automatically generated (and can be updated) by setting PLCRASHREPORTER_PREFIX to 'AcmeCo', + * building the library, and executing the following: + * nm -g -U | grep '^[0-9]' | c++filt | grep -v AcmeCo | grep -E '_pl|_PL' | awk '{print $3}' | cut -c 2- | sort | uniq | awk '{print "#define",$1,"PLNS("$1")"}' + */ +#define pl_mach_thread_self PLNS(pl_mach_thread_self) +#define plcrash__architecture__descriptor PLNS(plcrash__architecture__descriptor) +#define plcrash__crash_report__application_info__descriptor PLNS(plcrash__crash_report__application_info__descriptor) +#define plcrash__crash_report__application_info__init PLNS(plcrash__crash_report__application_info__init) +#define plcrash__crash_report__binary_image__descriptor PLNS(plcrash__crash_report__binary_image__descriptor) +#define plcrash__crash_report__binary_image__init PLNS(plcrash__crash_report__binary_image__init) +#define plcrash__crash_report__descriptor PLNS(plcrash__crash_report__descriptor) +#define plcrash__crash_report__exception__descriptor PLNS(plcrash__crash_report__exception__descriptor) +#define plcrash__crash_report__exception__init PLNS(plcrash__crash_report__exception__init) +#define plcrash__crash_report__free_unpacked PLNS(plcrash__crash_report__free_unpacked) +#define plcrash__crash_report__get_packed_size PLNS(plcrash__crash_report__get_packed_size) +#define plcrash__crash_report__init PLNS(plcrash__crash_report__init) +#define plcrash__crash_report__machine_info__descriptor PLNS(plcrash__crash_report__machine_info__descriptor) +#define plcrash__crash_report__machine_info__init PLNS(plcrash__crash_report__machine_info__init) +#define plcrash__crash_report__pack PLNS(plcrash__crash_report__pack) +#define plcrash__crash_report__pack_to_buffer PLNS(plcrash__crash_report__pack_to_buffer) +#define plcrash__crash_report__process_info__descriptor PLNS(plcrash__crash_report__process_info__descriptor) +#define plcrash__crash_report__process_info__init PLNS(plcrash__crash_report__process_info__init) +#define plcrash__crash_report__processor__descriptor PLNS(plcrash__crash_report__processor__descriptor) +#define plcrash__crash_report__processor__init PLNS(plcrash__crash_report__processor__init) +#define plcrash__crash_report__processor__type_encoding__descriptor PLNS(plcrash__crash_report__processor__type_encoding__descriptor) +#define plcrash__crash_report__report_info__descriptor PLNS(plcrash__crash_report__report_info__descriptor) +#define plcrash__crash_report__report_info__init PLNS(plcrash__crash_report__report_info__init) +#define plcrash__crash_report__signal__descriptor PLNS(plcrash__crash_report__signal__descriptor) +#define plcrash__crash_report__signal__init PLNS(plcrash__crash_report__signal__init) +#define plcrash__crash_report__signal__mach_exception__descriptor PLNS(plcrash__crash_report__signal__mach_exception__descriptor) +#define plcrash__crash_report__signal__mach_exception__init PLNS(plcrash__crash_report__signal__mach_exception__init) +#define plcrash__crash_report__symbol__descriptor PLNS(plcrash__crash_report__symbol__descriptor) +#define plcrash__crash_report__symbol__init PLNS(plcrash__crash_report__symbol__init) +#define plcrash__crash_report__system_info__descriptor PLNS(plcrash__crash_report__system_info__descriptor) +#define plcrash__crash_report__system_info__init PLNS(plcrash__crash_report__system_info__init) +#define plcrash__crash_report__system_info__operating_system__descriptor PLNS(plcrash__crash_report__system_info__operating_system__descriptor) +#define plcrash__crash_report__thread__descriptor PLNS(plcrash__crash_report__thread__descriptor) +#define plcrash__crash_report__thread__init PLNS(plcrash__crash_report__thread__init) +#define plcrash__crash_report__thread__register_value__descriptor PLNS(plcrash__crash_report__thread__register_value__descriptor) +#define plcrash__crash_report__thread__register_value__init PLNS(plcrash__crash_report__thread__register_value__init) +#define plcrash__crash_report__thread__stack_frame__descriptor PLNS(plcrash__crash_report__thread__stack_frame__descriptor) +#define plcrash__crash_report__thread__stack_frame__init PLNS(plcrash__crash_report__thread__stack_frame__init) +#define plcrash__crash_report__unpack PLNS(plcrash__crash_report__unpack) +#define plcrash_async_address_apply_offset PLNS(plcrash_async_address_apply_offset) +#define plcrash_async_byteorder_big_endian PLNS(plcrash_async_byteorder_big_endian) +#define plcrash_async_byteorder_direct PLNS(plcrash_async_byteorder_direct) +#define plcrash_async_byteorder_little_endian PLNS(plcrash_async_byteorder_little_endian) +#define plcrash_async_byteorder_swapped PLNS(plcrash_async_byteorder_swapped) +#define plcrash_async_cfe_entry_apply PLNS(plcrash_async_cfe_entry_apply) +#define plcrash_async_cfe_entry_free PLNS(plcrash_async_cfe_entry_free) +#define plcrash_async_cfe_entry_init PLNS(plcrash_async_cfe_entry_init) +#define plcrash_async_cfe_entry_register_count PLNS(plcrash_async_cfe_entry_register_count) +#define plcrash_async_cfe_entry_register_list PLNS(plcrash_async_cfe_entry_register_list) +#define plcrash_async_cfe_entry_return_address_register PLNS(plcrash_async_cfe_entry_return_address_register) +#define plcrash_async_cfe_entry_stack_adjustment PLNS(plcrash_async_cfe_entry_stack_adjustment) +#define plcrash_async_cfe_entry_stack_offset PLNS(plcrash_async_cfe_entry_stack_offset) +#define plcrash_async_cfe_entry_type PLNS(plcrash_async_cfe_entry_type) +#define plcrash_async_cfe_reader_find_pc PLNS(plcrash_async_cfe_reader_find_pc) +#define plcrash_async_cfe_reader_free PLNS(plcrash_async_cfe_reader_free) +#define plcrash_async_cfe_reader_init PLNS(plcrash_async_cfe_reader_init) +#define plcrash_async_cfe_register_decode PLNS(plcrash_async_cfe_register_decode) +#define plcrash_async_cfe_register_encode PLNS(plcrash_async_cfe_register_encode) +#define plcrash_async_file_close PLNS(plcrash_async_file_close) +#define plcrash_async_file_flush PLNS(plcrash_async_file_flush) +#define plcrash_async_file_init PLNS(plcrash_async_file_init) +#define plcrash_async_file_write PLNS(plcrash_async_file_write) +#define plcrash_async_find_symbol PLNS(plcrash_async_find_symbol) +#define plcrash_async_image_containing_address PLNS(plcrash_async_image_containing_address) +#define plcrash_async_image_list_next PLNS(plcrash_async_image_list_next) +#define plcrash_async_image_list_set_reading PLNS(plcrash_async_image_list_set_reading) +#define plcrash_async_mach_exception_get_siginfo PLNS(plcrash_async_mach_exception_get_siginfo) +#define plcrash_async_macho_byteorder PLNS(plcrash_async_macho_byteorder) +#define plcrash_async_macho_contains_address PLNS(plcrash_async_macho_contains_address) +#define plcrash_async_macho_cpu_subtype PLNS(plcrash_async_macho_cpu_subtype) +#define plcrash_async_macho_cpu_type PLNS(plcrash_async_macho_cpu_type) +#define plcrash_async_macho_find_command PLNS(plcrash_async_macho_find_command) +#define plcrash_async_macho_find_segment_cmd PLNS(plcrash_async_macho_find_segment_cmd) +#define plcrash_async_macho_find_symbol_by_name PLNS(plcrash_async_macho_find_symbol_by_name) +#define plcrash_async_macho_find_symbol_by_pc PLNS(plcrash_async_macho_find_symbol_by_pc) +#define plcrash_async_macho_header PLNS(plcrash_async_macho_header) +#define plcrash_async_macho_header_size PLNS(plcrash_async_macho_header_size) +#define plcrash_async_macho_map_section PLNS(plcrash_async_macho_map_section) +#define plcrash_async_macho_map_segment PLNS(plcrash_async_macho_map_segment) +#define plcrash_async_macho_mapped_segment_free PLNS(plcrash_async_macho_mapped_segment_free) +#define plcrash_async_macho_next_command PLNS(plcrash_async_macho_next_command) +#define plcrash_async_macho_next_command_type PLNS(plcrash_async_macho_next_command_type) +#define plcrash_async_macho_string_free PLNS(plcrash_async_macho_string_free) +#define plcrash_async_macho_string_get_length PLNS(plcrash_async_macho_string_get_length) +#define plcrash_async_macho_string_get_pointer PLNS(plcrash_async_macho_string_get_pointer) +#define plcrash_async_macho_string_init PLNS(plcrash_async_macho_string_init) +#define plcrash_async_macho_symtab_reader_free PLNS(plcrash_async_macho_symtab_reader_free) +#define plcrash_async_macho_symtab_reader_init PLNS(plcrash_async_macho_symtab_reader_init) +#define plcrash_async_macho_symtab_reader_read PLNS(plcrash_async_macho_symtab_reader_read) +#define plcrash_async_macho_symtab_reader_symbol_name PLNS(plcrash_async_macho_symtab_reader_symbol_name) +#define plcrash_async_memcpy PLNS(plcrash_async_memcpy) +#define plcrash_async_memset PLNS(plcrash_async_memset) +#define plcrash_async_mobject_base_address PLNS(plcrash_async_mobject_base_address) +#define plcrash_async_mobject_free PLNS(plcrash_async_mobject_free) +#define plcrash_async_mobject_init PLNS(plcrash_async_mobject_init) +#define plcrash_async_mobject_length PLNS(plcrash_async_mobject_length) +#define plcrash_async_mobject_read_uint16 PLNS(plcrash_async_mobject_read_uint16) +#define plcrash_async_mobject_read_uint32 PLNS(plcrash_async_mobject_read_uint32) +#define plcrash_async_mobject_read_uint64 PLNS(plcrash_async_mobject_read_uint64) +#define plcrash_async_mobject_read_uint8 PLNS(plcrash_async_mobject_read_uint8) +#define plcrash_async_mobject_remap_address PLNS(plcrash_async_mobject_remap_address) +#define plcrash_async_mobject_task PLNS(plcrash_async_mobject_task) +#define plcrash_async_mobject_verify_local_pointer PLNS(plcrash_async_mobject_verify_local_pointer) +#define plcrash_async_objc_cache_free PLNS(plcrash_async_objc_cache_free) +#define plcrash_async_objc_cache_init PLNS(plcrash_async_objc_cache_init) +#define plcrash_async_objc_find_method PLNS(plcrash_async_objc_find_method) +#define plcrash_async_signal_sigcode PLNS(plcrash_async_signal_sigcode) +#define plcrash_async_signal_signame PLNS(plcrash_async_signal_signame) +#define plcrash_async_strcmp PLNS(plcrash_async_strcmp) +#define plcrash_async_strerror PLNS(plcrash_async_strerror) +#define plcrash_async_strncmp PLNS(plcrash_async_strncmp) +#define plcrash_async_symbol_cache_free PLNS(plcrash_async_symbol_cache_free) +#define plcrash_async_symbol_cache_init PLNS(plcrash_async_symbol_cache_init) +#define plcrash_async_task_memcpy PLNS(plcrash_async_task_memcpy) +#define plcrash_async_task_read_uint16 PLNS(plcrash_async_task_read_uint16) +#define plcrash_async_task_read_uint32 PLNS(plcrash_async_task_read_uint32) +#define plcrash_async_task_read_uint64 PLNS(plcrash_async_task_read_uint64) +#define plcrash_async_task_read_uint8 PLNS(plcrash_async_task_read_uint8) +#define plcrash_async_thread_state_clear_all_regs PLNS(plcrash_async_thread_state_clear_all_regs) +#define plcrash_async_thread_state_clear_reg PLNS(plcrash_async_thread_state_clear_reg) +#define plcrash_async_thread_state_clear_volatile_regs PLNS(plcrash_async_thread_state_clear_volatile_regs) +#define plcrash_async_thread_state_copy PLNS(plcrash_async_thread_state_copy) +#define plcrash_async_thread_state_current PLNS(plcrash_async_thread_state_current) +#define plcrash_async_thread_state_current_stub PLNS(plcrash_async_thread_state_current_stub) +#define plcrash_async_thread_state_get_greg_size PLNS(plcrash_async_thread_state_get_greg_size) +#define plcrash_async_thread_state_get_reg PLNS(plcrash_async_thread_state_get_reg) +#define plcrash_async_thread_state_get_reg_count PLNS(plcrash_async_thread_state_get_reg_count) +#define plcrash_async_thread_state_get_reg_name PLNS(plcrash_async_thread_state_get_reg_name) +#define plcrash_async_thread_state_get_stack_direction PLNS(plcrash_async_thread_state_get_stack_direction) +#define plcrash_async_thread_state_has_reg PLNS(plcrash_async_thread_state_has_reg) +#define plcrash_async_thread_state_init PLNS(plcrash_async_thread_state_init) +#define plcrash_async_thread_state_mach_thread_init PLNS(plcrash_async_thread_state_mach_thread_init) +#define plcrash_async_thread_state_map_dwarf_to_reg PLNS(plcrash_async_thread_state_map_dwarf_to_reg) +#define plcrash_async_thread_state_map_reg_to_dwarf PLNS(plcrash_async_thread_state_map_reg_to_dwarf) +#define plcrash_async_thread_state_mcontext_init PLNS(plcrash_async_thread_state_mcontext_init) +#define plcrash_async_thread_state_set_reg PLNS(plcrash_async_thread_state_set_reg) +#define plcrash_async_writen PLNS(plcrash_async_writen) +#define plcrash_log_writer_close PLNS(plcrash_log_writer_close) +#define plcrash_log_writer_free PLNS(plcrash_log_writer_free) +#define plcrash_log_writer_init PLNS(plcrash_log_writer_init) +#define plcrash_log_writer_set_exception PLNS(plcrash_log_writer_set_exception) +#define plcrash_log_writer_write PLNS(plcrash_log_writer_write) +#define plcrash_log_writer_set_custom_data PLNS(plcrash_log_writer_set_custom_data) +#define plcrash_nasync_image_list_append PLNS(plcrash_nasync_image_list_append) +#define plcrash_nasync_image_list_free PLNS(plcrash_nasync_image_list_free) +#define plcrash_nasync_image_list_init PLNS(plcrash_nasync_image_list_init) +#define plcrash_nasync_image_list_remove PLNS(plcrash_nasync_image_list_remove) +#define plcrash_nasync_macho_free PLNS(plcrash_nasync_macho_free) +#define plcrash_nasync_macho_init PLNS(plcrash_nasync_macho_init) +#define plcrash_populate_error PLNS(plcrash_populate_error) +#define plcrash_populate_mach_error PLNS(plcrash_populate_mach_error) +#define plcrash_populate_posix_error PLNS(plcrash_populate_posix_error) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) +#define plcrash_sysctl_int PLNS(plcrash_sysctl_int) +#define plcrash_sysctl_string PLNS(plcrash_sysctl_string) +#define plcrash_sysctl_valid_utf8_bytes PLNS(plcrash_sysctl_valid_utf8_bytes) +#define plcrash_sysctl_valid_utf8_bytes_max PLNS(plcrash_sysctl_valid_utf8_bytes_max) +#define plcrash_writer_pack PLNS(plcrash_writer_pack) +#define plframe_cursor_free PLNS(plframe_cursor_free) +#define plframe_cursor_get_reg PLNS(plframe_cursor_get_reg) +#define plframe_cursor_get_regcount PLNS(plframe_cursor_get_regcount) +#define plframe_cursor_get_regname PLNS(plframe_cursor_get_regname) +#define plframe_cursor_init PLNS(plframe_cursor_init) +#define plframe_cursor_next PLNS(plframe_cursor_next) +#define plframe_cursor_next_with_readers PLNS(plframe_cursor_next_with_readers) +#define plframe_cursor_read_compact_unwind PLNS(plframe_cursor_read_compact_unwind) +#define plframe_cursor_read_dwarf_unwind PLNS(plframe_cursor_read_dwarf_unwind) +#define plframe_cursor_read_frame_ptr PLNS(plframe_cursor_read_frame_ptr) +#define plframe_cursor_thread_init PLNS(plframe_cursor_thread_init) +#define plframe_strerror PLNS(plframe_strerror) + +#endif + +/* + * The following symbols are exported by the protobuf-c library. When building + * a shared library, we can hide these as private symbols. + * + * However, when building a static library, we can only do so if we use + * MH_OBJECT "single object prelink". The MH_OBJECT approach allows us to apply + * symbol hiding/aliasing/etc similar to that supported by dylibs, but because it is + * seemingly unused within Apple, the use thereof regularly introduces linking bugs + * and errors in new Xcode releases. + * + * Rather than fighting the linker, we use the namespacing machinery to rewrite these + * symbols, but only when explicitly compiling PLCrashReporter. Since protobuf-c is a library + * that may be used elsewhere, we don't want to rewrite these symbols if they're used + * independently by PLCrashReporter API clients. + */ +#ifdef PLCR_PRIVATE + /* If no prefix has been defined, we need to specify our own private prefix */ +# ifndef PLCRASHREPORTER_PREFIX +# define PLCRASHREPORTER_PREFIX PL_ +# endif + +# define protobuf_c_buffer_simple_append PLNS(protobuf_c_buffer_simple_append) +# define protobuf_c_empty_string PLNS(protobuf_c_empty_string) +# define protobuf_c_enum_descriptor_get_value PLNS(protobuf_c_enum_descriptor_get_value) +# define protobuf_c_enum_descriptor_get_value_by_name PLNS(protobuf_c_enum_descriptor_get_value_by_name) +# define protobuf_c_message_check PLNS(protobuf_c_message_check) +# define protobuf_c_message_descriptor_get_field PLNS(protobuf_c_message_descriptor_get_field) +# define protobuf_c_message_descriptor_get_field_by_name PLNS(protobuf_c_message_descriptor_get_field_by_name) +# define protobuf_c_message_free_unpacked PLNS(protobuf_c_message_free_unpacked) +# define protobuf_c_message_get_packed_size PLNS(protobuf_c_message_get_packed_size) +# define protobuf_c_message_init PLNS(protobuf_c_message_init) +# define protobuf_c_message_pack PLNS(protobuf_c_message_pack) +# define protobuf_c_message_pack_to_buffer PLNS(protobuf_c_message_pack_to_buffer) +# define protobuf_c_message_unpack PLNS(protobuf_c_message_unpack) +# define protobuf_c_service_descriptor_get_method_by_name PLNS(protobuf_c_service_descriptor_get_method_by_name) +# define protobuf_c_service_destroy PLNS(protobuf_c_service_destroy) +# define protobuf_c_service_generated_init PLNS(protobuf_c_service_generated_init) +# define protobuf_c_service_invoke_internal PLNS(protobuf_c_service_invoke_internal) +# define protobuf_c_version PLNS(protobuf_c_version) +# define protobuf_c_version_number PLNS(protobuf_c_version_number) +#endif /* PLCR_PRIVATE */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h new file mode 100644 index 0000000..f710c3f --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReport.h @@ -0,0 +1,230 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_H +#define PLCRASH_REPORT_H + +#if __has_include() +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#else +#import "PLCrashReportApplicationInfo.h" +#import "PLCrashReportBinaryImageInfo.h" +#import "PLCrashReportExceptionInfo.h" +#import "PLCrashReportMachineInfo.h" +#import "PLCrashReportMachExceptionInfo.h" +#import "PLCrashReportProcessInfo.h" +#import "PLCrashReportProcessorInfo.h" +#import "PLCrashReportRegisterInfo.h" +#import "PLCrashReportSignalInfo.h" +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportSymbolInfo.h" +#import "PLCrashReportSystemInfo.h" +#import "PLCrashReportThreadInfo.h" +#endif + +/** + * @ingroup constants + * Crash file magic identifier */ +#define PLCRASH_REPORT_FILE_MAGIC "plcrash" + +/** + * @ingroup constants + * Crash format version byte identifier. Will not change outside of the introduction of + * an entirely new crash log format. */ +#define PLCRASH_REPORT_FILE_VERSION 1 + +/** + * @ingroup types + * Crash log file header format. + * + * Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC), + * followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION). + * The crash log message format itself is extensible, so this version number will only + * be incremented in the event of an incompatible encoding or format change. + */ +struct PLCrashReportFileHeader { + /** Crash log magic identifier, not NULL terminated */ + const char magic[7]; + + /** Crash log encoding/format version */ + const uint8_t version; + + /** File data */ + const uint8_t data[]; +} __attribute__((packed)); + + +/** + * @internal + * Private decoder instance variables (used to hide the underlying protobuf parser). + */ +typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; + +@interface PLCrashReport : NSObject { +@private + /** Private implementation variables (used to hide the underlying protobuf parser) */ + _PLCrashReportDecoder *_decoder; + + /** System info */ + __strong PLCrashReportSystemInfo *_systemInfo; + + /** Machine info */ + __strong PLCrashReportMachineInfo *_machineInfo; + + /** Application info */ + __strong PLCrashReportApplicationInfo *_applicationInfo; + + /** Process info */ + __strong PLCrashReportProcessInfo *_processInfo; + + /** Signal info */ + __strong PLCrashReportSignalInfo *_signalInfo; + + /** Mach exception info */ + __strong PLCrashReportMachExceptionInfo *_machExceptionInfo; + + /** Thread info (PLCrashReportThreadInfo instances) */ + __strong NSArray *_threads; + + /** Binary images (PLCrashReportBinaryImageInfo instances */ + __strong NSArray *_images; + + /** Exception information (may be nil) */ + __strong PLCrashReportExceptionInfo *_exceptionInfo; + + /** User defined information (may be nil) */ + __strong NSData *_customData; + + /** Report UUID */ + CFUUIDRef _uuid; +} + +- (id) initWithData: (NSData *) encodedData error: (NSError **) outError; + +- (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address; + +/** + * System information. + */ +@property(nonatomic, readonly, strong) PLCrashReportSystemInfo *systemInfo; + +/** + * YES if machine information is available. + */ +@property(nonatomic, readonly) BOOL hasMachineInfo; + +/** + * Machine information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachineInfo *machineInfo; + +/** + * Application information. + */ +@property(nonatomic, readonly, strong) PLCrashReportApplicationInfo *applicationInfo; + +/** + * YES if process information is available. + */ +@property(nonatomic, readonly) BOOL hasProcessInfo; + +/** + * Process information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessInfo *processInfo; + +/** + * Signal information. This provides the signal and signal code of the fatal signal. + */ +@property(nonatomic, readonly, strong) PLCrashReportSignalInfo *signalInfo; + +/** + * Mach exception information, if available. This will only be included in the + * case that encoding crash reporter's exception-based reporting was enabled, and a Mach + * exception was caught. + * + * @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this + * s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the + * Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal + * mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachExceptionInfo *machExceptionInfo; + +/** + * Thread information. Returns a list of PLCrashReportThreadInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *threads; + +/** + * Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *images; + +/** + * YES if exception information is available. + */ +@property(nonatomic, readonly) BOOL hasExceptionInfo; + +/** + * Exception information. Only available if a crash was caused by an uncaught exception, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportExceptionInfo *exceptionInfo; + +/** + * Custom user data. Only available if user explicitly assigned it before crash happened, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) NSData *customData; + +/** + * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated + * by a single client. Only available in later (v1.2+) crash report format versions. If not available, + * will be NULL. + */ +@property(nonatomic, readonly) CFUUIDRef uuidRef; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h new file mode 100644 index 0000000..787a286 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportApplicationInfo.h @@ -0,0 +1,62 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportApplicationInfo : NSObject { +@private + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; +} + +- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier + applicationVersion: (NSString *) applicationVersion + applicationMarketingVersion: (NSString *) applicationMarketingVersion; + +/** + * The application identifier. This is usually the application's CFBundleIdentifier value. + */ +@property(nonatomic, readonly, strong) NSString *applicationIdentifier; + +/** + * The application version. This is usually the application's CFBundleVersion value. + */ +@property(nonatomic, readonly, strong) NSString *applicationVersion; + +/** + * The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil. + */ +@property(nonatomic, readonly, strong) NSString *applicationMarketingVersion; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h new file mode 100644 index 0000000..1a75051 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportBinaryImageInfo.h @@ -0,0 +1,95 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportBinaryImageInfo : NSObject { +@private + /** Code type */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /** Base image address */ + uint64_t _baseAddress; + + /** Image segment size */ + uint64_t _imageSize; + + /** Name of binary image */ + __strong NSString *_imageName; + + /** If the UUID is available */ + BOOL _hasImageUUID; + + /** 128-bit object UUID. May be nil. */ + __strong NSString *_imageUUID; +} + +- (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo + baseAddress: (uint64_t) baseAddress + size: (uint64_t) imageSize + name: (NSString *) imageName + uuid: (NSData *) uuid; + +/** + * Image code type, or nil if unavailable. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *codeType; + +/** + * Image base address. + */ +@property(nonatomic, readonly) uint64_t imageBaseAddress; + +/** + * Segment size. + */ +@property(nonatomic, readonly) uint64_t imageSize; + +/** + * Image name (absolute path) + */ +@property(nonatomic, readonly, strong) NSString *imageName; + + +/** + * YES if this image has an associated UUID. + */ +@property(nonatomic, readonly) BOOL hasImageUUID; + +/** + * 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable. + */ +@property(nonatomic, readonly, strong) NSString *imageUUID; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h new file mode 100644 index 0000000..7423ca9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportExceptionInfo.h @@ -0,0 +1,69 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportThreadInfo.h" +#endif + +@interface PLCrashReportExceptionInfo : NSObject { +@private + /** Name */ + __strong NSString *_name; + + /** Reason */ + __strong NSString *_reason; + + /** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */ + __strong NSArray *_stackFrames; +} + +- (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason; + +- (id) initWithExceptionName: (NSString *) name + reason: (NSString *) reason + stackFrames: (NSArray *) stackFrames; + +/** + * The exception name. + */ +@property(nonatomic, readonly, strong) NSString *exceptionName; + +/** + * The exception reason. + */ +@property(nonatomic, readonly, strong) NSString *exceptionReason; + +/* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable. + * This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h new file mode 100644 index 0000000..5cdf01b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportFormatter.h @@ -0,0 +1,55 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReport.h" +#endif + +/** + * A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules, + * (such as implementing text output support), and returns the result. + */ +@protocol PLCrashReportFormatter + +/** + * Format the provided @a report. + * + * @param report Report to be formatted. + * @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error + * object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will + * be left unmodified. You may specify nil for this parameter, and no error information will be provided. + * + * @return Returns the formatted report data on success, or nil on failure. + */ +- (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h new file mode 100644 index 0000000..19461a5 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachExceptionInfo.h @@ -0,0 +1,48 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportMachExceptionInfo : NSObject { +@private + /** The Mach exception type. */ + uint64_t _type; + + /** The Mach exception codes, represented as an ordered array of NSNumber instances. */ + __strong NSArray *_codes; +} + +- (id) initWithType: (uint64_t) type codes: (NSArray *) codes; + +/** The Mach exception type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */ +@property(nonatomic, readonly, strong) NSArray *codes; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h new file mode 100644 index 0000000..ab6fee9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportMachineInfo.h @@ -0,0 +1,77 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportMachineInfo : NSObject { +@private + /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ + __strong NSString *_modelName; + + /** The processor type. */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /* The number of actual physical processor cores. */ + NSUInteger _processorCount; + + /* The number of logical processors. */ + NSUInteger _logicalProcessorCount; +} + +- (id) initWithModelName: (NSString *) modelName + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + processorCount: (NSUInteger) processorCount + logicalProcessorCount: (NSUInteger) logicalProcessorCount; + +/** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *modelName; + +/** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +/* + * The number of actual physical processor cores. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger processorCount; + +/* + * The number of logical processors. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger logicalProcessorCount; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h new file mode 100644 index 0000000..802e8d4 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessInfo.h @@ -0,0 +1,103 @@ +/* + * Author: Damian Morris + * + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportProcessInfo : NSObject { +@private + /** Process name, or nil if unavailable. */ + __strong NSString *_processName; + + /** Process ID */ + NSUInteger _processID; + + /** Process path */ + __strong NSString* _processPath; + + /** Date and time that the crashing process was started. This may be unavailable, and this property + * will be nil. */ + __strong NSDate *_processStartTime; + + /** Parent process name, or nil if unavailable. */ + __strong NSString *_parentProcessName; + + /** Parent process ID */ + NSUInteger _parentProcessID; + + /** If false, the process is being run via process-level CPU emulation (such as Rosetta). */ + BOOL _native; +} + +- (id) initWithProcessName: (NSString *) processName + processID: (NSUInteger) processID + processPath: (NSString *) processPath + processStartTime: (NSDate *) processStartTime + parentProcessName: (NSString *) parentProcessName + parentProcessID: (NSUInteger) parentProcessID + native: (BOOL) native; + +/** + * The process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processName; + +/** + * The process ID. + */ +@property(nonatomic, readonly) NSUInteger processID; + +/** + * The path to the process executable. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processPath; + +/** + * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSDate *processStartTime; + +/** + * The parent process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *parentProcessName; + +/** + * The parent process ID. + */ +@property(nonatomic, readonly) NSUInteger parentProcessID; + +/** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */ +@property(nonatomic, readonly) BOOL native; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h new file mode 100644 index 0000000..03d570b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportProcessorInfo.h @@ -0,0 +1,74 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +/** + * @ingroup constants + * + * The type encodings supported for CPU types and subtypes. Currently only Apple + * Mach-O defined encodings are supported. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Unknown cpu type encoding. */ + PLCrashReportProcessorTypeEncodingUnknown = 0, + + /** Apple Mach-defined processor types. */ + PLCrashReportProcessorTypeEncodingMach = 1 +} PLCrashReportProcessorTypeEncoding; + +@interface PLCrashReportProcessorInfo : NSObject { +@private + /** Type encoding */ + PLCrashReportProcessorTypeEncoding _typeEncoding; + + /** CPU type */ + uint64_t _type; + + /** CPU subtype */ + uint64_t _subtype; +} + +- (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding + type: (uint64_t) type + subtype: (uint64_t) subtype; + +/** The CPU type encoding. */ +@property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding; + +/** The CPU type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The CPU subtype. */ +@property(nonatomic, readonly) uint64_t subtype; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h new file mode 100644 index 0000000..e0a1ca1 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportRegisterInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportRegisterInfo : NSObject { +@private + /** Register name */ + __strong NSString *_registerName; + + /** Register value */ + uint64_t _registerValue; +} + +- (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; + +/** + * Register name. + */ +@property(nonatomic, readonly, strong) NSString *registerName; + +/** + * Register value. + */ +@property(nonatomic, readonly) uint64_t registerValue; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h new file mode 100644 index 0000000..d949211 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportSignalInfo.h @@ -0,0 +1,60 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSignalInfo : NSObject { +@private + /** Signal name */ + __strong NSString *_name; + + /** Signal code */ + __strong NSString *_code; + + /** Fauling instruction or address */ + uint64_t _address; +} + +- (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address; + +/** + * The signal name. + */ +@property(nonatomic, readonly, strong) NSString *name; + +/** + * The signal code. + */ +@property(nonatomic, readonly, strong) NSString *code; + +/** + * The faulting instruction or address. + */ +@property(nonatomic, readonly) uint64_t address; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000..5fd4acc --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,57 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportSymbolInfo.h" +#endif + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + __strong PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000..bdb367c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + __strong NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly, strong) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h new file mode 100644 index 0000000..eb8a447 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportSystemInfo.h @@ -0,0 +1,177 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashMacros.h" +#endif + +@class PLCrashReportProcessorInfo; + +/** + * @ingroup constants + * + * Indicates the Operating System under which a Crash Log was generated. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Mac OS X. */ + PLCrashReportOperatingSystemMacOSX = 0, + + /** iPhone OS */ + PLCrashReportOperatingSystemiPhoneOS = 1, + + /** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */ + PLCrashReportOperatingSystemiPhoneSimulator = 2, + + /** Unknown operating system */ + PLCrashReportOperatingSystemUnknown = 3, + + /** Apple tvOS */ + PLCrashReportOperatingSystemAppleTVOS = 4, + +} PLCrashReportOperatingSystem; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** + * @ingroup constants + * + * Indicates the architecture under which a Crash Log was generated. + * + * @note The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * will make use of the new PLCrashReportProcessorInfo CPU type encodings. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** x86-32. */ + PLCrashReportArchitectureX86_32 = 0, + + /** x86-64 */ + PLCrashReportArchitectureX86_64 = 1, + + /** ARMv6 */ + PLCrashReportArchitectureARMv6 = 2, + + /** + * ARMv6 + * @deprecated This value has been deprecated in favor of ARM subtype-specific + * values. + * @sa PLCrashReportArchitectureARMv6 + */ + PLCrashReportArchitectureARM PLCR_DEPRECATED = PLCrashReportArchitectureARMv6, + + /** PPC */ + PLCrashReportArchitecturePPC = 3, + + /** PPC64 */ + PLCrashReportArchitecturePPC64 = 4, + + /** ARMv7 */ + PLCrashReportArchitectureARMv7 = 5, + + /** Unknown */ + PLCrashReportArchitectureUnknown = 6 +} PLCrashReportArchitecture; +#pragma clang diagnostic pop + +extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); +extern PLCrashReportArchitecture PLCrashReportHostArchitecture PLCR_EXTERNAL_DEPRECATED; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); + +@interface PLCrashReportSystemInfo : NSObject { +@private + /** Operating system */ + PLCrashReportOperatingSystem _operatingSystem; + + /** Operating system version */ + __strong NSString *_osVersion; + + /** OS build. May be nil. */ + __strong NSString *_osBuild; + + /** Architecture */ + PLCrashReportArchitecture _architecture; + + /** Date crash report was generated. May be nil if the date is unknown. */ + __strong NSDate *_timestamp; + + /** Processor information. */ + __strong PLCrashReportProcessorInfo *_processorInfo; +} + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + timestamp: (NSDate *) timestamp; + +/** The operating system. */ +@property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem; + +/** The operating system's release version. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemVersion; + +/** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemBuild; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo + * extensible encoding. */ +@property(nonatomic, readonly) PLCrashReportArchitecture architecture PLCR_DEPRECATED; + +/** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSDate *timestamp; + +/** The processor type. For v1.2 reports and later, this is an alias to the machine info's processorInfo. + * For earlier reports, this will be synthesized from the deprecated architecture property. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h new file mode 100644 index 0000000..adbc251 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportTextFormatter.h @@ -0,0 +1,66 @@ +/* + * Authors: + * Landon Fuller + * Damian Morris + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportFormatter.h" +#endif + +/** + * Supported text output formats. + * + * @ingroup enums + */ +typedef enum { + /** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available + * through iTunes Connect. */ + PLCrashReportTextFormatiOS = 0 +} PLCrashReportTextFormat; + + +@interface PLCrashReportTextFormatter : NSObject { +@private + /** Text output format. */ + PLCrashReportTextFormat _textFormat; + + /** Encoding to use for string output. */ + NSStringEncoding _stringEncoding; +} + ++ (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat; + +- (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h new file mode 100644 index 0000000..b9092e2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReportThreadInfo.h @@ -0,0 +1,88 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_THREAD_INFO_H +#define PLCRASH_REPORT_THREAD_INFO_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportRegisterInfo.h" +#endif + + +@interface PLCrashReportThreadInfo : NSObject { +@private + /** The thread number. Should be unique within a given crash log. */ + NSInteger _threadNumber; + + /** Ordered list of PLCrashReportStackFrame instances */ + __strong NSArray *_stackFrames; + + /** YES if this thread crashed. */ + BOOL _crashed; + + /** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */ + __strong NSArray *_registers; +} + +- (id) initWithThreadNumber: (NSInteger) threadNumber + stackFrames: (NSArray *) stackFrames + crashed: (BOOL) crashed + registers: (NSArray *) registers; + +/** + * Application thread number. + */ +@property(nonatomic, readonly) NSInteger threadNumber; + +/** + * Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances. + * The array is ordered, last callee to first. + */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +/** + * If this thread crashed, set to YES. + */ +@property(nonatomic, readonly) BOOL crashed; + +/** + * State of the general purpose and related registers, as a list of + * PLCrashReportRegister instances. If this thead did not crash (crashed returns NO), + * this list will be empty. + */ +@property(nonatomic, readonly, strong) NSArray *registers; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h new file mode 100644 index 0000000..bdc8f83 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReporter.h @@ -0,0 +1,159 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +#ifndef PLCRASH_REPORTER_H +#define PLCRASH_REPORTER_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReporterConfig.h" +#import "PLCrashMacros.h" +#endif + +@class PLCrashMachExceptionServer; +@class PLCrashMachExceptionPortSet; + +/** + * @ingroup functions + * + * Prototype of a callback function used to execute additional user code with signal information as provided + * by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk. + * + * @param info The signal info. + * @param uap The crash's threads context. + * @param context The API client's supplied context value. + * + * @sa The @ref async_safety documentation. + * @sa PLCrashReporter::setPostCrashCallbacks: + */ +typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context); + +/** + * @ingroup types + * + * This structure contains callbacks supported by PLCrashReporter to allow the host application to perform + * additional tasks prior to program termination after a crash has occurred. + * + * @sa The @ref async_safety documentation. + */ +typedef struct PLCrashReporterCallbacks { + /** The version number of this structure. If not one of the defined version numbers for this type, the behavior + * is undefined. The current version of this structure is 0. */ + uint16_t version; + + /** An arbitrary user-supplied context value. This value may be NULL. */ + void *context; + + /** + * The callback used to report caught signal information. In version 0 of this structure, all crashes will be + * reported via this function. + * + * @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived + * from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via + * PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will + * not provide valid thread state. + * + * This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained + * here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions. + */ + PLCrashReporterPostCrashSignalCallback handleSignal; +} PLCrashReporterCallbacks; + +@interface PLCrashReporter : NSObject { +@private + /** Reporter configuration */ + __strong PLCrashReporterConfig *_config; + + /** YES if the crash reporter has been enabled */ + BOOL _enabled; + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if + * the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */ + __strong PLCrashMachExceptionServer *_machServer; + + /** Previously registered Mach exception ports, if any. */ + __strong PLCrashMachExceptionPortSet *_previousMachPorts; +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ + + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; + + /** Path to the crash reporter internal data directory */ + __strong NSString *_crashReportDirectory; +} + ++ (PLCrashReporter *) sharedReporter PLCR_DEPRECATED; + +- (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config; + +- (BOOL) hasPendingCrashReport; + +- (NSData *) loadPendingCrashReportData; +- (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; + +- (NSData *) generateLiveReportWithThread: (thread_t) thread; +- (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; +- (NSData *) generateLiveReportWithThread: (thread_t) thread exception: (NSException *) exception error: (NSError **) outError; + +- (NSData *) generateLiveReport; +- (NSData *) generateLiveReportAndReturnError: (NSError **) outError; +- (NSData *) generateLiveReportWithException: (NSException *) exception error: (NSError **) outError; + +- (BOOL) purgePendingCrashReport; +- (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; + +- (BOOL) enableCrashReporter; +- (BOOL) enableCrashReporterAndReturnError: (NSError **) outError; + +- (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks; + +/** + * Return the path to live crash report (which may not yet, or ever, exist). + */ +- (NSString *) crashReportPath; + +/** + * Custom data to save in the crash report. + */ +@property(nonatomic, strong) NSData *customData; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h new file mode 100644 index 0000000..f151e56 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Headers/PLCrashReporterConfig.h @@ -0,0 +1,197 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashFeatureConfig.h" +#endif + +/** + * @ingroup enums + * Supported mechanisms for trapping and handling crashes. + */ +typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) { + /** + * Trap fatal signals via a sigaction(2)-registered BSD signal handler. + * + * PLCrashReporter's signal handler will supersede previously registered handlers; existing + * handlers will not be called. This behavior may be modified in a future release, and should + * not be relied upon as a mechanism to prevent existing signal handlers from being called. + * + * There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically: + * + * - On Mac OS X, stack overflows will only be handled on the thread on which + * the crash reporter was initialized. This should generally be the main thread. + * - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being + * non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS). + * - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting + * in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal + * handlers prior to raising SIGABRT). These __abort()-based checks are: + * - Implemented for unsafe memcpy/strcpy/snprintf C functions. + * - Only enabled when operating on a fixed-width target buffer (in which case the + * compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument). + * - Only trigger in the case that the source data exceeds the size of the fixed width target + * buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy), + * or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer), + * AND that argument can't be checked at compile-time. + */ + PLCrashReporterSignalHandlerTypeBSD = 0, + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** + * Trap fatal signals via a Mach exception server. + * + * If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that + * exception handler. Should the exceptions be handled by an existing handler, no report will be generated + * by PLCrashReporter. + * + * @par Mac OS X + * + * On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note, + * however, that some kernel-internal constants, as well as architecture-specific trap information, + * may be required to fully interpret a Mach exception's root cause. + * + * @par iOS + * + * On iOS, the APIs required for a complete implementation are not fully public. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included + * Mach exception handling as an optional feature, with both build-time and runtime configuration + * to disable its inclusion or use, respectively. + * + * @par Debugger Incompatibility + * + * The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to + * suspend all active threads (which will include the Mach exception handler). Mach-based handling + * should not be used when a debugger is attached. + * + * @par More Details + * + * For more information, refer to @ref mach_exceptions. + */ + PLCrashReporterSignalHandlerTypeMach = 1 +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ +}; + +/** + * @ingroup enums + * Supported mechanisms for performing local symbolication. + * + * Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may + * return information that is incorrect. This may still be useful in the case where DWARF data is unavailable + * for a given build; in that case, it can provide function and method names (though not line numbers) for a + * crash report that may otherwise be unusable. + * + * Note, however, this comes at the cost of a significant increase in code that must run within the critical + * crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In + * addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may + * change in future iOS releases. Given that DWARF symbolication data will always be more accurate, and + * the risks inherent in executing considerably more code at crash time, it is strongly recommended that local + * symbolication only be enabled for non-release builds. + * + * Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the + * results. + */ +typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) { + /** No symbolication. */ + PLCrashReporterSymbolicationStrategyNone = 0, + + /** + * Use the standard binary symbol table. On iOS, this alone will return + * incomplete results, as most symbols are rewritten to the common '\' string. + */ + PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0, + + /** + * Use Objective-C metadata to find method and class names. This relies on detailed parsing + * of the Objective-C runtime data, including undefined flags and other runtime internals. As such, + * it may return incorrect data should the runtime be changed incompatibly. + */ + PLCrashReporterSymbolicationStrategyObjC = 1 << 1, + + /** + * Enable all available symbolication strategies. + */ + PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC) +}; + +@interface PLCrashReporterConfig : NSObject { +@private + /** The configured signal handler type. */ + PLCrashReporterSignalHandlerType _signalHandlerType; + + /** The configured symbolication strategy. */ + PLCrashReporterSymbolicationStrategy _symbolicationStrategy; + + /** + * Flag indicating if the uncaughtExceptionHandler should be initialized or not. It usually is, except in a + * Xamarin environment. + */ + BOOL _shouldRegisterUncaughtExceptionHandler; +} + ++ (instancetype) defaultConfiguration; + +- (instancetype) init; + +- (instancetype) initWithBasePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + basePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler + basePath: (NSString *) basePath; + +/** The base path to save the crash data. */ +@property(nonatomic, readonly) NSString *basePath; + +/** The configured signal handler type. */ +@property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType; + +/** The configured symbolication strategy. */ +@property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy; + +/** Should PLCrashReporter regiser an uncaught exception handler? This is entended to be used in Xamarin apps */ +@property(nonatomic, readonly) BOOL shouldRegisterUncaughtExceptionHandler; + +@end + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Modules/module.modulemap b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..4fa4304 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module CrashReporter { + umbrella header "CrashReporter.h" + + export * + module * { export * } + + link framework "Foundation" +} diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Resources/Info.plist b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..6d222e8 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,48 @@ + + + + + BuildMachineOSBuild + 21G531 + CFBundleDevelopmentRegion + English + CFBundleExecutable + CrashReporter + CFBundleIdentifier + com.microsoft.CrashReporter + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CrashReporter + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.11.1 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1.11.1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 13C100 + DTPlatformName + macosx + DTPlatformVersion + 12.1 + DTSDKBuild + 21C46 + DTSDKName + macosx12.1 + DTXcode + 1321 + DTXcodeBuild + 13C100 + LSMinimumSystemVersion + 10.9 + + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/CrashReporter b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/CrashReporter new file mode 100644 index 0000000..568ad50 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/CrashReporter differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/CrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/CrashReporter.h new file mode 100644 index 0000000..99878d3 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/CrashReporter.h @@ -0,0 +1,366 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifdef __APPLE__ +#import +#endif + +#if __has_include() + +// This must be included before any other PLCrashReporter includes, as +// it redefines symbol names +#import + +/* Library Imports */ +#import +#import +#import +#else +#import "PLCrashNamespace.h" +#import "PLCrashReporter.h" +#import "PLCrashReport.h" +#import "PLCrashReportTextFormatter.h" +#endif + +/** + * @defgroup functions Crash Reporter Functions Reference + */ + +/** + * @defgroup types Crash Reporter Data Types Reference + */ + +/** + * @defgroup constants Crash Reporter Constants Reference + */ + +/** + * @internal + * @defgroup plcrash_internal Crash Reporter Internal Documentation + */ + +/** + * @defgroup enums Enumerations + * @ingroup constants + */ + +/** + * @defgroup globals Global Variables + * @ingroup constants + */ + +/** + * @defgroup exceptions Exceptions + * @ingroup constants + */ + +/* Exceptions */ +extern NSString *PLCrashReporterException; + +/* Error Domain and Codes */ +extern NSString *PLCrashReporterErrorDomain; + +/** + * NSError codes in the Plausible Crash Reporter error domain. + * @ingroup enums + */ +typedef enum { + /** An unknown error has occured. If this + * code is received, it is a bug, and should be reported. */ + PLCrashReporterErrorUnknown = 0, + + /** An Mach or POSIX operating system error has occured. The underlying NSError cause may be fetched from the userInfo + * dictionary using the NSUnderlyingErrorKey key. */ + PLCrashReporterErrorOperatingSystem = 1, + + /** The crash report log file is corrupt or invalid */ + PLCrashReporterErrorCrashReportInvalid = 2, + + /** An attempt to use a resource which was in use at the time in a manner which would have conflicted with the request. */ + PLCrashReporterErrorResourceBusy = 3 +} PLCrashReporterError; + +/** + * @mainpage Plausible Crash Reporter + * + * @section intro_sec Introduction + * + * Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X. + * + * The following features are supported: + * + * - Implemented as an in-process signal handler. + * - Does not interfer with debugging in gdb.. + * - Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc). + * - Full thread state for all active threads (backtraces, register dumps) is provided. + * + * If your application crashes, a crash report will be written. When the application is next run, you may check for a + * pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the + * report locally. + * + * @section intro_encoding Crash Report Format + * + * Crash logs are encoded using google protobuf, and may be decoded + * using the provided PLCrashReport API. Additionally, the include plcrashutil handles conversion of binary crash reports to the + * symbolicate-compatible iPhone text format. + * + * @section doc_sections Documentation Sections + * - @subpage example_usage_iphone + * - @subpage error_handling + * - @subpage async_safety + */ + +/** + * @page example_usage_iphone Example iPhone Usage + * + * @code + * // + * // Called to handle a pending crash report. + * // + * - (void) handleCrashReport { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSData *crashData; + * NSError *error; + * + * // Try loading the crash report + * crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error]; + * if (crashData == nil) { + * NSLog(@"Could not load crash report: %@", error); + * goto finish; + * } + * + * // We could send the report from here, but we'll just print out + * // some debugging info instead + * PLCrashReport *report = [[[PLCrashReport alloc] initWithData: crashData error: &error] autorelease]; + * if (report == nil) { + * NSLog(@"Could not parse crash report"); + * goto finish; + * } + * + * NSLog(@"Crashed on %@", report.systemInfo.timestamp); + * NSLog(@"Crashed with signal %@ (code %@, address=0x%" PRIx64 ")", report.signalInfo.name, + * report.signalInfo.code, report.signalInfo.address); + * + * // Purge the report + * finish: + * [crashReporter purgePendingCrashReport]; + * return; + * } + * + * // from UIApplicationDelegate protocol + * - (void) applicationDidFinishLaunching: (UIApplication *) application { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSError *error; + * + * // Check if we previously crashed + * if ([crashReporter hasPendingCrashReport]) + * [self handleCrashReport]; + + * // Enable the Crash Reporter + * if (![crashReporter enableCrashReporterAndReturnError: &error]) + * NSLog(@"Warning: Could not enable crash reporter: %@", error); + * + * } + * @endcode + * + */ + +/** + * @page error_handling Error Handling Programming Guide + * + * Where a method may return an error, Plausible Crash Reporter provides access to the underlying + * cause via an optional NSError argument. + * + * All returned errors will be a member of one of the below defined domains, however, new domains and + * error codes may be added at any time. If you do not wish to report on the error cause, many methods + * support a simple form that requires no NSError argument. + * + * @section error_domains Error Domains, Codes, and User Info + * + * @subsection crashreporter_errors Crash Reporter Errors + * + * Any errors in Plausible Crash Reporter use the #PLCrashReporterErrorDomain error domain, and and one + * of the error codes defined in #PLCrashReporterError. + */ + +/** + * @page async_safety Async-Safe Programming Guide + * + * Plausible CrashReporter provides support for executing an application specified function in the context of the + * crash reporter's signal handler, after the crash report has been written to disk. This was a regularly requested + * feature, and provides the ability to implement application finalization in the event of a crash. However, writing + * code intended for execution inside of a signal handler is exceptionally difficult, and is not recommended. + * + * @section program_flow Program Flow and Signal Handlers + * + * When the signal handler is called the normal flow of the program is interrupted, and your program is an unknown + * state. Locks may be held, the heap may be corrupt (or in the process of being updated), and your signal + * handler may invoke a function that was being executed at the time of the signal. This may result in deadlocks, + * data corruption, and program termination. + * + * @section functions Async-Safe Functions + * + * A subset of functions are defined to be async-safe by the OS, and are safely callable from within a signal handler. If + * you do implement a custom post-crash handler, it must be async-safe. A table of POSIX-defined async-safe functions + * and additional information is available from the + * CERT programming guide - SIG30-C + * + * Most notably, the Objective-C runtime itself is not async-safe, and Objective-C may not be used within a signal + * handler. + * + * @sa PLCrashReporter::setCrashCallbacks: + */ + +/** + * @page mach_exceptions Mach Exceptions on Mac OS X and iOS + * + * PLCrashReporter includes support for monitoring crashes via an in-process Mach exception handler. There are a small + * number of crash cases that will not be caught with via a POSIX signal handler, but can be caught via a Mach + * exception handler: + * + * - Stack overflow. sigaltstack() is broken in later iOS releases, and even if functional, must be configured + * on a per-thread basis. + * - Internal Apple assertions that call libSystem's __assert. These include compiler-checked constraints + * for built-in functions, such as strcpy_chk(). The __abort() implementation actually disables the SIGABRT + * signal handler (resetting it to SIG_DFL) prior to to issueing a SIGABRT, bypassing signal-based crash + * reporters entirely. + * + * Unfortunately, the latter issue (__assert) can not be handled on iOS; trapping abort requires that + * a Mach exception handler operate out-of-process, which is impossible on iOS. On Mac OS X, this will + * only be handled once we've implemented fully out-of-process crash excution. + * + * On Mac OS X, the Mach exception implementation is fully supported using entirely public API. On iOS, + * the APIs required are not fully public -- more details on the implications of this for exception handling on + * iOS may be found in @ref mach_exceptions_ios below. It is worth noting that even where the Mach exception APIs + * are fully supported, kernel-internal constants, as well + * as architecture-specific trap information, may be required to fully interpret a Mach exception's root cause. + * + * For example, the EXC_SOFTWARE exception is dispatched for four different failure types, using the exception + * code to differentiate failure types: + * - Non-existent system call invoked (SIGSYS) + * - Write on a pipe with no reader (SIGPIPE) + * - Abort program (SIGABRT -- unused) + * - Kill program (SIGKILL) + * + * Of those four types, only the constant required to interpret the SIGKILL behavior (EXC_SOFT_SIGNAL) is publicly defined. + * Of the remaining three failure types, the constant values are kernel implementation-private, defined only in the available + * kernel sources. On iOS, these sources are unavailable, and while they generally do match the Mac OS X implementation, there + * are no gaurantees that this is -- or will remain -- the case in the future. + * + * Likewise, interpretation of particular fault types requires information regarding the underlying machine traps + * that triggered the Mach exceptions. For example, a floating point trap on x86/x86-64 will trigger an EXC_ARITHMETIC, + * with a subcode value containing the value of the FPU status register. Determining the exact FPU cause requires + * extracting the actual exception flags from status register as per the x86 architecture documentation. The exact format + * of this subcode value is not actually documented outside the kernel, and may change in future releases. + * + * While we have the advantage of access to the x86 kernel sources, the situation on ARM is even less clear. The actual + * use of the Mach exception codes and subcodes is largely undefined by both headers and publicly available documentation, + * and the available x86 kernel sources are of little use in interpreting this data. + * + * As such, while Mach exceptions may catch some cases that BSD signals can not, they are not a perfect solution, + * and may also provide less insight into the actual failures that occur. By comparison, the BSD signal interface + * is both fully defined and architecture independent, with any necessary interpretation of the Mach exception + * codes handled in-kernel at the time of exception dispatch. It is generally recommended by Apple as the preferred + * interface, and should generally be preferred by PLCrashReporter API clients. + * + * @section mach_exceptions_compatibility Compatibility Issues + * + * @subsection Debuggers + * + * Enabling in-process Mach exception handlers will conflict with any attached debuggers; the debugger + * may suspend the processes Mach exception handling thread, which will result in any exception messages + * sent via the debugger being lost, as the in-process handler will be unable to receive and forward + * the messages. + * + * @subsection Managed Runtimes (Xamarin, Unity) + * + * A Mach exception handler may conflict with any managed runtime that registers a BSD signal handler that + * can safely handle otherwise fatal signals, allowing execution to proceed. This includes products + * such as Xamarin for iOS. + * + * In such a case, PLCrashReporter will write a crash report for non-fatal signals, as there is no + * immediate mechanism for determining whether a signal handler exists and that it can safely + * handle the failure. This can result in unexpected delays in application execution, increased I/O to + * disk, and other undesirable operations. + * + * @section mach_exceptions_ios Mach Exceptions on iOS + * + * The APIs required for Mach exception handling are not fully public on iOS. After filing a request with + * Apple DTS to clarify the status of the Mach exception APIs on iOS, and implementing a Mach Exception + * handler using only supported API, they provided the following guidance: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited undefined API on iOS. The reporter + * may be excluded entirely at build time by modifying the PLCRASH_FEATURE_MACH_EXCEPTIONS build configuration; it + * may also be disabled at runtime by configuring the PLCrashReporter instance appropriately via PLCrashReporterConfig. + * + * The iOS implementation is implemented almost entirely using public API, and links against no actual private symbols; + * the use of undocumented functionality is limited to assuming the use of specific msgh_id values (see below + * for details). As a result, it may be considered perfectly safe to include the Mach Exception code in the + * standard build, and enable/disable it at runtime. + * + * The following issues exist in the iOS implementation: + * - The msgh_id values required for an exception reply message are not available from the available + * headers and must be hard-coded. This prevents one from safely replying to exception messages, which + * means that it is impossible to (correctly) inform the server that an exception has *not* been + * handled. + * + * Impact: + * This can lead to the process locking up and not dispatching to the host exception handler (eg, Apple's + * crash reporter), depending on the behavior of the kernel exception code. + * + * - The mach_* structure/type variants required by MACH_EXCEPTION_CODES are not publicly defined (on Mac OS X, + * these are provided by mach_exc.defs). This prevents one from forwarding exception messages to an existing + * handler that was registered with a MACH_EXCEPTION_CODES behavior (eg, forwarding is entirely non-functional + * on ARM64 devices). + * + * Impact: + * This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES, + * including other handlers registered within the current process, eg, by a managed runtime. This could + * also result in misinterpretation of a Mach exception message, in the case where the message format is + * modified by Apple to be incompatible with the existing 32-bit format. + * + * This is the case with LLDB; it will register a task exception handler with MACH_EXCEPTION_CODES set. Failure + * to correctly forward these exceptions will result in the debugger breaking in interesting ways; for example, + * changes to the set of dyld-loaded images are detected by setting a breakpoint on the dyld image registration + * funtions, and this functionality will break if the exception is not correctly forwarded. + * + * Since Mach exception handling is important for a fully functional crash reporter, we have also filed a radar + * to request that the API be made public: + * Radar: rdar://12939497 RFE: Provide mach_exc.defs for iOS + * + * At the time of this writing, the radar remains open/unresolved. + */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashFeatureConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashFeatureConfig.h new file mode 100644 index 0000000..7bcaebf --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashFeatureConfig.h @@ -0,0 +1,108 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_FEATURE_CONFIG_H +#define PLCRASH_FEATURE_CONFIG_H + +#include + +/** + * @internal + * + * Build-time configuration for PLCrashReporter. + * + * This is used to automatically enable/disable features on a per-platform and per-configuration + * basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter. + * + * @defgroup build_config Build Configuration + * @ingroup constants + * @{ + */ + +/* + * Defaults + */ + +/* + * For release builds, disable unused unwind implementations on targets that do not use them. For non-release + * builds, we include the unwind implementations to allow testing on a broader range of targets. + */ +#ifdef PLCF_RELEASE_BUILD +# if defined(__arm__) +# ifndef PLCRASH_FEATURE_UNWIND_DWARF +# define PLCRASH_FEATURE_UNWIND_DWARF 0 +# endif +# ifndef PLCRASH_FEATURE_UNWIND_COMPACT +# define PLCRASH_FEATURE_UNWIND_COMPACT 0 +# endif +# endif +#endif + +/* + * Configuration Flags + */ + + +#ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS +/** + * If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported, + * using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a + * popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either + * they've received special dispensation to use private APIs / private structures, they've found another way to do + * it, or they're just using undocumented functionality and hoping for the best. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled + * Mach exception handling by default, and provided both build-time and runtime configuration + * to disable its use. + * + * For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions. + */ +#if TARGET_OS_TV +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 0 +#else +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 1 +#endif +#endif + +#ifndef PLCRASH_FEATURE_UNWIND_DWARF +/** If true, enable DWARF unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_DWARF 1 +#endif + + +#ifndef PLCRASH_FEATURE_UNWIND_COMPACT +/** If true, enable compact unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_COMPACT 1 +#endif + +/* + * @} + */ + +#endif /* PLCRASH_FEATURE_CONFIG_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashMacros.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashMacros.h new file mode 100644 index 0000000..556e1c2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashMacros.h @@ -0,0 +1,143 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_CONSTANTS_H +#define PLCRASH_CONSTANTS_H + +#include +#include + +#if defined(__cplusplus) +# define PLCR_EXPORT extern "C" +# define PLCR_C_BEGIN_DECLS extern "C" { +# define PLCR_C_END_DECLS } +#else +# define PLCR_EXPORT extern +# define PLCR_C_BEGIN_DECLS +# define PLCR_C_END_DECLS +#endif + +#if defined(__cplusplus) +# define NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ +# define IS_EMPTY_(name) defined(NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ ## name) +# define IS_EMPTY(name) IS_EMPTY_(name) +# if defined(PLCRASHREPORTER_PREFIX) && !IS_EMPTY(PLCRASHREPORTER_PREFIX) + /** @internal Define the plcrash namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ +# define PLCR_CPP_BEGIN_NS namespace plcrash { inline namespace PLCRASHREPORTER_PREFIX { + + /** @internal Close the definition of the `plcrash` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ +# define PLCR_CPP_END_NS }} +# else +# define PLCR_CPP_BEGIN_NS namespace plcrash { +# define PLCR_CPP_END_NS } +# endif +#endif + +#ifdef __clang__ +# define PLCR_PRAGMA_CLANG(_p) _Pragma(_p) +#else +# define PLCR_PRAGMA_CLANG(_p) +#endif + +#ifdef __clang__ +# define PLCR_DEPRECATED __attribute__((deprecated)) +#else +# define PLCR_DEPRECATED +#endif + +#if defined(__clang__) || defined(__GNUC__) +# define PLCR_UNUSED __attribute__((unused)) +#else +# define PLCR_UNUSED +#endif + +#ifdef PLCR_PRIVATE +/** + * Marks a definition as deprecated only for for external clients, allowing + * uses of it internal fo the framework. + */ +# define PLCR_EXTERNAL_DEPRECATED + +/** + * @internal + * A macro to put above a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() \ + PLCR_PRAGMA_CLANG("clang diagnostic push"); \ + PLCR_PRAGMA_CLANG("clang diagnostic ignored \"-Wdocumentation-deprecated-sync\"") + +/** + * @internal + * A macro to put below a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_POP() PLCR_PRAGMA_CLANG("clang diagnostic pop") + +#else + +# define PLCR_EXTERNAL_DEPRECATED PLCR_DEPRECATED +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() + +#endif /* PLCR_PRIVATE */ + +#ifdef PLCR_PRIVATE +# if defined(__clang__) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") +# define PLCR_FALLTHROUGH [[clang::fallthrough]] +# else +# define PLCR_FALLTHROUGH do {} while (0) +# endif +#endif + +#ifdef PLCR_PRIVATE +/** + * @internal + * Static compile-time assertion. + * + * @param name The assertion name; must be valid for use within a C identifier. + * @param cond Assertion condition + */ +# define PLCR_ASSERT_STATIC(name, cond) PLCR_ASSERT_STATIC_(name, cond, __LINE__) +/* + * C++11 and C11 both provide a static_assert(). + * + * Otherwise, we have to use typedef-based static assertions. + */ +# if (defined(__cplusplus) && __cplusplus >= 201103L) || (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(#name, cond) +# define PLCR_ASSERT_STATIC__(name, cond) static_assert(cond, #name) +# else +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(name, cond, line) +# define PLCR_ASSERT_STATIC__(name, cond, line) typedef int plcf_static_assert_##name##_##line [(cond) ? 1 : -1] PLCR_UNUSED +# endif +#endif /* PLCR_PRIVATE */ + +#endif /* PLCRASH_CONSTANTS_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashNamespace.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashNamespace.h new file mode 100644 index 0000000..f4c263c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashNamespace.h @@ -0,0 +1,320 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +// #define PLCRASHREPORTER_PREFIX AcmeCo + + +// We need two extra layers of indirection to make CPP substitute +// the PLCRASHREPORTER_PREFIX define. +#define PLNS_impl2(prefix, symbol) prefix ## symbol +#define PLNS_impl(prefix, symbol) PLNS_impl2(prefix, symbol) +#define PLNS(symbol) PLNS_impl(PLCRASHREPORTER_PREFIX, symbol) + + +/* + * Rewrite all ObjC/C symbols. + * + * For C++ symbol handling, refer to the PLCR_CPP_BEGIN_NS and PLCR_CPP_END_NS + * macros. + */ +#ifdef PLCRASHREPORTER_PREFIX + +/* Objective-C Classes */ +#define PLCrashMachExceptionServer PLNS(PLCrashMachExceptionServer) +#define PLCrashReport PLNS(PLCrashReport) +#define PLCrashReportApplicationInfo PLNS(PLCrashReportApplicationInfo) +#define PLCrashReportBinaryImageInfo PLNS(PLCrashReportBinaryImageInfo) +#define PLCrashReportExceptionInfo PLNS(PLCrashReportExceptionInfo) +#define PLCrashReportMachExceptionInfo PLNS(PLCrashReportMachExceptionInfo) +#define PLCrashReportMachineInfo PLNS(PLCrashReportMachineInfo) +#define PLCrashReportProcessInfo PLNS(PLCrashReportProcessInfo) +#define PLCrashReportProcessorInfo PLNS(PLCrashReportProcessorInfo) +#define PLCrashReportRegisterInfo PLNS(PLCrashReportRegisterInfo) +#define PLCrashReportSignalInfo PLNS(PLCrashReportSignalInfo) +#define PLCrashReportStackFrameInfo PLNS(PLCrashReportStackFrameInfo) +#define PLCrashReportSymbolInfo PLNS(PLCrashReportSymbolInfo) +#define PLCrashReportSystemInfo PLNS(PLCrashReportSystemInfo) +#define PLCrashReportTextFormatter PLNS(PLCrashReportTextFormatter) +#define PLCrashReportThreadInfo PLNS(PLCrashReportThreadInfo) +#define PLCrashReporter PLNS(PLCrashReporter) +#define PLCrashSignalHandler PLNS(PLCrashSignalHandler) +#define PLCrashHostInfo PLNS(PLCrashHostInfo) +#define PLCrashMachExceptionPort PLNS(PLCrashMachExceptionPort) +#define PLCrashMachExceptionPortSet PLNS(PLCrashMachExceptionPortSet) +#define PLCrashProcessInfo PLNS(PLCrashProcessInfo) +#define PLCrashReporterConfig PLNS(PLCrashReporterConfig) +#define PLCrashUncaughtExceptionHandler PLNS(PLCrashUncaughtExceptionHandler) +#define PLCrashReportFormatter PLNS(PLCrashReportFormatter) + +/* Public C functions */ +#define PLCrashMachExceptionForward PLNS(PLCrashMachExceptionForward) +#define PLCrashSignalHandlerForward PLNS(PLCrashSignalHandlerForward) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) + + +/* Public C global symbols */ +#define PLCrashReporterErrorDomain PLNS(PLCrashReporterErrorDomain) +#define PLCrashReportHostArchitecture PLNS(PLCrashReportHostArchitecture) +#define PLCrashReportHostOperatingSystem PLNS(PLCrashReportHostOperatingSystem) +#define PLCrashReporterException PLNS(PLCrashReporterException) + +/* For backwards compatibility, plcrash_async_byteorder vends C++ methods when included under C++. We have + * to handle this distinctly from our PLCR_CPP_BEGIN_NS C++ namespacing mechanism. */ +#define plcrash_async_byteorder PLNS(plcrash_async_byteorder) + +/* + * All private C symbols. Once these are migrated to C++, we'll be able to use the much simpler + * PLCR_CPP_BEGIN_NS machinery. + * + * This list was automatically generated (and can be updated) by setting PLCRASHREPORTER_PREFIX to 'AcmeCo', + * building the library, and executing the following: + * nm -g -U | grep '^[0-9]' | c++filt | grep -v AcmeCo | grep -E '_pl|_PL' | awk '{print $3}' | cut -c 2- | sort | uniq | awk '{print "#define",$1,"PLNS("$1")"}' + */ +#define pl_mach_thread_self PLNS(pl_mach_thread_self) +#define plcrash__architecture__descriptor PLNS(plcrash__architecture__descriptor) +#define plcrash__crash_report__application_info__descriptor PLNS(plcrash__crash_report__application_info__descriptor) +#define plcrash__crash_report__application_info__init PLNS(plcrash__crash_report__application_info__init) +#define plcrash__crash_report__binary_image__descriptor PLNS(plcrash__crash_report__binary_image__descriptor) +#define plcrash__crash_report__binary_image__init PLNS(plcrash__crash_report__binary_image__init) +#define plcrash__crash_report__descriptor PLNS(plcrash__crash_report__descriptor) +#define plcrash__crash_report__exception__descriptor PLNS(plcrash__crash_report__exception__descriptor) +#define plcrash__crash_report__exception__init PLNS(plcrash__crash_report__exception__init) +#define plcrash__crash_report__free_unpacked PLNS(plcrash__crash_report__free_unpacked) +#define plcrash__crash_report__get_packed_size PLNS(plcrash__crash_report__get_packed_size) +#define plcrash__crash_report__init PLNS(plcrash__crash_report__init) +#define plcrash__crash_report__machine_info__descriptor PLNS(plcrash__crash_report__machine_info__descriptor) +#define plcrash__crash_report__machine_info__init PLNS(plcrash__crash_report__machine_info__init) +#define plcrash__crash_report__pack PLNS(plcrash__crash_report__pack) +#define plcrash__crash_report__pack_to_buffer PLNS(plcrash__crash_report__pack_to_buffer) +#define plcrash__crash_report__process_info__descriptor PLNS(plcrash__crash_report__process_info__descriptor) +#define plcrash__crash_report__process_info__init PLNS(plcrash__crash_report__process_info__init) +#define plcrash__crash_report__processor__descriptor PLNS(plcrash__crash_report__processor__descriptor) +#define plcrash__crash_report__processor__init PLNS(plcrash__crash_report__processor__init) +#define plcrash__crash_report__processor__type_encoding__descriptor PLNS(plcrash__crash_report__processor__type_encoding__descriptor) +#define plcrash__crash_report__report_info__descriptor PLNS(plcrash__crash_report__report_info__descriptor) +#define plcrash__crash_report__report_info__init PLNS(plcrash__crash_report__report_info__init) +#define plcrash__crash_report__signal__descriptor PLNS(plcrash__crash_report__signal__descriptor) +#define plcrash__crash_report__signal__init PLNS(plcrash__crash_report__signal__init) +#define plcrash__crash_report__signal__mach_exception__descriptor PLNS(plcrash__crash_report__signal__mach_exception__descriptor) +#define plcrash__crash_report__signal__mach_exception__init PLNS(plcrash__crash_report__signal__mach_exception__init) +#define plcrash__crash_report__symbol__descriptor PLNS(plcrash__crash_report__symbol__descriptor) +#define plcrash__crash_report__symbol__init PLNS(plcrash__crash_report__symbol__init) +#define plcrash__crash_report__system_info__descriptor PLNS(plcrash__crash_report__system_info__descriptor) +#define plcrash__crash_report__system_info__init PLNS(plcrash__crash_report__system_info__init) +#define plcrash__crash_report__system_info__operating_system__descriptor PLNS(plcrash__crash_report__system_info__operating_system__descriptor) +#define plcrash__crash_report__thread__descriptor PLNS(plcrash__crash_report__thread__descriptor) +#define plcrash__crash_report__thread__init PLNS(plcrash__crash_report__thread__init) +#define plcrash__crash_report__thread__register_value__descriptor PLNS(plcrash__crash_report__thread__register_value__descriptor) +#define plcrash__crash_report__thread__register_value__init PLNS(plcrash__crash_report__thread__register_value__init) +#define plcrash__crash_report__thread__stack_frame__descriptor PLNS(plcrash__crash_report__thread__stack_frame__descriptor) +#define plcrash__crash_report__thread__stack_frame__init PLNS(plcrash__crash_report__thread__stack_frame__init) +#define plcrash__crash_report__unpack PLNS(plcrash__crash_report__unpack) +#define plcrash_async_address_apply_offset PLNS(plcrash_async_address_apply_offset) +#define plcrash_async_byteorder_big_endian PLNS(plcrash_async_byteorder_big_endian) +#define plcrash_async_byteorder_direct PLNS(plcrash_async_byteorder_direct) +#define plcrash_async_byteorder_little_endian PLNS(plcrash_async_byteorder_little_endian) +#define plcrash_async_byteorder_swapped PLNS(plcrash_async_byteorder_swapped) +#define plcrash_async_cfe_entry_apply PLNS(plcrash_async_cfe_entry_apply) +#define plcrash_async_cfe_entry_free PLNS(plcrash_async_cfe_entry_free) +#define plcrash_async_cfe_entry_init PLNS(plcrash_async_cfe_entry_init) +#define plcrash_async_cfe_entry_register_count PLNS(plcrash_async_cfe_entry_register_count) +#define plcrash_async_cfe_entry_register_list PLNS(plcrash_async_cfe_entry_register_list) +#define plcrash_async_cfe_entry_return_address_register PLNS(plcrash_async_cfe_entry_return_address_register) +#define plcrash_async_cfe_entry_stack_adjustment PLNS(plcrash_async_cfe_entry_stack_adjustment) +#define plcrash_async_cfe_entry_stack_offset PLNS(plcrash_async_cfe_entry_stack_offset) +#define plcrash_async_cfe_entry_type PLNS(plcrash_async_cfe_entry_type) +#define plcrash_async_cfe_reader_find_pc PLNS(plcrash_async_cfe_reader_find_pc) +#define plcrash_async_cfe_reader_free PLNS(plcrash_async_cfe_reader_free) +#define plcrash_async_cfe_reader_init PLNS(plcrash_async_cfe_reader_init) +#define plcrash_async_cfe_register_decode PLNS(plcrash_async_cfe_register_decode) +#define plcrash_async_cfe_register_encode PLNS(plcrash_async_cfe_register_encode) +#define plcrash_async_file_close PLNS(plcrash_async_file_close) +#define plcrash_async_file_flush PLNS(plcrash_async_file_flush) +#define plcrash_async_file_init PLNS(plcrash_async_file_init) +#define plcrash_async_file_write PLNS(plcrash_async_file_write) +#define plcrash_async_find_symbol PLNS(plcrash_async_find_symbol) +#define plcrash_async_image_containing_address PLNS(plcrash_async_image_containing_address) +#define plcrash_async_image_list_next PLNS(plcrash_async_image_list_next) +#define plcrash_async_image_list_set_reading PLNS(plcrash_async_image_list_set_reading) +#define plcrash_async_mach_exception_get_siginfo PLNS(plcrash_async_mach_exception_get_siginfo) +#define plcrash_async_macho_byteorder PLNS(plcrash_async_macho_byteorder) +#define plcrash_async_macho_contains_address PLNS(plcrash_async_macho_contains_address) +#define plcrash_async_macho_cpu_subtype PLNS(plcrash_async_macho_cpu_subtype) +#define plcrash_async_macho_cpu_type PLNS(plcrash_async_macho_cpu_type) +#define plcrash_async_macho_find_command PLNS(plcrash_async_macho_find_command) +#define plcrash_async_macho_find_segment_cmd PLNS(plcrash_async_macho_find_segment_cmd) +#define plcrash_async_macho_find_symbol_by_name PLNS(plcrash_async_macho_find_symbol_by_name) +#define plcrash_async_macho_find_symbol_by_pc PLNS(plcrash_async_macho_find_symbol_by_pc) +#define plcrash_async_macho_header PLNS(plcrash_async_macho_header) +#define plcrash_async_macho_header_size PLNS(plcrash_async_macho_header_size) +#define plcrash_async_macho_map_section PLNS(plcrash_async_macho_map_section) +#define plcrash_async_macho_map_segment PLNS(plcrash_async_macho_map_segment) +#define plcrash_async_macho_mapped_segment_free PLNS(plcrash_async_macho_mapped_segment_free) +#define plcrash_async_macho_next_command PLNS(plcrash_async_macho_next_command) +#define plcrash_async_macho_next_command_type PLNS(plcrash_async_macho_next_command_type) +#define plcrash_async_macho_string_free PLNS(plcrash_async_macho_string_free) +#define plcrash_async_macho_string_get_length PLNS(plcrash_async_macho_string_get_length) +#define plcrash_async_macho_string_get_pointer PLNS(plcrash_async_macho_string_get_pointer) +#define plcrash_async_macho_string_init PLNS(plcrash_async_macho_string_init) +#define plcrash_async_macho_symtab_reader_free PLNS(plcrash_async_macho_symtab_reader_free) +#define plcrash_async_macho_symtab_reader_init PLNS(plcrash_async_macho_symtab_reader_init) +#define plcrash_async_macho_symtab_reader_read PLNS(plcrash_async_macho_symtab_reader_read) +#define plcrash_async_macho_symtab_reader_symbol_name PLNS(plcrash_async_macho_symtab_reader_symbol_name) +#define plcrash_async_memcpy PLNS(plcrash_async_memcpy) +#define plcrash_async_memset PLNS(plcrash_async_memset) +#define plcrash_async_mobject_base_address PLNS(plcrash_async_mobject_base_address) +#define plcrash_async_mobject_free PLNS(plcrash_async_mobject_free) +#define plcrash_async_mobject_init PLNS(plcrash_async_mobject_init) +#define plcrash_async_mobject_length PLNS(plcrash_async_mobject_length) +#define plcrash_async_mobject_read_uint16 PLNS(plcrash_async_mobject_read_uint16) +#define plcrash_async_mobject_read_uint32 PLNS(plcrash_async_mobject_read_uint32) +#define plcrash_async_mobject_read_uint64 PLNS(plcrash_async_mobject_read_uint64) +#define plcrash_async_mobject_read_uint8 PLNS(plcrash_async_mobject_read_uint8) +#define plcrash_async_mobject_remap_address PLNS(plcrash_async_mobject_remap_address) +#define plcrash_async_mobject_task PLNS(plcrash_async_mobject_task) +#define plcrash_async_mobject_verify_local_pointer PLNS(plcrash_async_mobject_verify_local_pointer) +#define plcrash_async_objc_cache_free PLNS(plcrash_async_objc_cache_free) +#define plcrash_async_objc_cache_init PLNS(plcrash_async_objc_cache_init) +#define plcrash_async_objc_find_method PLNS(plcrash_async_objc_find_method) +#define plcrash_async_signal_sigcode PLNS(plcrash_async_signal_sigcode) +#define plcrash_async_signal_signame PLNS(plcrash_async_signal_signame) +#define plcrash_async_strcmp PLNS(plcrash_async_strcmp) +#define plcrash_async_strerror PLNS(plcrash_async_strerror) +#define plcrash_async_strncmp PLNS(plcrash_async_strncmp) +#define plcrash_async_symbol_cache_free PLNS(plcrash_async_symbol_cache_free) +#define plcrash_async_symbol_cache_init PLNS(plcrash_async_symbol_cache_init) +#define plcrash_async_task_memcpy PLNS(plcrash_async_task_memcpy) +#define plcrash_async_task_read_uint16 PLNS(plcrash_async_task_read_uint16) +#define plcrash_async_task_read_uint32 PLNS(plcrash_async_task_read_uint32) +#define plcrash_async_task_read_uint64 PLNS(plcrash_async_task_read_uint64) +#define plcrash_async_task_read_uint8 PLNS(plcrash_async_task_read_uint8) +#define plcrash_async_thread_state_clear_all_regs PLNS(plcrash_async_thread_state_clear_all_regs) +#define plcrash_async_thread_state_clear_reg PLNS(plcrash_async_thread_state_clear_reg) +#define plcrash_async_thread_state_clear_volatile_regs PLNS(plcrash_async_thread_state_clear_volatile_regs) +#define plcrash_async_thread_state_copy PLNS(plcrash_async_thread_state_copy) +#define plcrash_async_thread_state_current PLNS(plcrash_async_thread_state_current) +#define plcrash_async_thread_state_current_stub PLNS(plcrash_async_thread_state_current_stub) +#define plcrash_async_thread_state_get_greg_size PLNS(plcrash_async_thread_state_get_greg_size) +#define plcrash_async_thread_state_get_reg PLNS(plcrash_async_thread_state_get_reg) +#define plcrash_async_thread_state_get_reg_count PLNS(plcrash_async_thread_state_get_reg_count) +#define plcrash_async_thread_state_get_reg_name PLNS(plcrash_async_thread_state_get_reg_name) +#define plcrash_async_thread_state_get_stack_direction PLNS(plcrash_async_thread_state_get_stack_direction) +#define plcrash_async_thread_state_has_reg PLNS(plcrash_async_thread_state_has_reg) +#define plcrash_async_thread_state_init PLNS(plcrash_async_thread_state_init) +#define plcrash_async_thread_state_mach_thread_init PLNS(plcrash_async_thread_state_mach_thread_init) +#define plcrash_async_thread_state_map_dwarf_to_reg PLNS(plcrash_async_thread_state_map_dwarf_to_reg) +#define plcrash_async_thread_state_map_reg_to_dwarf PLNS(plcrash_async_thread_state_map_reg_to_dwarf) +#define plcrash_async_thread_state_mcontext_init PLNS(plcrash_async_thread_state_mcontext_init) +#define plcrash_async_thread_state_set_reg PLNS(plcrash_async_thread_state_set_reg) +#define plcrash_async_writen PLNS(plcrash_async_writen) +#define plcrash_log_writer_close PLNS(plcrash_log_writer_close) +#define plcrash_log_writer_free PLNS(plcrash_log_writer_free) +#define plcrash_log_writer_init PLNS(plcrash_log_writer_init) +#define plcrash_log_writer_set_exception PLNS(plcrash_log_writer_set_exception) +#define plcrash_log_writer_write PLNS(plcrash_log_writer_write) +#define plcrash_log_writer_set_custom_data PLNS(plcrash_log_writer_set_custom_data) +#define plcrash_nasync_image_list_append PLNS(plcrash_nasync_image_list_append) +#define plcrash_nasync_image_list_free PLNS(plcrash_nasync_image_list_free) +#define plcrash_nasync_image_list_init PLNS(plcrash_nasync_image_list_init) +#define plcrash_nasync_image_list_remove PLNS(plcrash_nasync_image_list_remove) +#define plcrash_nasync_macho_free PLNS(plcrash_nasync_macho_free) +#define plcrash_nasync_macho_init PLNS(plcrash_nasync_macho_init) +#define plcrash_populate_error PLNS(plcrash_populate_error) +#define plcrash_populate_mach_error PLNS(plcrash_populate_mach_error) +#define plcrash_populate_posix_error PLNS(plcrash_populate_posix_error) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) +#define plcrash_sysctl_int PLNS(plcrash_sysctl_int) +#define plcrash_sysctl_string PLNS(plcrash_sysctl_string) +#define plcrash_sysctl_valid_utf8_bytes PLNS(plcrash_sysctl_valid_utf8_bytes) +#define plcrash_sysctl_valid_utf8_bytes_max PLNS(plcrash_sysctl_valid_utf8_bytes_max) +#define plcrash_writer_pack PLNS(plcrash_writer_pack) +#define plframe_cursor_free PLNS(plframe_cursor_free) +#define plframe_cursor_get_reg PLNS(plframe_cursor_get_reg) +#define plframe_cursor_get_regcount PLNS(plframe_cursor_get_regcount) +#define plframe_cursor_get_regname PLNS(plframe_cursor_get_regname) +#define plframe_cursor_init PLNS(plframe_cursor_init) +#define plframe_cursor_next PLNS(plframe_cursor_next) +#define plframe_cursor_next_with_readers PLNS(plframe_cursor_next_with_readers) +#define plframe_cursor_read_compact_unwind PLNS(plframe_cursor_read_compact_unwind) +#define plframe_cursor_read_dwarf_unwind PLNS(plframe_cursor_read_dwarf_unwind) +#define plframe_cursor_read_frame_ptr PLNS(plframe_cursor_read_frame_ptr) +#define plframe_cursor_thread_init PLNS(plframe_cursor_thread_init) +#define plframe_strerror PLNS(plframe_strerror) + +#endif + +/* + * The following symbols are exported by the protobuf-c library. When building + * a shared library, we can hide these as private symbols. + * + * However, when building a static library, we can only do so if we use + * MH_OBJECT "single object prelink". The MH_OBJECT approach allows us to apply + * symbol hiding/aliasing/etc similar to that supported by dylibs, but because it is + * seemingly unused within Apple, the use thereof regularly introduces linking bugs + * and errors in new Xcode releases. + * + * Rather than fighting the linker, we use the namespacing machinery to rewrite these + * symbols, but only when explicitly compiling PLCrashReporter. Since protobuf-c is a library + * that may be used elsewhere, we don't want to rewrite these symbols if they're used + * independently by PLCrashReporter API clients. + */ +#ifdef PLCR_PRIVATE + /* If no prefix has been defined, we need to specify our own private prefix */ +# ifndef PLCRASHREPORTER_PREFIX +# define PLCRASHREPORTER_PREFIX PL_ +# endif + +# define protobuf_c_buffer_simple_append PLNS(protobuf_c_buffer_simple_append) +# define protobuf_c_empty_string PLNS(protobuf_c_empty_string) +# define protobuf_c_enum_descriptor_get_value PLNS(protobuf_c_enum_descriptor_get_value) +# define protobuf_c_enum_descriptor_get_value_by_name PLNS(protobuf_c_enum_descriptor_get_value_by_name) +# define protobuf_c_message_check PLNS(protobuf_c_message_check) +# define protobuf_c_message_descriptor_get_field PLNS(protobuf_c_message_descriptor_get_field) +# define protobuf_c_message_descriptor_get_field_by_name PLNS(protobuf_c_message_descriptor_get_field_by_name) +# define protobuf_c_message_free_unpacked PLNS(protobuf_c_message_free_unpacked) +# define protobuf_c_message_get_packed_size PLNS(protobuf_c_message_get_packed_size) +# define protobuf_c_message_init PLNS(protobuf_c_message_init) +# define protobuf_c_message_pack PLNS(protobuf_c_message_pack) +# define protobuf_c_message_pack_to_buffer PLNS(protobuf_c_message_pack_to_buffer) +# define protobuf_c_message_unpack PLNS(protobuf_c_message_unpack) +# define protobuf_c_service_descriptor_get_method_by_name PLNS(protobuf_c_service_descriptor_get_method_by_name) +# define protobuf_c_service_destroy PLNS(protobuf_c_service_destroy) +# define protobuf_c_service_generated_init PLNS(protobuf_c_service_generated_init) +# define protobuf_c_service_invoke_internal PLNS(protobuf_c_service_invoke_internal) +# define protobuf_c_version PLNS(protobuf_c_version) +# define protobuf_c_version_number PLNS(protobuf_c_version_number) +#endif /* PLCR_PRIVATE */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReport.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReport.h new file mode 100644 index 0000000..f710c3f --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReport.h @@ -0,0 +1,230 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_H +#define PLCRASH_REPORT_H + +#if __has_include() +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#else +#import "PLCrashReportApplicationInfo.h" +#import "PLCrashReportBinaryImageInfo.h" +#import "PLCrashReportExceptionInfo.h" +#import "PLCrashReportMachineInfo.h" +#import "PLCrashReportMachExceptionInfo.h" +#import "PLCrashReportProcessInfo.h" +#import "PLCrashReportProcessorInfo.h" +#import "PLCrashReportRegisterInfo.h" +#import "PLCrashReportSignalInfo.h" +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportSymbolInfo.h" +#import "PLCrashReportSystemInfo.h" +#import "PLCrashReportThreadInfo.h" +#endif + +/** + * @ingroup constants + * Crash file magic identifier */ +#define PLCRASH_REPORT_FILE_MAGIC "plcrash" + +/** + * @ingroup constants + * Crash format version byte identifier. Will not change outside of the introduction of + * an entirely new crash log format. */ +#define PLCRASH_REPORT_FILE_VERSION 1 + +/** + * @ingroup types + * Crash log file header format. + * + * Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC), + * followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION). + * The crash log message format itself is extensible, so this version number will only + * be incremented in the event of an incompatible encoding or format change. + */ +struct PLCrashReportFileHeader { + /** Crash log magic identifier, not NULL terminated */ + const char magic[7]; + + /** Crash log encoding/format version */ + const uint8_t version; + + /** File data */ + const uint8_t data[]; +} __attribute__((packed)); + + +/** + * @internal + * Private decoder instance variables (used to hide the underlying protobuf parser). + */ +typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; + +@interface PLCrashReport : NSObject { +@private + /** Private implementation variables (used to hide the underlying protobuf parser) */ + _PLCrashReportDecoder *_decoder; + + /** System info */ + __strong PLCrashReportSystemInfo *_systemInfo; + + /** Machine info */ + __strong PLCrashReportMachineInfo *_machineInfo; + + /** Application info */ + __strong PLCrashReportApplicationInfo *_applicationInfo; + + /** Process info */ + __strong PLCrashReportProcessInfo *_processInfo; + + /** Signal info */ + __strong PLCrashReportSignalInfo *_signalInfo; + + /** Mach exception info */ + __strong PLCrashReportMachExceptionInfo *_machExceptionInfo; + + /** Thread info (PLCrashReportThreadInfo instances) */ + __strong NSArray *_threads; + + /** Binary images (PLCrashReportBinaryImageInfo instances */ + __strong NSArray *_images; + + /** Exception information (may be nil) */ + __strong PLCrashReportExceptionInfo *_exceptionInfo; + + /** User defined information (may be nil) */ + __strong NSData *_customData; + + /** Report UUID */ + CFUUIDRef _uuid; +} + +- (id) initWithData: (NSData *) encodedData error: (NSError **) outError; + +- (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address; + +/** + * System information. + */ +@property(nonatomic, readonly, strong) PLCrashReportSystemInfo *systemInfo; + +/** + * YES if machine information is available. + */ +@property(nonatomic, readonly) BOOL hasMachineInfo; + +/** + * Machine information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachineInfo *machineInfo; + +/** + * Application information. + */ +@property(nonatomic, readonly, strong) PLCrashReportApplicationInfo *applicationInfo; + +/** + * YES if process information is available. + */ +@property(nonatomic, readonly) BOOL hasProcessInfo; + +/** + * Process information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessInfo *processInfo; + +/** + * Signal information. This provides the signal and signal code of the fatal signal. + */ +@property(nonatomic, readonly, strong) PLCrashReportSignalInfo *signalInfo; + +/** + * Mach exception information, if available. This will only be included in the + * case that encoding crash reporter's exception-based reporting was enabled, and a Mach + * exception was caught. + * + * @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this + * s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the + * Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal + * mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachExceptionInfo *machExceptionInfo; + +/** + * Thread information. Returns a list of PLCrashReportThreadInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *threads; + +/** + * Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *images; + +/** + * YES if exception information is available. + */ +@property(nonatomic, readonly) BOOL hasExceptionInfo; + +/** + * Exception information. Only available if a crash was caused by an uncaught exception, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportExceptionInfo *exceptionInfo; + +/** + * Custom user data. Only available if user explicitly assigned it before crash happened, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) NSData *customData; + +/** + * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated + * by a single client. Only available in later (v1.2+) crash report format versions. If not available, + * will be NULL. + */ +@property(nonatomic, readonly) CFUUIDRef uuidRef; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportApplicationInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportApplicationInfo.h new file mode 100644 index 0000000..787a286 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportApplicationInfo.h @@ -0,0 +1,62 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportApplicationInfo : NSObject { +@private + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; +} + +- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier + applicationVersion: (NSString *) applicationVersion + applicationMarketingVersion: (NSString *) applicationMarketingVersion; + +/** + * The application identifier. This is usually the application's CFBundleIdentifier value. + */ +@property(nonatomic, readonly, strong) NSString *applicationIdentifier; + +/** + * The application version. This is usually the application's CFBundleVersion value. + */ +@property(nonatomic, readonly, strong) NSString *applicationVersion; + +/** + * The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil. + */ +@property(nonatomic, readonly, strong) NSString *applicationMarketingVersion; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportBinaryImageInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportBinaryImageInfo.h new file mode 100644 index 0000000..1a75051 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportBinaryImageInfo.h @@ -0,0 +1,95 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportBinaryImageInfo : NSObject { +@private + /** Code type */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /** Base image address */ + uint64_t _baseAddress; + + /** Image segment size */ + uint64_t _imageSize; + + /** Name of binary image */ + __strong NSString *_imageName; + + /** If the UUID is available */ + BOOL _hasImageUUID; + + /** 128-bit object UUID. May be nil. */ + __strong NSString *_imageUUID; +} + +- (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo + baseAddress: (uint64_t) baseAddress + size: (uint64_t) imageSize + name: (NSString *) imageName + uuid: (NSData *) uuid; + +/** + * Image code type, or nil if unavailable. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *codeType; + +/** + * Image base address. + */ +@property(nonatomic, readonly) uint64_t imageBaseAddress; + +/** + * Segment size. + */ +@property(nonatomic, readonly) uint64_t imageSize; + +/** + * Image name (absolute path) + */ +@property(nonatomic, readonly, strong) NSString *imageName; + + +/** + * YES if this image has an associated UUID. + */ +@property(nonatomic, readonly) BOOL hasImageUUID; + +/** + * 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable. + */ +@property(nonatomic, readonly, strong) NSString *imageUUID; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportExceptionInfo.h new file mode 100644 index 0000000..7423ca9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportExceptionInfo.h @@ -0,0 +1,69 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportThreadInfo.h" +#endif + +@interface PLCrashReportExceptionInfo : NSObject { +@private + /** Name */ + __strong NSString *_name; + + /** Reason */ + __strong NSString *_reason; + + /** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */ + __strong NSArray *_stackFrames; +} + +- (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason; + +- (id) initWithExceptionName: (NSString *) name + reason: (NSString *) reason + stackFrames: (NSArray *) stackFrames; + +/** + * The exception name. + */ +@property(nonatomic, readonly, strong) NSString *exceptionName; + +/** + * The exception reason. + */ +@property(nonatomic, readonly, strong) NSString *exceptionReason; + +/* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable. + * This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportFormatter.h new file mode 100644 index 0000000..5cdf01b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportFormatter.h @@ -0,0 +1,55 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReport.h" +#endif + +/** + * A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules, + * (such as implementing text output support), and returns the result. + */ +@protocol PLCrashReportFormatter + +/** + * Format the provided @a report. + * + * @param report Report to be formatted. + * @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error + * object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will + * be left unmodified. You may specify nil for this parameter, and no error information will be provided. + * + * @return Returns the formatted report data on success, or nil on failure. + */ +- (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachExceptionInfo.h new file mode 100644 index 0000000..19461a5 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachExceptionInfo.h @@ -0,0 +1,48 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportMachExceptionInfo : NSObject { +@private + /** The Mach exception type. */ + uint64_t _type; + + /** The Mach exception codes, represented as an ordered array of NSNumber instances. */ + __strong NSArray *_codes; +} + +- (id) initWithType: (uint64_t) type codes: (NSArray *) codes; + +/** The Mach exception type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */ +@property(nonatomic, readonly, strong) NSArray *codes; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachineInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachineInfo.h new file mode 100644 index 0000000..ab6fee9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportMachineInfo.h @@ -0,0 +1,77 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportMachineInfo : NSObject { +@private + /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ + __strong NSString *_modelName; + + /** The processor type. */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /* The number of actual physical processor cores. */ + NSUInteger _processorCount; + + /* The number of logical processors. */ + NSUInteger _logicalProcessorCount; +} + +- (id) initWithModelName: (NSString *) modelName + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + processorCount: (NSUInteger) processorCount + logicalProcessorCount: (NSUInteger) logicalProcessorCount; + +/** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *modelName; + +/** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +/* + * The number of actual physical processor cores. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger processorCount; + +/* + * The number of logical processors. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger logicalProcessorCount; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessInfo.h new file mode 100644 index 0000000..802e8d4 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessInfo.h @@ -0,0 +1,103 @@ +/* + * Author: Damian Morris + * + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportProcessInfo : NSObject { +@private + /** Process name, or nil if unavailable. */ + __strong NSString *_processName; + + /** Process ID */ + NSUInteger _processID; + + /** Process path */ + __strong NSString* _processPath; + + /** Date and time that the crashing process was started. This may be unavailable, and this property + * will be nil. */ + __strong NSDate *_processStartTime; + + /** Parent process name, or nil if unavailable. */ + __strong NSString *_parentProcessName; + + /** Parent process ID */ + NSUInteger _parentProcessID; + + /** If false, the process is being run via process-level CPU emulation (such as Rosetta). */ + BOOL _native; +} + +- (id) initWithProcessName: (NSString *) processName + processID: (NSUInteger) processID + processPath: (NSString *) processPath + processStartTime: (NSDate *) processStartTime + parentProcessName: (NSString *) parentProcessName + parentProcessID: (NSUInteger) parentProcessID + native: (BOOL) native; + +/** + * The process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processName; + +/** + * The process ID. + */ +@property(nonatomic, readonly) NSUInteger processID; + +/** + * The path to the process executable. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processPath; + +/** + * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSDate *processStartTime; + +/** + * The parent process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *parentProcessName; + +/** + * The parent process ID. + */ +@property(nonatomic, readonly) NSUInteger parentProcessID; + +/** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */ +@property(nonatomic, readonly) BOOL native; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessorInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessorInfo.h new file mode 100644 index 0000000..03d570b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportProcessorInfo.h @@ -0,0 +1,74 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +/** + * @ingroup constants + * + * The type encodings supported for CPU types and subtypes. Currently only Apple + * Mach-O defined encodings are supported. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Unknown cpu type encoding. */ + PLCrashReportProcessorTypeEncodingUnknown = 0, + + /** Apple Mach-defined processor types. */ + PLCrashReportProcessorTypeEncodingMach = 1 +} PLCrashReportProcessorTypeEncoding; + +@interface PLCrashReportProcessorInfo : NSObject { +@private + /** Type encoding */ + PLCrashReportProcessorTypeEncoding _typeEncoding; + + /** CPU type */ + uint64_t _type; + + /** CPU subtype */ + uint64_t _subtype; +} + +- (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding + type: (uint64_t) type + subtype: (uint64_t) subtype; + +/** The CPU type encoding. */ +@property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding; + +/** The CPU type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The CPU subtype. */ +@property(nonatomic, readonly) uint64_t subtype; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportRegisterInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportRegisterInfo.h new file mode 100644 index 0000000..e0a1ca1 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportRegisterInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportRegisterInfo : NSObject { +@private + /** Register name */ + __strong NSString *_registerName; + + /** Register value */ + uint64_t _registerValue; +} + +- (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; + +/** + * Register name. + */ +@property(nonatomic, readonly, strong) NSString *registerName; + +/** + * Register value. + */ +@property(nonatomic, readonly) uint64_t registerValue; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSignalInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSignalInfo.h new file mode 100644 index 0000000..d949211 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSignalInfo.h @@ -0,0 +1,60 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSignalInfo : NSObject { +@private + /** Signal name */ + __strong NSString *_name; + + /** Signal code */ + __strong NSString *_code; + + /** Fauling instruction or address */ + uint64_t _address; +} + +- (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address; + +/** + * The signal name. + */ +@property(nonatomic, readonly, strong) NSString *name; + +/** + * The signal code. + */ +@property(nonatomic, readonly, strong) NSString *code; + +/** + * The faulting instruction or address. + */ +@property(nonatomic, readonly) uint64_t address; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportStackFrameInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000..5fd4acc --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,57 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportSymbolInfo.h" +#endif + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + __strong PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSymbolInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000..bdb367c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + __strong NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly, strong) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSystemInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSystemInfo.h new file mode 100644 index 0000000..eb8a447 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportSystemInfo.h @@ -0,0 +1,177 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashMacros.h" +#endif + +@class PLCrashReportProcessorInfo; + +/** + * @ingroup constants + * + * Indicates the Operating System under which a Crash Log was generated. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Mac OS X. */ + PLCrashReportOperatingSystemMacOSX = 0, + + /** iPhone OS */ + PLCrashReportOperatingSystemiPhoneOS = 1, + + /** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */ + PLCrashReportOperatingSystemiPhoneSimulator = 2, + + /** Unknown operating system */ + PLCrashReportOperatingSystemUnknown = 3, + + /** Apple tvOS */ + PLCrashReportOperatingSystemAppleTVOS = 4, + +} PLCrashReportOperatingSystem; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** + * @ingroup constants + * + * Indicates the architecture under which a Crash Log was generated. + * + * @note The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * will make use of the new PLCrashReportProcessorInfo CPU type encodings. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** x86-32. */ + PLCrashReportArchitectureX86_32 = 0, + + /** x86-64 */ + PLCrashReportArchitectureX86_64 = 1, + + /** ARMv6 */ + PLCrashReportArchitectureARMv6 = 2, + + /** + * ARMv6 + * @deprecated This value has been deprecated in favor of ARM subtype-specific + * values. + * @sa PLCrashReportArchitectureARMv6 + */ + PLCrashReportArchitectureARM PLCR_DEPRECATED = PLCrashReportArchitectureARMv6, + + /** PPC */ + PLCrashReportArchitecturePPC = 3, + + /** PPC64 */ + PLCrashReportArchitecturePPC64 = 4, + + /** ARMv7 */ + PLCrashReportArchitectureARMv7 = 5, + + /** Unknown */ + PLCrashReportArchitectureUnknown = 6 +} PLCrashReportArchitecture; +#pragma clang diagnostic pop + +extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); +extern PLCrashReportArchitecture PLCrashReportHostArchitecture PLCR_EXTERNAL_DEPRECATED; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); + +@interface PLCrashReportSystemInfo : NSObject { +@private + /** Operating system */ + PLCrashReportOperatingSystem _operatingSystem; + + /** Operating system version */ + __strong NSString *_osVersion; + + /** OS build. May be nil. */ + __strong NSString *_osBuild; + + /** Architecture */ + PLCrashReportArchitecture _architecture; + + /** Date crash report was generated. May be nil if the date is unknown. */ + __strong NSDate *_timestamp; + + /** Processor information. */ + __strong PLCrashReportProcessorInfo *_processorInfo; +} + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + timestamp: (NSDate *) timestamp; + +/** The operating system. */ +@property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem; + +/** The operating system's release version. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemVersion; + +/** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemBuild; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo + * extensible encoding. */ +@property(nonatomic, readonly) PLCrashReportArchitecture architecture PLCR_DEPRECATED; + +/** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSDate *timestamp; + +/** The processor type. For v1.2 reports and later, this is an alias to the machine info's processorInfo. + * For earlier reports, this will be synthesized from the deprecated architecture property. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportTextFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportTextFormatter.h new file mode 100644 index 0000000..adbc251 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportTextFormatter.h @@ -0,0 +1,66 @@ +/* + * Authors: + * Landon Fuller + * Damian Morris + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportFormatter.h" +#endif + +/** + * Supported text output formats. + * + * @ingroup enums + */ +typedef enum { + /** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available + * through iTunes Connect. */ + PLCrashReportTextFormatiOS = 0 +} PLCrashReportTextFormat; + + +@interface PLCrashReportTextFormatter : NSObject { +@private + /** Text output format. */ + PLCrashReportTextFormat _textFormat; + + /** Encoding to use for string output. */ + NSStringEncoding _stringEncoding; +} + ++ (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat; + +- (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportThreadInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportThreadInfo.h new file mode 100644 index 0000000..b9092e2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReportThreadInfo.h @@ -0,0 +1,88 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_THREAD_INFO_H +#define PLCRASH_REPORT_THREAD_INFO_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportRegisterInfo.h" +#endif + + +@interface PLCrashReportThreadInfo : NSObject { +@private + /** The thread number. Should be unique within a given crash log. */ + NSInteger _threadNumber; + + /** Ordered list of PLCrashReportStackFrame instances */ + __strong NSArray *_stackFrames; + + /** YES if this thread crashed. */ + BOOL _crashed; + + /** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */ + __strong NSArray *_registers; +} + +- (id) initWithThreadNumber: (NSInteger) threadNumber + stackFrames: (NSArray *) stackFrames + crashed: (BOOL) crashed + registers: (NSArray *) registers; + +/** + * Application thread number. + */ +@property(nonatomic, readonly) NSInteger threadNumber; + +/** + * Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances. + * The array is ordered, last callee to first. + */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +/** + * If this thread crashed, set to YES. + */ +@property(nonatomic, readonly) BOOL crashed; + +/** + * State of the general purpose and related registers, as a list of + * PLCrashReportRegister instances. If this thead did not crash (crashed returns NO), + * this list will be empty. + */ +@property(nonatomic, readonly, strong) NSArray *registers; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReporter.h new file mode 100644 index 0000000..bdc8f83 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReporter.h @@ -0,0 +1,159 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +#ifndef PLCRASH_REPORTER_H +#define PLCRASH_REPORTER_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReporterConfig.h" +#import "PLCrashMacros.h" +#endif + +@class PLCrashMachExceptionServer; +@class PLCrashMachExceptionPortSet; + +/** + * @ingroup functions + * + * Prototype of a callback function used to execute additional user code with signal information as provided + * by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk. + * + * @param info The signal info. + * @param uap The crash's threads context. + * @param context The API client's supplied context value. + * + * @sa The @ref async_safety documentation. + * @sa PLCrashReporter::setPostCrashCallbacks: + */ +typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context); + +/** + * @ingroup types + * + * This structure contains callbacks supported by PLCrashReporter to allow the host application to perform + * additional tasks prior to program termination after a crash has occurred. + * + * @sa The @ref async_safety documentation. + */ +typedef struct PLCrashReporterCallbacks { + /** The version number of this structure. If not one of the defined version numbers for this type, the behavior + * is undefined. The current version of this structure is 0. */ + uint16_t version; + + /** An arbitrary user-supplied context value. This value may be NULL. */ + void *context; + + /** + * The callback used to report caught signal information. In version 0 of this structure, all crashes will be + * reported via this function. + * + * @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived + * from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via + * PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will + * not provide valid thread state. + * + * This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained + * here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions. + */ + PLCrashReporterPostCrashSignalCallback handleSignal; +} PLCrashReporterCallbacks; + +@interface PLCrashReporter : NSObject { +@private + /** Reporter configuration */ + __strong PLCrashReporterConfig *_config; + + /** YES if the crash reporter has been enabled */ + BOOL _enabled; + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if + * the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */ + __strong PLCrashMachExceptionServer *_machServer; + + /** Previously registered Mach exception ports, if any. */ + __strong PLCrashMachExceptionPortSet *_previousMachPorts; +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ + + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; + + /** Path to the crash reporter internal data directory */ + __strong NSString *_crashReportDirectory; +} + ++ (PLCrashReporter *) sharedReporter PLCR_DEPRECATED; + +- (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config; + +- (BOOL) hasPendingCrashReport; + +- (NSData *) loadPendingCrashReportData; +- (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; + +- (NSData *) generateLiveReportWithThread: (thread_t) thread; +- (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; +- (NSData *) generateLiveReportWithThread: (thread_t) thread exception: (NSException *) exception error: (NSError **) outError; + +- (NSData *) generateLiveReport; +- (NSData *) generateLiveReportAndReturnError: (NSError **) outError; +- (NSData *) generateLiveReportWithException: (NSException *) exception error: (NSError **) outError; + +- (BOOL) purgePendingCrashReport; +- (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; + +- (BOOL) enableCrashReporter; +- (BOOL) enableCrashReporterAndReturnError: (NSError **) outError; + +- (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks; + +/** + * Return the path to live crash report (which may not yet, or ever, exist). + */ +- (NSString *) crashReportPath; + +/** + * Custom data to save in the crash report. + */ +@property(nonatomic, strong) NSData *customData; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReporterConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReporterConfig.h new file mode 100644 index 0000000..f151e56 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Headers/PLCrashReporterConfig.h @@ -0,0 +1,197 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashFeatureConfig.h" +#endif + +/** + * @ingroup enums + * Supported mechanisms for trapping and handling crashes. + */ +typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) { + /** + * Trap fatal signals via a sigaction(2)-registered BSD signal handler. + * + * PLCrashReporter's signal handler will supersede previously registered handlers; existing + * handlers will not be called. This behavior may be modified in a future release, and should + * not be relied upon as a mechanism to prevent existing signal handlers from being called. + * + * There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically: + * + * - On Mac OS X, stack overflows will only be handled on the thread on which + * the crash reporter was initialized. This should generally be the main thread. + * - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being + * non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS). + * - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting + * in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal + * handlers prior to raising SIGABRT). These __abort()-based checks are: + * - Implemented for unsafe memcpy/strcpy/snprintf C functions. + * - Only enabled when operating on a fixed-width target buffer (in which case the + * compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument). + * - Only trigger in the case that the source data exceeds the size of the fixed width target + * buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy), + * or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer), + * AND that argument can't be checked at compile-time. + */ + PLCrashReporterSignalHandlerTypeBSD = 0, + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** + * Trap fatal signals via a Mach exception server. + * + * If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that + * exception handler. Should the exceptions be handled by an existing handler, no report will be generated + * by PLCrashReporter. + * + * @par Mac OS X + * + * On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note, + * however, that some kernel-internal constants, as well as architecture-specific trap information, + * may be required to fully interpret a Mach exception's root cause. + * + * @par iOS + * + * On iOS, the APIs required for a complete implementation are not fully public. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included + * Mach exception handling as an optional feature, with both build-time and runtime configuration + * to disable its inclusion or use, respectively. + * + * @par Debugger Incompatibility + * + * The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to + * suspend all active threads (which will include the Mach exception handler). Mach-based handling + * should not be used when a debugger is attached. + * + * @par More Details + * + * For more information, refer to @ref mach_exceptions. + */ + PLCrashReporterSignalHandlerTypeMach = 1 +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ +}; + +/** + * @ingroup enums + * Supported mechanisms for performing local symbolication. + * + * Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may + * return information that is incorrect. This may still be useful in the case where DWARF data is unavailable + * for a given build; in that case, it can provide function and method names (though not line numbers) for a + * crash report that may otherwise be unusable. + * + * Note, however, this comes at the cost of a significant increase in code that must run within the critical + * crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In + * addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may + * change in future iOS releases. Given that DWARF symbolication data will always be more accurate, and + * the risks inherent in executing considerably more code at crash time, it is strongly recommended that local + * symbolication only be enabled for non-release builds. + * + * Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the + * results. + */ +typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) { + /** No symbolication. */ + PLCrashReporterSymbolicationStrategyNone = 0, + + /** + * Use the standard binary symbol table. On iOS, this alone will return + * incomplete results, as most symbols are rewritten to the common '\' string. + */ + PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0, + + /** + * Use Objective-C metadata to find method and class names. This relies on detailed parsing + * of the Objective-C runtime data, including undefined flags and other runtime internals. As such, + * it may return incorrect data should the runtime be changed incompatibly. + */ + PLCrashReporterSymbolicationStrategyObjC = 1 << 1, + + /** + * Enable all available symbolication strategies. + */ + PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC) +}; + +@interface PLCrashReporterConfig : NSObject { +@private + /** The configured signal handler type. */ + PLCrashReporterSignalHandlerType _signalHandlerType; + + /** The configured symbolication strategy. */ + PLCrashReporterSymbolicationStrategy _symbolicationStrategy; + + /** + * Flag indicating if the uncaughtExceptionHandler should be initialized or not. It usually is, except in a + * Xamarin environment. + */ + BOOL _shouldRegisterUncaughtExceptionHandler; +} + ++ (instancetype) defaultConfiguration; + +- (instancetype) init; + +- (instancetype) initWithBasePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + basePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler + basePath: (NSString *) basePath; + +/** The base path to save the crash data. */ +@property(nonatomic, readonly) NSString *basePath; + +/** The configured signal handler type. */ +@property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType; + +/** The configured symbolication strategy. */ +@property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy; + +/** Should PLCrashReporter regiser an uncaught exception handler? This is entended to be used in Xamarin apps */ +@property(nonatomic, readonly) BOOL shouldRegisterUncaughtExceptionHandler; + +@end + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Modules/module.modulemap b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Modules/module.modulemap new file mode 100644 index 0000000..4fa4304 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module CrashReporter { + umbrella header "CrashReporter.h" + + export * + module * { export * } + + link framework "Foundation" +} diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Resources/Info.plist b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Resources/Info.plist new file mode 100644 index 0000000..6d222e8 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/macos-arm64_x86_64/CrashReporter.framework/Versions/Current/Resources/Info.plist @@ -0,0 +1,48 @@ + + + + + BuildMachineOSBuild + 21G531 + CFBundleDevelopmentRegion + English + CFBundleExecutable + CrashReporter + CFBundleIdentifier + com.microsoft.CrashReporter + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + CrashReporter + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.11.1 + CFBundleSignature + ???? + CFBundleSupportedPlatforms + + MacOSX + + CFBundleVersion + 1.11.1 + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 13C100 + DTPlatformName + macosx + DTPlatformVersion + 12.1 + DTSDKBuild + 21C46 + DTSDKName + macosx12.1 + DTXcode + 1321 + DTXcodeBuild + 13C100 + LSMinimumSystemVersion + 10.9 + + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/CrashReporter b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/CrashReporter new file mode 100644 index 0000000..7ee1338 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/CrashReporter differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/CrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/CrashReporter.h new file mode 100644 index 0000000..99878d3 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/CrashReporter.h @@ -0,0 +1,366 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifdef __APPLE__ +#import +#endif + +#if __has_include() + +// This must be included before any other PLCrashReporter includes, as +// it redefines symbol names +#import + +/* Library Imports */ +#import +#import +#import +#else +#import "PLCrashNamespace.h" +#import "PLCrashReporter.h" +#import "PLCrashReport.h" +#import "PLCrashReportTextFormatter.h" +#endif + +/** + * @defgroup functions Crash Reporter Functions Reference + */ + +/** + * @defgroup types Crash Reporter Data Types Reference + */ + +/** + * @defgroup constants Crash Reporter Constants Reference + */ + +/** + * @internal + * @defgroup plcrash_internal Crash Reporter Internal Documentation + */ + +/** + * @defgroup enums Enumerations + * @ingroup constants + */ + +/** + * @defgroup globals Global Variables + * @ingroup constants + */ + +/** + * @defgroup exceptions Exceptions + * @ingroup constants + */ + +/* Exceptions */ +extern NSString *PLCrashReporterException; + +/* Error Domain and Codes */ +extern NSString *PLCrashReporterErrorDomain; + +/** + * NSError codes in the Plausible Crash Reporter error domain. + * @ingroup enums + */ +typedef enum { + /** An unknown error has occured. If this + * code is received, it is a bug, and should be reported. */ + PLCrashReporterErrorUnknown = 0, + + /** An Mach or POSIX operating system error has occured. The underlying NSError cause may be fetched from the userInfo + * dictionary using the NSUnderlyingErrorKey key. */ + PLCrashReporterErrorOperatingSystem = 1, + + /** The crash report log file is corrupt or invalid */ + PLCrashReporterErrorCrashReportInvalid = 2, + + /** An attempt to use a resource which was in use at the time in a manner which would have conflicted with the request. */ + PLCrashReporterErrorResourceBusy = 3 +} PLCrashReporterError; + +/** + * @mainpage Plausible Crash Reporter + * + * @section intro_sec Introduction + * + * Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X. + * + * The following features are supported: + * + * - Implemented as an in-process signal handler. + * - Does not interfer with debugging in gdb.. + * - Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc). + * - Full thread state for all active threads (backtraces, register dumps) is provided. + * + * If your application crashes, a crash report will be written. When the application is next run, you may check for a + * pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the + * report locally. + * + * @section intro_encoding Crash Report Format + * + * Crash logs are encoded using google protobuf, and may be decoded + * using the provided PLCrashReport API. Additionally, the include plcrashutil handles conversion of binary crash reports to the + * symbolicate-compatible iPhone text format. + * + * @section doc_sections Documentation Sections + * - @subpage example_usage_iphone + * - @subpage error_handling + * - @subpage async_safety + */ + +/** + * @page example_usage_iphone Example iPhone Usage + * + * @code + * // + * // Called to handle a pending crash report. + * // + * - (void) handleCrashReport { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSData *crashData; + * NSError *error; + * + * // Try loading the crash report + * crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error]; + * if (crashData == nil) { + * NSLog(@"Could not load crash report: %@", error); + * goto finish; + * } + * + * // We could send the report from here, but we'll just print out + * // some debugging info instead + * PLCrashReport *report = [[[PLCrashReport alloc] initWithData: crashData error: &error] autorelease]; + * if (report == nil) { + * NSLog(@"Could not parse crash report"); + * goto finish; + * } + * + * NSLog(@"Crashed on %@", report.systemInfo.timestamp); + * NSLog(@"Crashed with signal %@ (code %@, address=0x%" PRIx64 ")", report.signalInfo.name, + * report.signalInfo.code, report.signalInfo.address); + * + * // Purge the report + * finish: + * [crashReporter purgePendingCrashReport]; + * return; + * } + * + * // from UIApplicationDelegate protocol + * - (void) applicationDidFinishLaunching: (UIApplication *) application { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSError *error; + * + * // Check if we previously crashed + * if ([crashReporter hasPendingCrashReport]) + * [self handleCrashReport]; + + * // Enable the Crash Reporter + * if (![crashReporter enableCrashReporterAndReturnError: &error]) + * NSLog(@"Warning: Could not enable crash reporter: %@", error); + * + * } + * @endcode + * + */ + +/** + * @page error_handling Error Handling Programming Guide + * + * Where a method may return an error, Plausible Crash Reporter provides access to the underlying + * cause via an optional NSError argument. + * + * All returned errors will be a member of one of the below defined domains, however, new domains and + * error codes may be added at any time. If you do not wish to report on the error cause, many methods + * support a simple form that requires no NSError argument. + * + * @section error_domains Error Domains, Codes, and User Info + * + * @subsection crashreporter_errors Crash Reporter Errors + * + * Any errors in Plausible Crash Reporter use the #PLCrashReporterErrorDomain error domain, and and one + * of the error codes defined in #PLCrashReporterError. + */ + +/** + * @page async_safety Async-Safe Programming Guide + * + * Plausible CrashReporter provides support for executing an application specified function in the context of the + * crash reporter's signal handler, after the crash report has been written to disk. This was a regularly requested + * feature, and provides the ability to implement application finalization in the event of a crash. However, writing + * code intended for execution inside of a signal handler is exceptionally difficult, and is not recommended. + * + * @section program_flow Program Flow and Signal Handlers + * + * When the signal handler is called the normal flow of the program is interrupted, and your program is an unknown + * state. Locks may be held, the heap may be corrupt (or in the process of being updated), and your signal + * handler may invoke a function that was being executed at the time of the signal. This may result in deadlocks, + * data corruption, and program termination. + * + * @section functions Async-Safe Functions + * + * A subset of functions are defined to be async-safe by the OS, and are safely callable from within a signal handler. If + * you do implement a custom post-crash handler, it must be async-safe. A table of POSIX-defined async-safe functions + * and additional information is available from the + * CERT programming guide - SIG30-C + * + * Most notably, the Objective-C runtime itself is not async-safe, and Objective-C may not be used within a signal + * handler. + * + * @sa PLCrashReporter::setCrashCallbacks: + */ + +/** + * @page mach_exceptions Mach Exceptions on Mac OS X and iOS + * + * PLCrashReporter includes support for monitoring crashes via an in-process Mach exception handler. There are a small + * number of crash cases that will not be caught with via a POSIX signal handler, but can be caught via a Mach + * exception handler: + * + * - Stack overflow. sigaltstack() is broken in later iOS releases, and even if functional, must be configured + * on a per-thread basis. + * - Internal Apple assertions that call libSystem's __assert. These include compiler-checked constraints + * for built-in functions, such as strcpy_chk(). The __abort() implementation actually disables the SIGABRT + * signal handler (resetting it to SIG_DFL) prior to to issueing a SIGABRT, bypassing signal-based crash + * reporters entirely. + * + * Unfortunately, the latter issue (__assert) can not be handled on iOS; trapping abort requires that + * a Mach exception handler operate out-of-process, which is impossible on iOS. On Mac OS X, this will + * only be handled once we've implemented fully out-of-process crash excution. + * + * On Mac OS X, the Mach exception implementation is fully supported using entirely public API. On iOS, + * the APIs required are not fully public -- more details on the implications of this for exception handling on + * iOS may be found in @ref mach_exceptions_ios below. It is worth noting that even where the Mach exception APIs + * are fully supported, kernel-internal constants, as well + * as architecture-specific trap information, may be required to fully interpret a Mach exception's root cause. + * + * For example, the EXC_SOFTWARE exception is dispatched for four different failure types, using the exception + * code to differentiate failure types: + * - Non-existent system call invoked (SIGSYS) + * - Write on a pipe with no reader (SIGPIPE) + * - Abort program (SIGABRT -- unused) + * - Kill program (SIGKILL) + * + * Of those four types, only the constant required to interpret the SIGKILL behavior (EXC_SOFT_SIGNAL) is publicly defined. + * Of the remaining three failure types, the constant values are kernel implementation-private, defined only in the available + * kernel sources. On iOS, these sources are unavailable, and while they generally do match the Mac OS X implementation, there + * are no gaurantees that this is -- or will remain -- the case in the future. + * + * Likewise, interpretation of particular fault types requires information regarding the underlying machine traps + * that triggered the Mach exceptions. For example, a floating point trap on x86/x86-64 will trigger an EXC_ARITHMETIC, + * with a subcode value containing the value of the FPU status register. Determining the exact FPU cause requires + * extracting the actual exception flags from status register as per the x86 architecture documentation. The exact format + * of this subcode value is not actually documented outside the kernel, and may change in future releases. + * + * While we have the advantage of access to the x86 kernel sources, the situation on ARM is even less clear. The actual + * use of the Mach exception codes and subcodes is largely undefined by both headers and publicly available documentation, + * and the available x86 kernel sources are of little use in interpreting this data. + * + * As such, while Mach exceptions may catch some cases that BSD signals can not, they are not a perfect solution, + * and may also provide less insight into the actual failures that occur. By comparison, the BSD signal interface + * is both fully defined and architecture independent, with any necessary interpretation of the Mach exception + * codes handled in-kernel at the time of exception dispatch. It is generally recommended by Apple as the preferred + * interface, and should generally be preferred by PLCrashReporter API clients. + * + * @section mach_exceptions_compatibility Compatibility Issues + * + * @subsection Debuggers + * + * Enabling in-process Mach exception handlers will conflict with any attached debuggers; the debugger + * may suspend the processes Mach exception handling thread, which will result in any exception messages + * sent via the debugger being lost, as the in-process handler will be unable to receive and forward + * the messages. + * + * @subsection Managed Runtimes (Xamarin, Unity) + * + * A Mach exception handler may conflict with any managed runtime that registers a BSD signal handler that + * can safely handle otherwise fatal signals, allowing execution to proceed. This includes products + * such as Xamarin for iOS. + * + * In such a case, PLCrashReporter will write a crash report for non-fatal signals, as there is no + * immediate mechanism for determining whether a signal handler exists and that it can safely + * handle the failure. This can result in unexpected delays in application execution, increased I/O to + * disk, and other undesirable operations. + * + * @section mach_exceptions_ios Mach Exceptions on iOS + * + * The APIs required for Mach exception handling are not fully public on iOS. After filing a request with + * Apple DTS to clarify the status of the Mach exception APIs on iOS, and implementing a Mach Exception + * handler using only supported API, they provided the following guidance: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited undefined API on iOS. The reporter + * may be excluded entirely at build time by modifying the PLCRASH_FEATURE_MACH_EXCEPTIONS build configuration; it + * may also be disabled at runtime by configuring the PLCrashReporter instance appropriately via PLCrashReporterConfig. + * + * The iOS implementation is implemented almost entirely using public API, and links against no actual private symbols; + * the use of undocumented functionality is limited to assuming the use of specific msgh_id values (see below + * for details). As a result, it may be considered perfectly safe to include the Mach Exception code in the + * standard build, and enable/disable it at runtime. + * + * The following issues exist in the iOS implementation: + * - The msgh_id values required for an exception reply message are not available from the available + * headers and must be hard-coded. This prevents one from safely replying to exception messages, which + * means that it is impossible to (correctly) inform the server that an exception has *not* been + * handled. + * + * Impact: + * This can lead to the process locking up and not dispatching to the host exception handler (eg, Apple's + * crash reporter), depending on the behavior of the kernel exception code. + * + * - The mach_* structure/type variants required by MACH_EXCEPTION_CODES are not publicly defined (on Mac OS X, + * these are provided by mach_exc.defs). This prevents one from forwarding exception messages to an existing + * handler that was registered with a MACH_EXCEPTION_CODES behavior (eg, forwarding is entirely non-functional + * on ARM64 devices). + * + * Impact: + * This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES, + * including other handlers registered within the current process, eg, by a managed runtime. This could + * also result in misinterpretation of a Mach exception message, in the case where the message format is + * modified by Apple to be incompatible with the existing 32-bit format. + * + * This is the case with LLDB; it will register a task exception handler with MACH_EXCEPTION_CODES set. Failure + * to correctly forward these exceptions will result in the debugger breaking in interesting ways; for example, + * changes to the set of dyld-loaded images are detected by setting a breakpoint on the dyld image registration + * funtions, and this functionality will break if the exception is not correctly forwarded. + * + * Since Mach exception handling is important for a fully functional crash reporter, we have also filed a radar + * to request that the API be made public: + * Radar: rdar://12939497 RFE: Provide mach_exc.defs for iOS + * + * At the time of this writing, the radar remains open/unresolved. + */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashFeatureConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashFeatureConfig.h new file mode 100644 index 0000000..7bcaebf --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashFeatureConfig.h @@ -0,0 +1,108 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_FEATURE_CONFIG_H +#define PLCRASH_FEATURE_CONFIG_H + +#include + +/** + * @internal + * + * Build-time configuration for PLCrashReporter. + * + * This is used to automatically enable/disable features on a per-platform and per-configuration + * basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter. + * + * @defgroup build_config Build Configuration + * @ingroup constants + * @{ + */ + +/* + * Defaults + */ + +/* + * For release builds, disable unused unwind implementations on targets that do not use them. For non-release + * builds, we include the unwind implementations to allow testing on a broader range of targets. + */ +#ifdef PLCF_RELEASE_BUILD +# if defined(__arm__) +# ifndef PLCRASH_FEATURE_UNWIND_DWARF +# define PLCRASH_FEATURE_UNWIND_DWARF 0 +# endif +# ifndef PLCRASH_FEATURE_UNWIND_COMPACT +# define PLCRASH_FEATURE_UNWIND_COMPACT 0 +# endif +# endif +#endif + +/* + * Configuration Flags + */ + + +#ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS +/** + * If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported, + * using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a + * popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either + * they've received special dispensation to use private APIs / private structures, they've found another way to do + * it, or they're just using undocumented functionality and hoping for the best. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled + * Mach exception handling by default, and provided both build-time and runtime configuration + * to disable its use. + * + * For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions. + */ +#if TARGET_OS_TV +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 0 +#else +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 1 +#endif +#endif + +#ifndef PLCRASH_FEATURE_UNWIND_DWARF +/** If true, enable DWARF unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_DWARF 1 +#endif + + +#ifndef PLCRASH_FEATURE_UNWIND_COMPACT +/** If true, enable compact unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_COMPACT 1 +#endif + +/* + * @} + */ + +#endif /* PLCRASH_FEATURE_CONFIG_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashMacros.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashMacros.h new file mode 100644 index 0000000..556e1c2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashMacros.h @@ -0,0 +1,143 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_CONSTANTS_H +#define PLCRASH_CONSTANTS_H + +#include +#include + +#if defined(__cplusplus) +# define PLCR_EXPORT extern "C" +# define PLCR_C_BEGIN_DECLS extern "C" { +# define PLCR_C_END_DECLS } +#else +# define PLCR_EXPORT extern +# define PLCR_C_BEGIN_DECLS +# define PLCR_C_END_DECLS +#endif + +#if defined(__cplusplus) +# define NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ +# define IS_EMPTY_(name) defined(NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ ## name) +# define IS_EMPTY(name) IS_EMPTY_(name) +# if defined(PLCRASHREPORTER_PREFIX) && !IS_EMPTY(PLCRASHREPORTER_PREFIX) + /** @internal Define the plcrash namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ +# define PLCR_CPP_BEGIN_NS namespace plcrash { inline namespace PLCRASHREPORTER_PREFIX { + + /** @internal Close the definition of the `plcrash` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ +# define PLCR_CPP_END_NS }} +# else +# define PLCR_CPP_BEGIN_NS namespace plcrash { +# define PLCR_CPP_END_NS } +# endif +#endif + +#ifdef __clang__ +# define PLCR_PRAGMA_CLANG(_p) _Pragma(_p) +#else +# define PLCR_PRAGMA_CLANG(_p) +#endif + +#ifdef __clang__ +# define PLCR_DEPRECATED __attribute__((deprecated)) +#else +# define PLCR_DEPRECATED +#endif + +#if defined(__clang__) || defined(__GNUC__) +# define PLCR_UNUSED __attribute__((unused)) +#else +# define PLCR_UNUSED +#endif + +#ifdef PLCR_PRIVATE +/** + * Marks a definition as deprecated only for for external clients, allowing + * uses of it internal fo the framework. + */ +# define PLCR_EXTERNAL_DEPRECATED + +/** + * @internal + * A macro to put above a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() \ + PLCR_PRAGMA_CLANG("clang diagnostic push"); \ + PLCR_PRAGMA_CLANG("clang diagnostic ignored \"-Wdocumentation-deprecated-sync\"") + +/** + * @internal + * A macro to put below a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_POP() PLCR_PRAGMA_CLANG("clang diagnostic pop") + +#else + +# define PLCR_EXTERNAL_DEPRECATED PLCR_DEPRECATED +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() + +#endif /* PLCR_PRIVATE */ + +#ifdef PLCR_PRIVATE +# if defined(__clang__) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") +# define PLCR_FALLTHROUGH [[clang::fallthrough]] +# else +# define PLCR_FALLTHROUGH do {} while (0) +# endif +#endif + +#ifdef PLCR_PRIVATE +/** + * @internal + * Static compile-time assertion. + * + * @param name The assertion name; must be valid for use within a C identifier. + * @param cond Assertion condition + */ +# define PLCR_ASSERT_STATIC(name, cond) PLCR_ASSERT_STATIC_(name, cond, __LINE__) +/* + * C++11 and C11 both provide a static_assert(). + * + * Otherwise, we have to use typedef-based static assertions. + */ +# if (defined(__cplusplus) && __cplusplus >= 201103L) || (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(#name, cond) +# define PLCR_ASSERT_STATIC__(name, cond) static_assert(cond, #name) +# else +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(name, cond, line) +# define PLCR_ASSERT_STATIC__(name, cond, line) typedef int plcf_static_assert_##name##_##line [(cond) ? 1 : -1] PLCR_UNUSED +# endif +#endif /* PLCR_PRIVATE */ + +#endif /* PLCRASH_CONSTANTS_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashNamespace.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashNamespace.h new file mode 100644 index 0000000..f4c263c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashNamespace.h @@ -0,0 +1,320 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +// #define PLCRASHREPORTER_PREFIX AcmeCo + + +// We need two extra layers of indirection to make CPP substitute +// the PLCRASHREPORTER_PREFIX define. +#define PLNS_impl2(prefix, symbol) prefix ## symbol +#define PLNS_impl(prefix, symbol) PLNS_impl2(prefix, symbol) +#define PLNS(symbol) PLNS_impl(PLCRASHREPORTER_PREFIX, symbol) + + +/* + * Rewrite all ObjC/C symbols. + * + * For C++ symbol handling, refer to the PLCR_CPP_BEGIN_NS and PLCR_CPP_END_NS + * macros. + */ +#ifdef PLCRASHREPORTER_PREFIX + +/* Objective-C Classes */ +#define PLCrashMachExceptionServer PLNS(PLCrashMachExceptionServer) +#define PLCrashReport PLNS(PLCrashReport) +#define PLCrashReportApplicationInfo PLNS(PLCrashReportApplicationInfo) +#define PLCrashReportBinaryImageInfo PLNS(PLCrashReportBinaryImageInfo) +#define PLCrashReportExceptionInfo PLNS(PLCrashReportExceptionInfo) +#define PLCrashReportMachExceptionInfo PLNS(PLCrashReportMachExceptionInfo) +#define PLCrashReportMachineInfo PLNS(PLCrashReportMachineInfo) +#define PLCrashReportProcessInfo PLNS(PLCrashReportProcessInfo) +#define PLCrashReportProcessorInfo PLNS(PLCrashReportProcessorInfo) +#define PLCrashReportRegisterInfo PLNS(PLCrashReportRegisterInfo) +#define PLCrashReportSignalInfo PLNS(PLCrashReportSignalInfo) +#define PLCrashReportStackFrameInfo PLNS(PLCrashReportStackFrameInfo) +#define PLCrashReportSymbolInfo PLNS(PLCrashReportSymbolInfo) +#define PLCrashReportSystemInfo PLNS(PLCrashReportSystemInfo) +#define PLCrashReportTextFormatter PLNS(PLCrashReportTextFormatter) +#define PLCrashReportThreadInfo PLNS(PLCrashReportThreadInfo) +#define PLCrashReporter PLNS(PLCrashReporter) +#define PLCrashSignalHandler PLNS(PLCrashSignalHandler) +#define PLCrashHostInfo PLNS(PLCrashHostInfo) +#define PLCrashMachExceptionPort PLNS(PLCrashMachExceptionPort) +#define PLCrashMachExceptionPortSet PLNS(PLCrashMachExceptionPortSet) +#define PLCrashProcessInfo PLNS(PLCrashProcessInfo) +#define PLCrashReporterConfig PLNS(PLCrashReporterConfig) +#define PLCrashUncaughtExceptionHandler PLNS(PLCrashUncaughtExceptionHandler) +#define PLCrashReportFormatter PLNS(PLCrashReportFormatter) + +/* Public C functions */ +#define PLCrashMachExceptionForward PLNS(PLCrashMachExceptionForward) +#define PLCrashSignalHandlerForward PLNS(PLCrashSignalHandlerForward) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) + + +/* Public C global symbols */ +#define PLCrashReporterErrorDomain PLNS(PLCrashReporterErrorDomain) +#define PLCrashReportHostArchitecture PLNS(PLCrashReportHostArchitecture) +#define PLCrashReportHostOperatingSystem PLNS(PLCrashReportHostOperatingSystem) +#define PLCrashReporterException PLNS(PLCrashReporterException) + +/* For backwards compatibility, plcrash_async_byteorder vends C++ methods when included under C++. We have + * to handle this distinctly from our PLCR_CPP_BEGIN_NS C++ namespacing mechanism. */ +#define plcrash_async_byteorder PLNS(plcrash_async_byteorder) + +/* + * All private C symbols. Once these are migrated to C++, we'll be able to use the much simpler + * PLCR_CPP_BEGIN_NS machinery. + * + * This list was automatically generated (and can be updated) by setting PLCRASHREPORTER_PREFIX to 'AcmeCo', + * building the library, and executing the following: + * nm -g -U | grep '^[0-9]' | c++filt | grep -v AcmeCo | grep -E '_pl|_PL' | awk '{print $3}' | cut -c 2- | sort | uniq | awk '{print "#define",$1,"PLNS("$1")"}' + */ +#define pl_mach_thread_self PLNS(pl_mach_thread_self) +#define plcrash__architecture__descriptor PLNS(plcrash__architecture__descriptor) +#define plcrash__crash_report__application_info__descriptor PLNS(plcrash__crash_report__application_info__descriptor) +#define plcrash__crash_report__application_info__init PLNS(plcrash__crash_report__application_info__init) +#define plcrash__crash_report__binary_image__descriptor PLNS(plcrash__crash_report__binary_image__descriptor) +#define plcrash__crash_report__binary_image__init PLNS(plcrash__crash_report__binary_image__init) +#define plcrash__crash_report__descriptor PLNS(plcrash__crash_report__descriptor) +#define plcrash__crash_report__exception__descriptor PLNS(plcrash__crash_report__exception__descriptor) +#define plcrash__crash_report__exception__init PLNS(plcrash__crash_report__exception__init) +#define plcrash__crash_report__free_unpacked PLNS(plcrash__crash_report__free_unpacked) +#define plcrash__crash_report__get_packed_size PLNS(plcrash__crash_report__get_packed_size) +#define plcrash__crash_report__init PLNS(plcrash__crash_report__init) +#define plcrash__crash_report__machine_info__descriptor PLNS(plcrash__crash_report__machine_info__descriptor) +#define plcrash__crash_report__machine_info__init PLNS(plcrash__crash_report__machine_info__init) +#define plcrash__crash_report__pack PLNS(plcrash__crash_report__pack) +#define plcrash__crash_report__pack_to_buffer PLNS(plcrash__crash_report__pack_to_buffer) +#define plcrash__crash_report__process_info__descriptor PLNS(plcrash__crash_report__process_info__descriptor) +#define plcrash__crash_report__process_info__init PLNS(plcrash__crash_report__process_info__init) +#define plcrash__crash_report__processor__descriptor PLNS(plcrash__crash_report__processor__descriptor) +#define plcrash__crash_report__processor__init PLNS(plcrash__crash_report__processor__init) +#define plcrash__crash_report__processor__type_encoding__descriptor PLNS(plcrash__crash_report__processor__type_encoding__descriptor) +#define plcrash__crash_report__report_info__descriptor PLNS(plcrash__crash_report__report_info__descriptor) +#define plcrash__crash_report__report_info__init PLNS(plcrash__crash_report__report_info__init) +#define plcrash__crash_report__signal__descriptor PLNS(plcrash__crash_report__signal__descriptor) +#define plcrash__crash_report__signal__init PLNS(plcrash__crash_report__signal__init) +#define plcrash__crash_report__signal__mach_exception__descriptor PLNS(plcrash__crash_report__signal__mach_exception__descriptor) +#define plcrash__crash_report__signal__mach_exception__init PLNS(plcrash__crash_report__signal__mach_exception__init) +#define plcrash__crash_report__symbol__descriptor PLNS(plcrash__crash_report__symbol__descriptor) +#define plcrash__crash_report__symbol__init PLNS(plcrash__crash_report__symbol__init) +#define plcrash__crash_report__system_info__descriptor PLNS(plcrash__crash_report__system_info__descriptor) +#define plcrash__crash_report__system_info__init PLNS(plcrash__crash_report__system_info__init) +#define plcrash__crash_report__system_info__operating_system__descriptor PLNS(plcrash__crash_report__system_info__operating_system__descriptor) +#define plcrash__crash_report__thread__descriptor PLNS(plcrash__crash_report__thread__descriptor) +#define plcrash__crash_report__thread__init PLNS(plcrash__crash_report__thread__init) +#define plcrash__crash_report__thread__register_value__descriptor PLNS(plcrash__crash_report__thread__register_value__descriptor) +#define plcrash__crash_report__thread__register_value__init PLNS(plcrash__crash_report__thread__register_value__init) +#define plcrash__crash_report__thread__stack_frame__descriptor PLNS(plcrash__crash_report__thread__stack_frame__descriptor) +#define plcrash__crash_report__thread__stack_frame__init PLNS(plcrash__crash_report__thread__stack_frame__init) +#define plcrash__crash_report__unpack PLNS(plcrash__crash_report__unpack) +#define plcrash_async_address_apply_offset PLNS(plcrash_async_address_apply_offset) +#define plcrash_async_byteorder_big_endian PLNS(plcrash_async_byteorder_big_endian) +#define plcrash_async_byteorder_direct PLNS(plcrash_async_byteorder_direct) +#define plcrash_async_byteorder_little_endian PLNS(plcrash_async_byteorder_little_endian) +#define plcrash_async_byteorder_swapped PLNS(plcrash_async_byteorder_swapped) +#define plcrash_async_cfe_entry_apply PLNS(plcrash_async_cfe_entry_apply) +#define plcrash_async_cfe_entry_free PLNS(plcrash_async_cfe_entry_free) +#define plcrash_async_cfe_entry_init PLNS(plcrash_async_cfe_entry_init) +#define plcrash_async_cfe_entry_register_count PLNS(plcrash_async_cfe_entry_register_count) +#define plcrash_async_cfe_entry_register_list PLNS(plcrash_async_cfe_entry_register_list) +#define plcrash_async_cfe_entry_return_address_register PLNS(plcrash_async_cfe_entry_return_address_register) +#define plcrash_async_cfe_entry_stack_adjustment PLNS(plcrash_async_cfe_entry_stack_adjustment) +#define plcrash_async_cfe_entry_stack_offset PLNS(plcrash_async_cfe_entry_stack_offset) +#define plcrash_async_cfe_entry_type PLNS(plcrash_async_cfe_entry_type) +#define plcrash_async_cfe_reader_find_pc PLNS(plcrash_async_cfe_reader_find_pc) +#define plcrash_async_cfe_reader_free PLNS(plcrash_async_cfe_reader_free) +#define plcrash_async_cfe_reader_init PLNS(plcrash_async_cfe_reader_init) +#define plcrash_async_cfe_register_decode PLNS(plcrash_async_cfe_register_decode) +#define plcrash_async_cfe_register_encode PLNS(plcrash_async_cfe_register_encode) +#define plcrash_async_file_close PLNS(plcrash_async_file_close) +#define plcrash_async_file_flush PLNS(plcrash_async_file_flush) +#define plcrash_async_file_init PLNS(plcrash_async_file_init) +#define plcrash_async_file_write PLNS(plcrash_async_file_write) +#define plcrash_async_find_symbol PLNS(plcrash_async_find_symbol) +#define plcrash_async_image_containing_address PLNS(plcrash_async_image_containing_address) +#define plcrash_async_image_list_next PLNS(plcrash_async_image_list_next) +#define plcrash_async_image_list_set_reading PLNS(plcrash_async_image_list_set_reading) +#define plcrash_async_mach_exception_get_siginfo PLNS(plcrash_async_mach_exception_get_siginfo) +#define plcrash_async_macho_byteorder PLNS(plcrash_async_macho_byteorder) +#define plcrash_async_macho_contains_address PLNS(plcrash_async_macho_contains_address) +#define plcrash_async_macho_cpu_subtype PLNS(plcrash_async_macho_cpu_subtype) +#define plcrash_async_macho_cpu_type PLNS(plcrash_async_macho_cpu_type) +#define plcrash_async_macho_find_command PLNS(plcrash_async_macho_find_command) +#define plcrash_async_macho_find_segment_cmd PLNS(plcrash_async_macho_find_segment_cmd) +#define plcrash_async_macho_find_symbol_by_name PLNS(plcrash_async_macho_find_symbol_by_name) +#define plcrash_async_macho_find_symbol_by_pc PLNS(plcrash_async_macho_find_symbol_by_pc) +#define plcrash_async_macho_header PLNS(plcrash_async_macho_header) +#define plcrash_async_macho_header_size PLNS(plcrash_async_macho_header_size) +#define plcrash_async_macho_map_section PLNS(plcrash_async_macho_map_section) +#define plcrash_async_macho_map_segment PLNS(plcrash_async_macho_map_segment) +#define plcrash_async_macho_mapped_segment_free PLNS(plcrash_async_macho_mapped_segment_free) +#define plcrash_async_macho_next_command PLNS(plcrash_async_macho_next_command) +#define plcrash_async_macho_next_command_type PLNS(plcrash_async_macho_next_command_type) +#define plcrash_async_macho_string_free PLNS(plcrash_async_macho_string_free) +#define plcrash_async_macho_string_get_length PLNS(plcrash_async_macho_string_get_length) +#define plcrash_async_macho_string_get_pointer PLNS(plcrash_async_macho_string_get_pointer) +#define plcrash_async_macho_string_init PLNS(plcrash_async_macho_string_init) +#define plcrash_async_macho_symtab_reader_free PLNS(plcrash_async_macho_symtab_reader_free) +#define plcrash_async_macho_symtab_reader_init PLNS(plcrash_async_macho_symtab_reader_init) +#define plcrash_async_macho_symtab_reader_read PLNS(plcrash_async_macho_symtab_reader_read) +#define plcrash_async_macho_symtab_reader_symbol_name PLNS(plcrash_async_macho_symtab_reader_symbol_name) +#define plcrash_async_memcpy PLNS(plcrash_async_memcpy) +#define plcrash_async_memset PLNS(plcrash_async_memset) +#define plcrash_async_mobject_base_address PLNS(plcrash_async_mobject_base_address) +#define plcrash_async_mobject_free PLNS(plcrash_async_mobject_free) +#define plcrash_async_mobject_init PLNS(plcrash_async_mobject_init) +#define plcrash_async_mobject_length PLNS(plcrash_async_mobject_length) +#define plcrash_async_mobject_read_uint16 PLNS(plcrash_async_mobject_read_uint16) +#define plcrash_async_mobject_read_uint32 PLNS(plcrash_async_mobject_read_uint32) +#define plcrash_async_mobject_read_uint64 PLNS(plcrash_async_mobject_read_uint64) +#define plcrash_async_mobject_read_uint8 PLNS(plcrash_async_mobject_read_uint8) +#define plcrash_async_mobject_remap_address PLNS(plcrash_async_mobject_remap_address) +#define plcrash_async_mobject_task PLNS(plcrash_async_mobject_task) +#define plcrash_async_mobject_verify_local_pointer PLNS(plcrash_async_mobject_verify_local_pointer) +#define plcrash_async_objc_cache_free PLNS(plcrash_async_objc_cache_free) +#define plcrash_async_objc_cache_init PLNS(plcrash_async_objc_cache_init) +#define plcrash_async_objc_find_method PLNS(plcrash_async_objc_find_method) +#define plcrash_async_signal_sigcode PLNS(plcrash_async_signal_sigcode) +#define plcrash_async_signal_signame PLNS(plcrash_async_signal_signame) +#define plcrash_async_strcmp PLNS(plcrash_async_strcmp) +#define plcrash_async_strerror PLNS(plcrash_async_strerror) +#define plcrash_async_strncmp PLNS(plcrash_async_strncmp) +#define plcrash_async_symbol_cache_free PLNS(plcrash_async_symbol_cache_free) +#define plcrash_async_symbol_cache_init PLNS(plcrash_async_symbol_cache_init) +#define plcrash_async_task_memcpy PLNS(plcrash_async_task_memcpy) +#define plcrash_async_task_read_uint16 PLNS(plcrash_async_task_read_uint16) +#define plcrash_async_task_read_uint32 PLNS(plcrash_async_task_read_uint32) +#define plcrash_async_task_read_uint64 PLNS(plcrash_async_task_read_uint64) +#define plcrash_async_task_read_uint8 PLNS(plcrash_async_task_read_uint8) +#define plcrash_async_thread_state_clear_all_regs PLNS(plcrash_async_thread_state_clear_all_regs) +#define plcrash_async_thread_state_clear_reg PLNS(plcrash_async_thread_state_clear_reg) +#define plcrash_async_thread_state_clear_volatile_regs PLNS(plcrash_async_thread_state_clear_volatile_regs) +#define plcrash_async_thread_state_copy PLNS(plcrash_async_thread_state_copy) +#define plcrash_async_thread_state_current PLNS(plcrash_async_thread_state_current) +#define plcrash_async_thread_state_current_stub PLNS(plcrash_async_thread_state_current_stub) +#define plcrash_async_thread_state_get_greg_size PLNS(plcrash_async_thread_state_get_greg_size) +#define plcrash_async_thread_state_get_reg PLNS(plcrash_async_thread_state_get_reg) +#define plcrash_async_thread_state_get_reg_count PLNS(plcrash_async_thread_state_get_reg_count) +#define plcrash_async_thread_state_get_reg_name PLNS(plcrash_async_thread_state_get_reg_name) +#define plcrash_async_thread_state_get_stack_direction PLNS(plcrash_async_thread_state_get_stack_direction) +#define plcrash_async_thread_state_has_reg PLNS(plcrash_async_thread_state_has_reg) +#define plcrash_async_thread_state_init PLNS(plcrash_async_thread_state_init) +#define plcrash_async_thread_state_mach_thread_init PLNS(plcrash_async_thread_state_mach_thread_init) +#define plcrash_async_thread_state_map_dwarf_to_reg PLNS(plcrash_async_thread_state_map_dwarf_to_reg) +#define plcrash_async_thread_state_map_reg_to_dwarf PLNS(plcrash_async_thread_state_map_reg_to_dwarf) +#define plcrash_async_thread_state_mcontext_init PLNS(plcrash_async_thread_state_mcontext_init) +#define plcrash_async_thread_state_set_reg PLNS(plcrash_async_thread_state_set_reg) +#define plcrash_async_writen PLNS(plcrash_async_writen) +#define plcrash_log_writer_close PLNS(plcrash_log_writer_close) +#define plcrash_log_writer_free PLNS(plcrash_log_writer_free) +#define plcrash_log_writer_init PLNS(plcrash_log_writer_init) +#define plcrash_log_writer_set_exception PLNS(plcrash_log_writer_set_exception) +#define plcrash_log_writer_write PLNS(plcrash_log_writer_write) +#define plcrash_log_writer_set_custom_data PLNS(plcrash_log_writer_set_custom_data) +#define plcrash_nasync_image_list_append PLNS(plcrash_nasync_image_list_append) +#define plcrash_nasync_image_list_free PLNS(plcrash_nasync_image_list_free) +#define plcrash_nasync_image_list_init PLNS(plcrash_nasync_image_list_init) +#define plcrash_nasync_image_list_remove PLNS(plcrash_nasync_image_list_remove) +#define plcrash_nasync_macho_free PLNS(plcrash_nasync_macho_free) +#define plcrash_nasync_macho_init PLNS(plcrash_nasync_macho_init) +#define plcrash_populate_error PLNS(plcrash_populate_error) +#define plcrash_populate_mach_error PLNS(plcrash_populate_mach_error) +#define plcrash_populate_posix_error PLNS(plcrash_populate_posix_error) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) +#define plcrash_sysctl_int PLNS(plcrash_sysctl_int) +#define plcrash_sysctl_string PLNS(plcrash_sysctl_string) +#define plcrash_sysctl_valid_utf8_bytes PLNS(plcrash_sysctl_valid_utf8_bytes) +#define plcrash_sysctl_valid_utf8_bytes_max PLNS(plcrash_sysctl_valid_utf8_bytes_max) +#define plcrash_writer_pack PLNS(plcrash_writer_pack) +#define plframe_cursor_free PLNS(plframe_cursor_free) +#define plframe_cursor_get_reg PLNS(plframe_cursor_get_reg) +#define plframe_cursor_get_regcount PLNS(plframe_cursor_get_regcount) +#define plframe_cursor_get_regname PLNS(plframe_cursor_get_regname) +#define plframe_cursor_init PLNS(plframe_cursor_init) +#define plframe_cursor_next PLNS(plframe_cursor_next) +#define plframe_cursor_next_with_readers PLNS(plframe_cursor_next_with_readers) +#define plframe_cursor_read_compact_unwind PLNS(plframe_cursor_read_compact_unwind) +#define plframe_cursor_read_dwarf_unwind PLNS(plframe_cursor_read_dwarf_unwind) +#define plframe_cursor_read_frame_ptr PLNS(plframe_cursor_read_frame_ptr) +#define plframe_cursor_thread_init PLNS(plframe_cursor_thread_init) +#define plframe_strerror PLNS(plframe_strerror) + +#endif + +/* + * The following symbols are exported by the protobuf-c library. When building + * a shared library, we can hide these as private symbols. + * + * However, when building a static library, we can only do so if we use + * MH_OBJECT "single object prelink". The MH_OBJECT approach allows us to apply + * symbol hiding/aliasing/etc similar to that supported by dylibs, but because it is + * seemingly unused within Apple, the use thereof regularly introduces linking bugs + * and errors in new Xcode releases. + * + * Rather than fighting the linker, we use the namespacing machinery to rewrite these + * symbols, but only when explicitly compiling PLCrashReporter. Since protobuf-c is a library + * that may be used elsewhere, we don't want to rewrite these symbols if they're used + * independently by PLCrashReporter API clients. + */ +#ifdef PLCR_PRIVATE + /* If no prefix has been defined, we need to specify our own private prefix */ +# ifndef PLCRASHREPORTER_PREFIX +# define PLCRASHREPORTER_PREFIX PL_ +# endif + +# define protobuf_c_buffer_simple_append PLNS(protobuf_c_buffer_simple_append) +# define protobuf_c_empty_string PLNS(protobuf_c_empty_string) +# define protobuf_c_enum_descriptor_get_value PLNS(protobuf_c_enum_descriptor_get_value) +# define protobuf_c_enum_descriptor_get_value_by_name PLNS(protobuf_c_enum_descriptor_get_value_by_name) +# define protobuf_c_message_check PLNS(protobuf_c_message_check) +# define protobuf_c_message_descriptor_get_field PLNS(protobuf_c_message_descriptor_get_field) +# define protobuf_c_message_descriptor_get_field_by_name PLNS(protobuf_c_message_descriptor_get_field_by_name) +# define protobuf_c_message_free_unpacked PLNS(protobuf_c_message_free_unpacked) +# define protobuf_c_message_get_packed_size PLNS(protobuf_c_message_get_packed_size) +# define protobuf_c_message_init PLNS(protobuf_c_message_init) +# define protobuf_c_message_pack PLNS(protobuf_c_message_pack) +# define protobuf_c_message_pack_to_buffer PLNS(protobuf_c_message_pack_to_buffer) +# define protobuf_c_message_unpack PLNS(protobuf_c_message_unpack) +# define protobuf_c_service_descriptor_get_method_by_name PLNS(protobuf_c_service_descriptor_get_method_by_name) +# define protobuf_c_service_destroy PLNS(protobuf_c_service_destroy) +# define protobuf_c_service_generated_init PLNS(protobuf_c_service_generated_init) +# define protobuf_c_service_invoke_internal PLNS(protobuf_c_service_invoke_internal) +# define protobuf_c_version PLNS(protobuf_c_version) +# define protobuf_c_version_number PLNS(protobuf_c_version_number) +#endif /* PLCR_PRIVATE */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReport.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReport.h new file mode 100644 index 0000000..f710c3f --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReport.h @@ -0,0 +1,230 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_H +#define PLCRASH_REPORT_H + +#if __has_include() +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#else +#import "PLCrashReportApplicationInfo.h" +#import "PLCrashReportBinaryImageInfo.h" +#import "PLCrashReportExceptionInfo.h" +#import "PLCrashReportMachineInfo.h" +#import "PLCrashReportMachExceptionInfo.h" +#import "PLCrashReportProcessInfo.h" +#import "PLCrashReportProcessorInfo.h" +#import "PLCrashReportRegisterInfo.h" +#import "PLCrashReportSignalInfo.h" +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportSymbolInfo.h" +#import "PLCrashReportSystemInfo.h" +#import "PLCrashReportThreadInfo.h" +#endif + +/** + * @ingroup constants + * Crash file magic identifier */ +#define PLCRASH_REPORT_FILE_MAGIC "plcrash" + +/** + * @ingroup constants + * Crash format version byte identifier. Will not change outside of the introduction of + * an entirely new crash log format. */ +#define PLCRASH_REPORT_FILE_VERSION 1 + +/** + * @ingroup types + * Crash log file header format. + * + * Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC), + * followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION). + * The crash log message format itself is extensible, so this version number will only + * be incremented in the event of an incompatible encoding or format change. + */ +struct PLCrashReportFileHeader { + /** Crash log magic identifier, not NULL terminated */ + const char magic[7]; + + /** Crash log encoding/format version */ + const uint8_t version; + + /** File data */ + const uint8_t data[]; +} __attribute__((packed)); + + +/** + * @internal + * Private decoder instance variables (used to hide the underlying protobuf parser). + */ +typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; + +@interface PLCrashReport : NSObject { +@private + /** Private implementation variables (used to hide the underlying protobuf parser) */ + _PLCrashReportDecoder *_decoder; + + /** System info */ + __strong PLCrashReportSystemInfo *_systemInfo; + + /** Machine info */ + __strong PLCrashReportMachineInfo *_machineInfo; + + /** Application info */ + __strong PLCrashReportApplicationInfo *_applicationInfo; + + /** Process info */ + __strong PLCrashReportProcessInfo *_processInfo; + + /** Signal info */ + __strong PLCrashReportSignalInfo *_signalInfo; + + /** Mach exception info */ + __strong PLCrashReportMachExceptionInfo *_machExceptionInfo; + + /** Thread info (PLCrashReportThreadInfo instances) */ + __strong NSArray *_threads; + + /** Binary images (PLCrashReportBinaryImageInfo instances */ + __strong NSArray *_images; + + /** Exception information (may be nil) */ + __strong PLCrashReportExceptionInfo *_exceptionInfo; + + /** User defined information (may be nil) */ + __strong NSData *_customData; + + /** Report UUID */ + CFUUIDRef _uuid; +} + +- (id) initWithData: (NSData *) encodedData error: (NSError **) outError; + +- (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address; + +/** + * System information. + */ +@property(nonatomic, readonly, strong) PLCrashReportSystemInfo *systemInfo; + +/** + * YES if machine information is available. + */ +@property(nonatomic, readonly) BOOL hasMachineInfo; + +/** + * Machine information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachineInfo *machineInfo; + +/** + * Application information. + */ +@property(nonatomic, readonly, strong) PLCrashReportApplicationInfo *applicationInfo; + +/** + * YES if process information is available. + */ +@property(nonatomic, readonly) BOOL hasProcessInfo; + +/** + * Process information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessInfo *processInfo; + +/** + * Signal information. This provides the signal and signal code of the fatal signal. + */ +@property(nonatomic, readonly, strong) PLCrashReportSignalInfo *signalInfo; + +/** + * Mach exception information, if available. This will only be included in the + * case that encoding crash reporter's exception-based reporting was enabled, and a Mach + * exception was caught. + * + * @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this + * s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the + * Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal + * mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachExceptionInfo *machExceptionInfo; + +/** + * Thread information. Returns a list of PLCrashReportThreadInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *threads; + +/** + * Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *images; + +/** + * YES if exception information is available. + */ +@property(nonatomic, readonly) BOOL hasExceptionInfo; + +/** + * Exception information. Only available if a crash was caused by an uncaught exception, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportExceptionInfo *exceptionInfo; + +/** + * Custom user data. Only available if user explicitly assigned it before crash happened, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) NSData *customData; + +/** + * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated + * by a single client. Only available in later (v1.2+) crash report format versions. If not available, + * will be NULL. + */ +@property(nonatomic, readonly) CFUUIDRef uuidRef; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h new file mode 100644 index 0000000..787a286 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h @@ -0,0 +1,62 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportApplicationInfo : NSObject { +@private + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; +} + +- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier + applicationVersion: (NSString *) applicationVersion + applicationMarketingVersion: (NSString *) applicationMarketingVersion; + +/** + * The application identifier. This is usually the application's CFBundleIdentifier value. + */ +@property(nonatomic, readonly, strong) NSString *applicationIdentifier; + +/** + * The application version. This is usually the application's CFBundleVersion value. + */ +@property(nonatomic, readonly, strong) NSString *applicationVersion; + +/** + * The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil. + */ +@property(nonatomic, readonly, strong) NSString *applicationMarketingVersion; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h new file mode 100644 index 0000000..1a75051 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h @@ -0,0 +1,95 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportBinaryImageInfo : NSObject { +@private + /** Code type */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /** Base image address */ + uint64_t _baseAddress; + + /** Image segment size */ + uint64_t _imageSize; + + /** Name of binary image */ + __strong NSString *_imageName; + + /** If the UUID is available */ + BOOL _hasImageUUID; + + /** 128-bit object UUID. May be nil. */ + __strong NSString *_imageUUID; +} + +- (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo + baseAddress: (uint64_t) baseAddress + size: (uint64_t) imageSize + name: (NSString *) imageName + uuid: (NSData *) uuid; + +/** + * Image code type, or nil if unavailable. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *codeType; + +/** + * Image base address. + */ +@property(nonatomic, readonly) uint64_t imageBaseAddress; + +/** + * Segment size. + */ +@property(nonatomic, readonly) uint64_t imageSize; + +/** + * Image name (absolute path) + */ +@property(nonatomic, readonly, strong) NSString *imageName; + + +/** + * YES if this image has an associated UUID. + */ +@property(nonatomic, readonly) BOOL hasImageUUID; + +/** + * 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable. + */ +@property(nonatomic, readonly, strong) NSString *imageUUID; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h new file mode 100644 index 0000000..7423ca9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h @@ -0,0 +1,69 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportThreadInfo.h" +#endif + +@interface PLCrashReportExceptionInfo : NSObject { +@private + /** Name */ + __strong NSString *_name; + + /** Reason */ + __strong NSString *_reason; + + /** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */ + __strong NSArray *_stackFrames; +} + +- (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason; + +- (id) initWithExceptionName: (NSString *) name + reason: (NSString *) reason + stackFrames: (NSArray *) stackFrames; + +/** + * The exception name. + */ +@property(nonatomic, readonly, strong) NSString *exceptionName; + +/** + * The exception reason. + */ +@property(nonatomic, readonly, strong) NSString *exceptionReason; + +/* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable. + * This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportFormatter.h new file mode 100644 index 0000000..5cdf01b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportFormatter.h @@ -0,0 +1,55 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReport.h" +#endif + +/** + * A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules, + * (such as implementing text output support), and returns the result. + */ +@protocol PLCrashReportFormatter + +/** + * Format the provided @a report. + * + * @param report Report to be formatted. + * @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error + * object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will + * be left unmodified. You may specify nil for this parameter, and no error information will be provided. + * + * @return Returns the formatted report data on success, or nil on failure. + */ +- (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h new file mode 100644 index 0000000..19461a5 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h @@ -0,0 +1,48 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportMachExceptionInfo : NSObject { +@private + /** The Mach exception type. */ + uint64_t _type; + + /** The Mach exception codes, represented as an ordered array of NSNumber instances. */ + __strong NSArray *_codes; +} + +- (id) initWithType: (uint64_t) type codes: (NSArray *) codes; + +/** The Mach exception type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */ +@property(nonatomic, readonly, strong) NSArray *codes; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h new file mode 100644 index 0000000..ab6fee9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h @@ -0,0 +1,77 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportMachineInfo : NSObject { +@private + /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ + __strong NSString *_modelName; + + /** The processor type. */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /* The number of actual physical processor cores. */ + NSUInteger _processorCount; + + /* The number of logical processors. */ + NSUInteger _logicalProcessorCount; +} + +- (id) initWithModelName: (NSString *) modelName + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + processorCount: (NSUInteger) processorCount + logicalProcessorCount: (NSUInteger) logicalProcessorCount; + +/** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *modelName; + +/** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +/* + * The number of actual physical processor cores. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger processorCount; + +/* + * The number of logical processors. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger logicalProcessorCount; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h new file mode 100644 index 0000000..802e8d4 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h @@ -0,0 +1,103 @@ +/* + * Author: Damian Morris + * + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportProcessInfo : NSObject { +@private + /** Process name, or nil if unavailable. */ + __strong NSString *_processName; + + /** Process ID */ + NSUInteger _processID; + + /** Process path */ + __strong NSString* _processPath; + + /** Date and time that the crashing process was started. This may be unavailable, and this property + * will be nil. */ + __strong NSDate *_processStartTime; + + /** Parent process name, or nil if unavailable. */ + __strong NSString *_parentProcessName; + + /** Parent process ID */ + NSUInteger _parentProcessID; + + /** If false, the process is being run via process-level CPU emulation (such as Rosetta). */ + BOOL _native; +} + +- (id) initWithProcessName: (NSString *) processName + processID: (NSUInteger) processID + processPath: (NSString *) processPath + processStartTime: (NSDate *) processStartTime + parentProcessName: (NSString *) parentProcessName + parentProcessID: (NSUInteger) parentProcessID + native: (BOOL) native; + +/** + * The process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processName; + +/** + * The process ID. + */ +@property(nonatomic, readonly) NSUInteger processID; + +/** + * The path to the process executable. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processPath; + +/** + * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSDate *processStartTime; + +/** + * The parent process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *parentProcessName; + +/** + * The parent process ID. + */ +@property(nonatomic, readonly) NSUInteger parentProcessID; + +/** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */ +@property(nonatomic, readonly) BOOL native; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h new file mode 100644 index 0000000..03d570b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h @@ -0,0 +1,74 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +/** + * @ingroup constants + * + * The type encodings supported for CPU types and subtypes. Currently only Apple + * Mach-O defined encodings are supported. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Unknown cpu type encoding. */ + PLCrashReportProcessorTypeEncodingUnknown = 0, + + /** Apple Mach-defined processor types. */ + PLCrashReportProcessorTypeEncodingMach = 1 +} PLCrashReportProcessorTypeEncoding; + +@interface PLCrashReportProcessorInfo : NSObject { +@private + /** Type encoding */ + PLCrashReportProcessorTypeEncoding _typeEncoding; + + /** CPU type */ + uint64_t _type; + + /** CPU subtype */ + uint64_t _subtype; +} + +- (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding + type: (uint64_t) type + subtype: (uint64_t) subtype; + +/** The CPU type encoding. */ +@property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding; + +/** The CPU type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The CPU subtype. */ +@property(nonatomic, readonly) uint64_t subtype; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h new file mode 100644 index 0000000..e0a1ca1 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportRegisterInfo : NSObject { +@private + /** Register name */ + __strong NSString *_registerName; + + /** Register value */ + uint64_t _registerValue; +} + +- (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; + +/** + * Register name. + */ +@property(nonatomic, readonly, strong) NSString *registerName; + +/** + * Register value. + */ +@property(nonatomic, readonly) uint64_t registerValue; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h new file mode 100644 index 0000000..d949211 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h @@ -0,0 +1,60 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSignalInfo : NSObject { +@private + /** Signal name */ + __strong NSString *_name; + + /** Signal code */ + __strong NSString *_code; + + /** Fauling instruction or address */ + uint64_t _address; +} + +- (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address; + +/** + * The signal name. + */ +@property(nonatomic, readonly, strong) NSString *name; + +/** + * The signal code. + */ +@property(nonatomic, readonly, strong) NSString *code; + +/** + * The faulting instruction or address. + */ +@property(nonatomic, readonly) uint64_t address; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000..5fd4acc --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,57 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportSymbolInfo.h" +#endif + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + __strong PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000..bdb367c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + __strong NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly, strong) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h new file mode 100644 index 0000000..eb8a447 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h @@ -0,0 +1,177 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashMacros.h" +#endif + +@class PLCrashReportProcessorInfo; + +/** + * @ingroup constants + * + * Indicates the Operating System under which a Crash Log was generated. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Mac OS X. */ + PLCrashReportOperatingSystemMacOSX = 0, + + /** iPhone OS */ + PLCrashReportOperatingSystemiPhoneOS = 1, + + /** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */ + PLCrashReportOperatingSystemiPhoneSimulator = 2, + + /** Unknown operating system */ + PLCrashReportOperatingSystemUnknown = 3, + + /** Apple tvOS */ + PLCrashReportOperatingSystemAppleTVOS = 4, + +} PLCrashReportOperatingSystem; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** + * @ingroup constants + * + * Indicates the architecture under which a Crash Log was generated. + * + * @note The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * will make use of the new PLCrashReportProcessorInfo CPU type encodings. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** x86-32. */ + PLCrashReportArchitectureX86_32 = 0, + + /** x86-64 */ + PLCrashReportArchitectureX86_64 = 1, + + /** ARMv6 */ + PLCrashReportArchitectureARMv6 = 2, + + /** + * ARMv6 + * @deprecated This value has been deprecated in favor of ARM subtype-specific + * values. + * @sa PLCrashReportArchitectureARMv6 + */ + PLCrashReportArchitectureARM PLCR_DEPRECATED = PLCrashReportArchitectureARMv6, + + /** PPC */ + PLCrashReportArchitecturePPC = 3, + + /** PPC64 */ + PLCrashReportArchitecturePPC64 = 4, + + /** ARMv7 */ + PLCrashReportArchitectureARMv7 = 5, + + /** Unknown */ + PLCrashReportArchitectureUnknown = 6 +} PLCrashReportArchitecture; +#pragma clang diagnostic pop + +extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); +extern PLCrashReportArchitecture PLCrashReportHostArchitecture PLCR_EXTERNAL_DEPRECATED; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); + +@interface PLCrashReportSystemInfo : NSObject { +@private + /** Operating system */ + PLCrashReportOperatingSystem _operatingSystem; + + /** Operating system version */ + __strong NSString *_osVersion; + + /** OS build. May be nil. */ + __strong NSString *_osBuild; + + /** Architecture */ + PLCrashReportArchitecture _architecture; + + /** Date crash report was generated. May be nil if the date is unknown. */ + __strong NSDate *_timestamp; + + /** Processor information. */ + __strong PLCrashReportProcessorInfo *_processorInfo; +} + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + timestamp: (NSDate *) timestamp; + +/** The operating system. */ +@property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem; + +/** The operating system's release version. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemVersion; + +/** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemBuild; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo + * extensible encoding. */ +@property(nonatomic, readonly) PLCrashReportArchitecture architecture PLCR_DEPRECATED; + +/** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSDate *timestamp; + +/** The processor type. For v1.2 reports and later, this is an alias to the machine info's processorInfo. + * For earlier reports, this will be synthesized from the deprecated architecture property. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h new file mode 100644 index 0000000..adbc251 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h @@ -0,0 +1,66 @@ +/* + * Authors: + * Landon Fuller + * Damian Morris + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportFormatter.h" +#endif + +/** + * Supported text output formats. + * + * @ingroup enums + */ +typedef enum { + /** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available + * through iTunes Connect. */ + PLCrashReportTextFormatiOS = 0 +} PLCrashReportTextFormat; + + +@interface PLCrashReportTextFormatter : NSObject { +@private + /** Text output format. */ + PLCrashReportTextFormat _textFormat; + + /** Encoding to use for string output. */ + NSStringEncoding _stringEncoding; +} + ++ (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat; + +- (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h new file mode 100644 index 0000000..b9092e2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h @@ -0,0 +1,88 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_THREAD_INFO_H +#define PLCRASH_REPORT_THREAD_INFO_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportRegisterInfo.h" +#endif + + +@interface PLCrashReportThreadInfo : NSObject { +@private + /** The thread number. Should be unique within a given crash log. */ + NSInteger _threadNumber; + + /** Ordered list of PLCrashReportStackFrame instances */ + __strong NSArray *_stackFrames; + + /** YES if this thread crashed. */ + BOOL _crashed; + + /** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */ + __strong NSArray *_registers; +} + +- (id) initWithThreadNumber: (NSInteger) threadNumber + stackFrames: (NSArray *) stackFrames + crashed: (BOOL) crashed + registers: (NSArray *) registers; + +/** + * Application thread number. + */ +@property(nonatomic, readonly) NSInteger threadNumber; + +/** + * Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances. + * The array is ordered, last callee to first. + */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +/** + * If this thread crashed, set to YES. + */ +@property(nonatomic, readonly) BOOL crashed; + +/** + * State of the general purpose and related registers, as a list of + * PLCrashReportRegister instances. If this thead did not crash (crashed returns NO), + * this list will be empty. + */ +@property(nonatomic, readonly, strong) NSArray *registers; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReporter.h new file mode 100644 index 0000000..bdc8f83 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReporter.h @@ -0,0 +1,159 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +#ifndef PLCRASH_REPORTER_H +#define PLCRASH_REPORTER_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReporterConfig.h" +#import "PLCrashMacros.h" +#endif + +@class PLCrashMachExceptionServer; +@class PLCrashMachExceptionPortSet; + +/** + * @ingroup functions + * + * Prototype of a callback function used to execute additional user code with signal information as provided + * by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk. + * + * @param info The signal info. + * @param uap The crash's threads context. + * @param context The API client's supplied context value. + * + * @sa The @ref async_safety documentation. + * @sa PLCrashReporter::setPostCrashCallbacks: + */ +typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context); + +/** + * @ingroup types + * + * This structure contains callbacks supported by PLCrashReporter to allow the host application to perform + * additional tasks prior to program termination after a crash has occurred. + * + * @sa The @ref async_safety documentation. + */ +typedef struct PLCrashReporterCallbacks { + /** The version number of this structure. If not one of the defined version numbers for this type, the behavior + * is undefined. The current version of this structure is 0. */ + uint16_t version; + + /** An arbitrary user-supplied context value. This value may be NULL. */ + void *context; + + /** + * The callback used to report caught signal information. In version 0 of this structure, all crashes will be + * reported via this function. + * + * @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived + * from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via + * PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will + * not provide valid thread state. + * + * This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained + * here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions. + */ + PLCrashReporterPostCrashSignalCallback handleSignal; +} PLCrashReporterCallbacks; + +@interface PLCrashReporter : NSObject { +@private + /** Reporter configuration */ + __strong PLCrashReporterConfig *_config; + + /** YES if the crash reporter has been enabled */ + BOOL _enabled; + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if + * the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */ + __strong PLCrashMachExceptionServer *_machServer; + + /** Previously registered Mach exception ports, if any. */ + __strong PLCrashMachExceptionPortSet *_previousMachPorts; +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ + + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; + + /** Path to the crash reporter internal data directory */ + __strong NSString *_crashReportDirectory; +} + ++ (PLCrashReporter *) sharedReporter PLCR_DEPRECATED; + +- (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config; + +- (BOOL) hasPendingCrashReport; + +- (NSData *) loadPendingCrashReportData; +- (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; + +- (NSData *) generateLiveReportWithThread: (thread_t) thread; +- (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; +- (NSData *) generateLiveReportWithThread: (thread_t) thread exception: (NSException *) exception error: (NSError **) outError; + +- (NSData *) generateLiveReport; +- (NSData *) generateLiveReportAndReturnError: (NSError **) outError; +- (NSData *) generateLiveReportWithException: (NSException *) exception error: (NSError **) outError; + +- (BOOL) purgePendingCrashReport; +- (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; + +- (BOOL) enableCrashReporter; +- (BOOL) enableCrashReporterAndReturnError: (NSError **) outError; + +- (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks; + +/** + * Return the path to live crash report (which may not yet, or ever, exist). + */ +- (NSString *) crashReportPath; + +/** + * Custom data to save in the crash report. + */ +@property(nonatomic, strong) NSData *customData; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReporterConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReporterConfig.h new file mode 100644 index 0000000..f151e56 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Headers/PLCrashReporterConfig.h @@ -0,0 +1,197 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashFeatureConfig.h" +#endif + +/** + * @ingroup enums + * Supported mechanisms for trapping and handling crashes. + */ +typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) { + /** + * Trap fatal signals via a sigaction(2)-registered BSD signal handler. + * + * PLCrashReporter's signal handler will supersede previously registered handlers; existing + * handlers will not be called. This behavior may be modified in a future release, and should + * not be relied upon as a mechanism to prevent existing signal handlers from being called. + * + * There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically: + * + * - On Mac OS X, stack overflows will only be handled on the thread on which + * the crash reporter was initialized. This should generally be the main thread. + * - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being + * non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS). + * - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting + * in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal + * handlers prior to raising SIGABRT). These __abort()-based checks are: + * - Implemented for unsafe memcpy/strcpy/snprintf C functions. + * - Only enabled when operating on a fixed-width target buffer (in which case the + * compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument). + * - Only trigger in the case that the source data exceeds the size of the fixed width target + * buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy), + * or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer), + * AND that argument can't be checked at compile-time. + */ + PLCrashReporterSignalHandlerTypeBSD = 0, + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** + * Trap fatal signals via a Mach exception server. + * + * If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that + * exception handler. Should the exceptions be handled by an existing handler, no report will be generated + * by PLCrashReporter. + * + * @par Mac OS X + * + * On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note, + * however, that some kernel-internal constants, as well as architecture-specific trap information, + * may be required to fully interpret a Mach exception's root cause. + * + * @par iOS + * + * On iOS, the APIs required for a complete implementation are not fully public. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included + * Mach exception handling as an optional feature, with both build-time and runtime configuration + * to disable its inclusion or use, respectively. + * + * @par Debugger Incompatibility + * + * The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to + * suspend all active threads (which will include the Mach exception handler). Mach-based handling + * should not be used when a debugger is attached. + * + * @par More Details + * + * For more information, refer to @ref mach_exceptions. + */ + PLCrashReporterSignalHandlerTypeMach = 1 +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ +}; + +/** + * @ingroup enums + * Supported mechanisms for performing local symbolication. + * + * Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may + * return information that is incorrect. This may still be useful in the case where DWARF data is unavailable + * for a given build; in that case, it can provide function and method names (though not line numbers) for a + * crash report that may otherwise be unusable. + * + * Note, however, this comes at the cost of a significant increase in code that must run within the critical + * crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In + * addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may + * change in future iOS releases. Given that DWARF symbolication data will always be more accurate, and + * the risks inherent in executing considerably more code at crash time, it is strongly recommended that local + * symbolication only be enabled for non-release builds. + * + * Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the + * results. + */ +typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) { + /** No symbolication. */ + PLCrashReporterSymbolicationStrategyNone = 0, + + /** + * Use the standard binary symbol table. On iOS, this alone will return + * incomplete results, as most symbols are rewritten to the common '\' string. + */ + PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0, + + /** + * Use Objective-C metadata to find method and class names. This relies on detailed parsing + * of the Objective-C runtime data, including undefined flags and other runtime internals. As such, + * it may return incorrect data should the runtime be changed incompatibly. + */ + PLCrashReporterSymbolicationStrategyObjC = 1 << 1, + + /** + * Enable all available symbolication strategies. + */ + PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC) +}; + +@interface PLCrashReporterConfig : NSObject { +@private + /** The configured signal handler type. */ + PLCrashReporterSignalHandlerType _signalHandlerType; + + /** The configured symbolication strategy. */ + PLCrashReporterSymbolicationStrategy _symbolicationStrategy; + + /** + * Flag indicating if the uncaughtExceptionHandler should be initialized or not. It usually is, except in a + * Xamarin environment. + */ + BOOL _shouldRegisterUncaughtExceptionHandler; +} + ++ (instancetype) defaultConfiguration; + +- (instancetype) init; + +- (instancetype) initWithBasePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + basePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler + basePath: (NSString *) basePath; + +/** The base path to save the crash data. */ +@property(nonatomic, readonly) NSString *basePath; + +/** The configured signal handler type. */ +@property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType; + +/** The configured symbolication strategy. */ +@property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy; + +/** Should PLCrashReporter regiser an uncaught exception handler? This is entended to be used in Xamarin apps */ +@property(nonatomic, readonly) BOOL shouldRegisterUncaughtExceptionHandler; + +@end + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Info.plist b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Info.plist new file mode 100644 index 0000000..00de413 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Info.plist differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Modules/module.modulemap b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Modules/module.modulemap new file mode 100644 index 0000000..4fa4304 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64/CrashReporter.framework/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module CrashReporter { + umbrella header "CrashReporter.h" + + export * + module * { export * } + + link framework "Foundation" +} diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/CrashReporter b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/CrashReporter new file mode 100644 index 0000000..38e548c Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/CrashReporter differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/CrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/CrashReporter.h new file mode 100644 index 0000000..99878d3 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/CrashReporter.h @@ -0,0 +1,366 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifdef __APPLE__ +#import +#endif + +#if __has_include() + +// This must be included before any other PLCrashReporter includes, as +// it redefines symbol names +#import + +/* Library Imports */ +#import +#import +#import +#else +#import "PLCrashNamespace.h" +#import "PLCrashReporter.h" +#import "PLCrashReport.h" +#import "PLCrashReportTextFormatter.h" +#endif + +/** + * @defgroup functions Crash Reporter Functions Reference + */ + +/** + * @defgroup types Crash Reporter Data Types Reference + */ + +/** + * @defgroup constants Crash Reporter Constants Reference + */ + +/** + * @internal + * @defgroup plcrash_internal Crash Reporter Internal Documentation + */ + +/** + * @defgroup enums Enumerations + * @ingroup constants + */ + +/** + * @defgroup globals Global Variables + * @ingroup constants + */ + +/** + * @defgroup exceptions Exceptions + * @ingroup constants + */ + +/* Exceptions */ +extern NSString *PLCrashReporterException; + +/* Error Domain and Codes */ +extern NSString *PLCrashReporterErrorDomain; + +/** + * NSError codes in the Plausible Crash Reporter error domain. + * @ingroup enums + */ +typedef enum { + /** An unknown error has occured. If this + * code is received, it is a bug, and should be reported. */ + PLCrashReporterErrorUnknown = 0, + + /** An Mach or POSIX operating system error has occured. The underlying NSError cause may be fetched from the userInfo + * dictionary using the NSUnderlyingErrorKey key. */ + PLCrashReporterErrorOperatingSystem = 1, + + /** The crash report log file is corrupt or invalid */ + PLCrashReporterErrorCrashReportInvalid = 2, + + /** An attempt to use a resource which was in use at the time in a manner which would have conflicted with the request. */ + PLCrashReporterErrorResourceBusy = 3 +} PLCrashReporterError; + +/** + * @mainpage Plausible Crash Reporter + * + * @section intro_sec Introduction + * + * Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X. + * + * The following features are supported: + * + * - Implemented as an in-process signal handler. + * - Does not interfer with debugging in gdb.. + * - Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc). + * - Full thread state for all active threads (backtraces, register dumps) is provided. + * + * If your application crashes, a crash report will be written. When the application is next run, you may check for a + * pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the + * report locally. + * + * @section intro_encoding Crash Report Format + * + * Crash logs are encoded using google protobuf, and may be decoded + * using the provided PLCrashReport API. Additionally, the include plcrashutil handles conversion of binary crash reports to the + * symbolicate-compatible iPhone text format. + * + * @section doc_sections Documentation Sections + * - @subpage example_usage_iphone + * - @subpage error_handling + * - @subpage async_safety + */ + +/** + * @page example_usage_iphone Example iPhone Usage + * + * @code + * // + * // Called to handle a pending crash report. + * // + * - (void) handleCrashReport { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSData *crashData; + * NSError *error; + * + * // Try loading the crash report + * crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error]; + * if (crashData == nil) { + * NSLog(@"Could not load crash report: %@", error); + * goto finish; + * } + * + * // We could send the report from here, but we'll just print out + * // some debugging info instead + * PLCrashReport *report = [[[PLCrashReport alloc] initWithData: crashData error: &error] autorelease]; + * if (report == nil) { + * NSLog(@"Could not parse crash report"); + * goto finish; + * } + * + * NSLog(@"Crashed on %@", report.systemInfo.timestamp); + * NSLog(@"Crashed with signal %@ (code %@, address=0x%" PRIx64 ")", report.signalInfo.name, + * report.signalInfo.code, report.signalInfo.address); + * + * // Purge the report + * finish: + * [crashReporter purgePendingCrashReport]; + * return; + * } + * + * // from UIApplicationDelegate protocol + * - (void) applicationDidFinishLaunching: (UIApplication *) application { + * PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter]; + * NSError *error; + * + * // Check if we previously crashed + * if ([crashReporter hasPendingCrashReport]) + * [self handleCrashReport]; + + * // Enable the Crash Reporter + * if (![crashReporter enableCrashReporterAndReturnError: &error]) + * NSLog(@"Warning: Could not enable crash reporter: %@", error); + * + * } + * @endcode + * + */ + +/** + * @page error_handling Error Handling Programming Guide + * + * Where a method may return an error, Plausible Crash Reporter provides access to the underlying + * cause via an optional NSError argument. + * + * All returned errors will be a member of one of the below defined domains, however, new domains and + * error codes may be added at any time. If you do not wish to report on the error cause, many methods + * support a simple form that requires no NSError argument. + * + * @section error_domains Error Domains, Codes, and User Info + * + * @subsection crashreporter_errors Crash Reporter Errors + * + * Any errors in Plausible Crash Reporter use the #PLCrashReporterErrorDomain error domain, and and one + * of the error codes defined in #PLCrashReporterError. + */ + +/** + * @page async_safety Async-Safe Programming Guide + * + * Plausible CrashReporter provides support for executing an application specified function in the context of the + * crash reporter's signal handler, after the crash report has been written to disk. This was a regularly requested + * feature, and provides the ability to implement application finalization in the event of a crash. However, writing + * code intended for execution inside of a signal handler is exceptionally difficult, and is not recommended. + * + * @section program_flow Program Flow and Signal Handlers + * + * When the signal handler is called the normal flow of the program is interrupted, and your program is an unknown + * state. Locks may be held, the heap may be corrupt (or in the process of being updated), and your signal + * handler may invoke a function that was being executed at the time of the signal. This may result in deadlocks, + * data corruption, and program termination. + * + * @section functions Async-Safe Functions + * + * A subset of functions are defined to be async-safe by the OS, and are safely callable from within a signal handler. If + * you do implement a custom post-crash handler, it must be async-safe. A table of POSIX-defined async-safe functions + * and additional information is available from the + * CERT programming guide - SIG30-C + * + * Most notably, the Objective-C runtime itself is not async-safe, and Objective-C may not be used within a signal + * handler. + * + * @sa PLCrashReporter::setCrashCallbacks: + */ + +/** + * @page mach_exceptions Mach Exceptions on Mac OS X and iOS + * + * PLCrashReporter includes support for monitoring crashes via an in-process Mach exception handler. There are a small + * number of crash cases that will not be caught with via a POSIX signal handler, but can be caught via a Mach + * exception handler: + * + * - Stack overflow. sigaltstack() is broken in later iOS releases, and even if functional, must be configured + * on a per-thread basis. + * - Internal Apple assertions that call libSystem's __assert. These include compiler-checked constraints + * for built-in functions, such as strcpy_chk(). The __abort() implementation actually disables the SIGABRT + * signal handler (resetting it to SIG_DFL) prior to to issueing a SIGABRT, bypassing signal-based crash + * reporters entirely. + * + * Unfortunately, the latter issue (__assert) can not be handled on iOS; trapping abort requires that + * a Mach exception handler operate out-of-process, which is impossible on iOS. On Mac OS X, this will + * only be handled once we've implemented fully out-of-process crash excution. + * + * On Mac OS X, the Mach exception implementation is fully supported using entirely public API. On iOS, + * the APIs required are not fully public -- more details on the implications of this for exception handling on + * iOS may be found in @ref mach_exceptions_ios below. It is worth noting that even where the Mach exception APIs + * are fully supported, kernel-internal constants, as well + * as architecture-specific trap information, may be required to fully interpret a Mach exception's root cause. + * + * For example, the EXC_SOFTWARE exception is dispatched for four different failure types, using the exception + * code to differentiate failure types: + * - Non-existent system call invoked (SIGSYS) + * - Write on a pipe with no reader (SIGPIPE) + * - Abort program (SIGABRT -- unused) + * - Kill program (SIGKILL) + * + * Of those four types, only the constant required to interpret the SIGKILL behavior (EXC_SOFT_SIGNAL) is publicly defined. + * Of the remaining three failure types, the constant values are kernel implementation-private, defined only in the available + * kernel sources. On iOS, these sources are unavailable, and while they generally do match the Mac OS X implementation, there + * are no gaurantees that this is -- or will remain -- the case in the future. + * + * Likewise, interpretation of particular fault types requires information regarding the underlying machine traps + * that triggered the Mach exceptions. For example, a floating point trap on x86/x86-64 will trigger an EXC_ARITHMETIC, + * with a subcode value containing the value of the FPU status register. Determining the exact FPU cause requires + * extracting the actual exception flags from status register as per the x86 architecture documentation. The exact format + * of this subcode value is not actually documented outside the kernel, and may change in future releases. + * + * While we have the advantage of access to the x86 kernel sources, the situation on ARM is even less clear. The actual + * use of the Mach exception codes and subcodes is largely undefined by both headers and publicly available documentation, + * and the available x86 kernel sources are of little use in interpreting this data. + * + * As such, while Mach exceptions may catch some cases that BSD signals can not, they are not a perfect solution, + * and may also provide less insight into the actual failures that occur. By comparison, the BSD signal interface + * is both fully defined and architecture independent, with any necessary interpretation of the Mach exception + * codes handled in-kernel at the time of exception dispatch. It is generally recommended by Apple as the preferred + * interface, and should generally be preferred by PLCrashReporter API clients. + * + * @section mach_exceptions_compatibility Compatibility Issues + * + * @subsection Debuggers + * + * Enabling in-process Mach exception handlers will conflict with any attached debuggers; the debugger + * may suspend the processes Mach exception handling thread, which will result in any exception messages + * sent via the debugger being lost, as the in-process handler will be unable to receive and forward + * the messages. + * + * @subsection Managed Runtimes (Xamarin, Unity) + * + * A Mach exception handler may conflict with any managed runtime that registers a BSD signal handler that + * can safely handle otherwise fatal signals, allowing execution to proceed. This includes products + * such as Xamarin for iOS. + * + * In such a case, PLCrashReporter will write a crash report for non-fatal signals, as there is no + * immediate mechanism for determining whether a signal handler exists and that it can safely + * handle the failure. This can result in unexpected delays in application execution, increased I/O to + * disk, and other undesirable operations. + * + * @section mach_exceptions_ios Mach Exceptions on iOS + * + * The APIs required for Mach exception handling are not fully public on iOS. After filing a request with + * Apple DTS to clarify the status of the Mach exception APIs on iOS, and implementing a Mach Exception + * handler using only supported API, they provided the following guidance: + * + * Our engineers have reviewed your request and have determined that this would be best handled as a bug report, + * which you have already filed. There is no documented way of accomplishing this, nor is there a workaround + * possible. + * + * Due to user request, PLCrashReporter provides an optional implementation of Mach exception handling for both + * iOS and Mac OS X. + * + * This implementation uses only supported API on Mac OS X, and depends on limited undefined API on iOS. The reporter + * may be excluded entirely at build time by modifying the PLCRASH_FEATURE_MACH_EXCEPTIONS build configuration; it + * may also be disabled at runtime by configuring the PLCrashReporter instance appropriately via PLCrashReporterConfig. + * + * The iOS implementation is implemented almost entirely using public API, and links against no actual private symbols; + * the use of undocumented functionality is limited to assuming the use of specific msgh_id values (see below + * for details). As a result, it may be considered perfectly safe to include the Mach Exception code in the + * standard build, and enable/disable it at runtime. + * + * The following issues exist in the iOS implementation: + * - The msgh_id values required for an exception reply message are not available from the available + * headers and must be hard-coded. This prevents one from safely replying to exception messages, which + * means that it is impossible to (correctly) inform the server that an exception has *not* been + * handled. + * + * Impact: + * This can lead to the process locking up and not dispatching to the host exception handler (eg, Apple's + * crash reporter), depending on the behavior of the kernel exception code. + * + * - The mach_* structure/type variants required by MACH_EXCEPTION_CODES are not publicly defined (on Mac OS X, + * these are provided by mach_exc.defs). This prevents one from forwarding exception messages to an existing + * handler that was registered with a MACH_EXCEPTION_CODES behavior (eg, forwarding is entirely non-functional + * on ARM64 devices). + * + * Impact: + * This can break forwarding to any task exception handler that registers itself with MACH_EXCEPTION_CODES, + * including other handlers registered within the current process, eg, by a managed runtime. This could + * also result in misinterpretation of a Mach exception message, in the case where the message format is + * modified by Apple to be incompatible with the existing 32-bit format. + * + * This is the case with LLDB; it will register a task exception handler with MACH_EXCEPTION_CODES set. Failure + * to correctly forward these exceptions will result in the debugger breaking in interesting ways; for example, + * changes to the set of dyld-loaded images are detected by setting a breakpoint on the dyld image registration + * funtions, and this functionality will break if the exception is not correctly forwarded. + * + * Since Mach exception handling is important for a fully functional crash reporter, we have also filed a radar + * to request that the API be made public: + * Radar: rdar://12939497 RFE: Provide mach_exc.defs for iOS + * + * At the time of this writing, the radar remains open/unresolved. + */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashFeatureConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashFeatureConfig.h new file mode 100644 index 0000000..7bcaebf --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashFeatureConfig.h @@ -0,0 +1,108 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_FEATURE_CONFIG_H +#define PLCRASH_FEATURE_CONFIG_H + +#include + +/** + * @internal + * + * Build-time configuration for PLCrashReporter. + * + * This is used to automatically enable/disable features on a per-platform and per-configuration + * basis; it may also be used by third-party vendors to configure a custom build of PLCrashReporter. + * + * @defgroup build_config Build Configuration + * @ingroup constants + * @{ + */ + +/* + * Defaults + */ + +/* + * For release builds, disable unused unwind implementations on targets that do not use them. For non-release + * builds, we include the unwind implementations to allow testing on a broader range of targets. + */ +#ifdef PLCF_RELEASE_BUILD +# if defined(__arm__) +# ifndef PLCRASH_FEATURE_UNWIND_DWARF +# define PLCRASH_FEATURE_UNWIND_DWARF 0 +# endif +# ifndef PLCRASH_FEATURE_UNWIND_COMPACT +# define PLCRASH_FEATURE_UNWIND_COMPACT 0 +# endif +# endif +#endif + +/* + * Configuration Flags + */ + + +#ifndef PLCRASH_FEATURE_MACH_EXCEPTIONS +/** + * If true, enable Mach exception support. On Mac OS X, the Mach exception implementation is fully supported, + * using publicly available API. On iOS, the APIs required for a complete implementation are not public. However, a + * popular commercial crash reporter is now shipping with support for Mach exceptions, which implies that either + * they've received special dispensation to use private APIs / private structures, they've found another way to do + * it, or they're just using undocumented functionality and hoping for the best. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've enabled + * Mach exception handling by default, and provided both build-time and runtime configuration + * to disable its use. + * + * For more information on the potential issues with enabling mach exception support, @sa @ref mach_exceptions. + */ +#if TARGET_OS_TV +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 0 +#else +# define PLCRASH_FEATURE_MACH_EXCEPTIONS 1 +#endif +#endif + +#ifndef PLCRASH_FEATURE_UNWIND_DWARF +/** If true, enable DWARF unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_DWARF 1 +#endif + + +#ifndef PLCRASH_FEATURE_UNWIND_COMPACT +/** If true, enable compact unwinding support. */ +# define PLCRASH_FEATURE_UNWIND_COMPACT 1 +#endif + +/* + * @} + */ + +#endif /* PLCRASH_FEATURE_CONFIG_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashMacros.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashMacros.h new file mode 100644 index 0000000..556e1c2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashMacros.h @@ -0,0 +1,143 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PLCRASH_CONSTANTS_H +#define PLCRASH_CONSTANTS_H + +#include +#include + +#if defined(__cplusplus) +# define PLCR_EXPORT extern "C" +# define PLCR_C_BEGIN_DECLS extern "C" { +# define PLCR_C_END_DECLS } +#else +# define PLCR_EXPORT extern +# define PLCR_C_BEGIN_DECLS +# define PLCR_C_END_DECLS +#endif + +#if defined(__cplusplus) +# define NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ +# define IS_EMPTY_(name) defined(NO_OTHER_MACRO_STARTS_WITH_THIS_NAME_ ## name) +# define IS_EMPTY(name) IS_EMPTY_(name) +# if defined(PLCRASHREPORTER_PREFIX) && !IS_EMPTY(PLCRASHREPORTER_PREFIX) + /** @internal Define the plcrash namespace, automatically inserting an inline namespace containing the configured PLCRASHREPORTER_PREFIX, if any. */ +# define PLCR_CPP_BEGIN_NS namespace plcrash { inline namespace PLCRASHREPORTER_PREFIX { + + /** @internal Close the definition of the `plcrash` namespace (and the PLCRASHREPORTER_PREFIX inline namespace, if any). */ +# define PLCR_CPP_END_NS }} +# else +# define PLCR_CPP_BEGIN_NS namespace plcrash { +# define PLCR_CPP_END_NS } +# endif +#endif + +#ifdef __clang__ +# define PLCR_PRAGMA_CLANG(_p) _Pragma(_p) +#else +# define PLCR_PRAGMA_CLANG(_p) +#endif + +#ifdef __clang__ +# define PLCR_DEPRECATED __attribute__((deprecated)) +#else +# define PLCR_DEPRECATED +#endif + +#if defined(__clang__) || defined(__GNUC__) +# define PLCR_UNUSED __attribute__((unused)) +#else +# define PLCR_UNUSED +#endif + +#ifdef PLCR_PRIVATE +/** + * Marks a definition as deprecated only for for external clients, allowing + * uses of it internal fo the framework. + */ +# define PLCR_EXTERNAL_DEPRECATED + +/** + * @internal + * A macro to put above a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() \ + PLCR_PRAGMA_CLANG("clang diagnostic push"); \ + PLCR_PRAGMA_CLANG("clang diagnostic ignored \"-Wdocumentation-deprecated-sync\"") + +/** + * @internal + * A macro to put below a definition marked PLCR_EXTERNAL_DEPRECATED that will + * silence warnings about there being a deprecation documentation marker but the + * definition not being marked deprecated. + */ +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_POP() PLCR_PRAGMA_CLANG("clang diagnostic pop") + +#else + +# define PLCR_EXTERNAL_DEPRECATED PLCR_DEPRECATED +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() +# define PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH() + +#endif /* PLCR_PRIVATE */ + +#ifdef PLCR_PRIVATE +# if defined(__clang__) && __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough") +# define PLCR_FALLTHROUGH [[clang::fallthrough]] +# else +# define PLCR_FALLTHROUGH do {} while (0) +# endif +#endif + +#ifdef PLCR_PRIVATE +/** + * @internal + * Static compile-time assertion. + * + * @param name The assertion name; must be valid for use within a C identifier. + * @param cond Assertion condition + */ +# define PLCR_ASSERT_STATIC(name, cond) PLCR_ASSERT_STATIC_(name, cond, __LINE__) +/* + * C++11 and C11 both provide a static_assert(). + * + * Otherwise, we have to use typedef-based static assertions. + */ +# if (defined(__cplusplus) && __cplusplus >= 201103L) || (!defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(#name, cond) +# define PLCR_ASSERT_STATIC__(name, cond) static_assert(cond, #name) +# else +# define PLCR_ASSERT_STATIC_(name, cond, line) PLCR_ASSERT_STATIC__(name, cond, line) +# define PLCR_ASSERT_STATIC__(name, cond, line) typedef int plcf_static_assert_##name##_##line [(cond) ? 1 : -1] PLCR_UNUSED +# endif +#endif /* PLCR_PRIVATE */ + +#endif /* PLCRASH_CONSTANTS_H */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashNamespace.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashNamespace.h new file mode 100644 index 0000000..f4c263c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashNamespace.h @@ -0,0 +1,320 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/* + * For external library integrators: + * + * Set this value to any valid C symbol prefix. This will automatically + * prepend the given prefix to all external symbols in the library. + * + * This may be used to avoid symbol conflicts between multiple libraries + * that may both incorporate PLCrashReporter. + */ +// #define PLCRASHREPORTER_PREFIX AcmeCo + + +// We need two extra layers of indirection to make CPP substitute +// the PLCRASHREPORTER_PREFIX define. +#define PLNS_impl2(prefix, symbol) prefix ## symbol +#define PLNS_impl(prefix, symbol) PLNS_impl2(prefix, symbol) +#define PLNS(symbol) PLNS_impl(PLCRASHREPORTER_PREFIX, symbol) + + +/* + * Rewrite all ObjC/C symbols. + * + * For C++ symbol handling, refer to the PLCR_CPP_BEGIN_NS and PLCR_CPP_END_NS + * macros. + */ +#ifdef PLCRASHREPORTER_PREFIX + +/* Objective-C Classes */ +#define PLCrashMachExceptionServer PLNS(PLCrashMachExceptionServer) +#define PLCrashReport PLNS(PLCrashReport) +#define PLCrashReportApplicationInfo PLNS(PLCrashReportApplicationInfo) +#define PLCrashReportBinaryImageInfo PLNS(PLCrashReportBinaryImageInfo) +#define PLCrashReportExceptionInfo PLNS(PLCrashReportExceptionInfo) +#define PLCrashReportMachExceptionInfo PLNS(PLCrashReportMachExceptionInfo) +#define PLCrashReportMachineInfo PLNS(PLCrashReportMachineInfo) +#define PLCrashReportProcessInfo PLNS(PLCrashReportProcessInfo) +#define PLCrashReportProcessorInfo PLNS(PLCrashReportProcessorInfo) +#define PLCrashReportRegisterInfo PLNS(PLCrashReportRegisterInfo) +#define PLCrashReportSignalInfo PLNS(PLCrashReportSignalInfo) +#define PLCrashReportStackFrameInfo PLNS(PLCrashReportStackFrameInfo) +#define PLCrashReportSymbolInfo PLNS(PLCrashReportSymbolInfo) +#define PLCrashReportSystemInfo PLNS(PLCrashReportSystemInfo) +#define PLCrashReportTextFormatter PLNS(PLCrashReportTextFormatter) +#define PLCrashReportThreadInfo PLNS(PLCrashReportThreadInfo) +#define PLCrashReporter PLNS(PLCrashReporter) +#define PLCrashSignalHandler PLNS(PLCrashSignalHandler) +#define PLCrashHostInfo PLNS(PLCrashHostInfo) +#define PLCrashMachExceptionPort PLNS(PLCrashMachExceptionPort) +#define PLCrashMachExceptionPortSet PLNS(PLCrashMachExceptionPortSet) +#define PLCrashProcessInfo PLNS(PLCrashProcessInfo) +#define PLCrashReporterConfig PLNS(PLCrashReporterConfig) +#define PLCrashUncaughtExceptionHandler PLNS(PLCrashUncaughtExceptionHandler) +#define PLCrashReportFormatter PLNS(PLCrashReportFormatter) + +/* Public C functions */ +#define PLCrashMachExceptionForward PLNS(PLCrashMachExceptionForward) +#define PLCrashSignalHandlerForward PLNS(PLCrashSignalHandlerForward) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) + + +/* Public C global symbols */ +#define PLCrashReporterErrorDomain PLNS(PLCrashReporterErrorDomain) +#define PLCrashReportHostArchitecture PLNS(PLCrashReportHostArchitecture) +#define PLCrashReportHostOperatingSystem PLNS(PLCrashReportHostOperatingSystem) +#define PLCrashReporterException PLNS(PLCrashReporterException) + +/* For backwards compatibility, plcrash_async_byteorder vends C++ methods when included under C++. We have + * to handle this distinctly from our PLCR_CPP_BEGIN_NS C++ namespacing mechanism. */ +#define plcrash_async_byteorder PLNS(plcrash_async_byteorder) + +/* + * All private C symbols. Once these are migrated to C++, we'll be able to use the much simpler + * PLCR_CPP_BEGIN_NS machinery. + * + * This list was automatically generated (and can be updated) by setting PLCRASHREPORTER_PREFIX to 'AcmeCo', + * building the library, and executing the following: + * nm -g -U | grep '^[0-9]' | c++filt | grep -v AcmeCo | grep -E '_pl|_PL' | awk '{print $3}' | cut -c 2- | sort | uniq | awk '{print "#define",$1,"PLNS("$1")"}' + */ +#define pl_mach_thread_self PLNS(pl_mach_thread_self) +#define plcrash__architecture__descriptor PLNS(plcrash__architecture__descriptor) +#define plcrash__crash_report__application_info__descriptor PLNS(plcrash__crash_report__application_info__descriptor) +#define plcrash__crash_report__application_info__init PLNS(plcrash__crash_report__application_info__init) +#define plcrash__crash_report__binary_image__descriptor PLNS(plcrash__crash_report__binary_image__descriptor) +#define plcrash__crash_report__binary_image__init PLNS(plcrash__crash_report__binary_image__init) +#define plcrash__crash_report__descriptor PLNS(plcrash__crash_report__descriptor) +#define plcrash__crash_report__exception__descriptor PLNS(plcrash__crash_report__exception__descriptor) +#define plcrash__crash_report__exception__init PLNS(plcrash__crash_report__exception__init) +#define plcrash__crash_report__free_unpacked PLNS(plcrash__crash_report__free_unpacked) +#define plcrash__crash_report__get_packed_size PLNS(plcrash__crash_report__get_packed_size) +#define plcrash__crash_report__init PLNS(plcrash__crash_report__init) +#define plcrash__crash_report__machine_info__descriptor PLNS(plcrash__crash_report__machine_info__descriptor) +#define plcrash__crash_report__machine_info__init PLNS(plcrash__crash_report__machine_info__init) +#define plcrash__crash_report__pack PLNS(plcrash__crash_report__pack) +#define plcrash__crash_report__pack_to_buffer PLNS(plcrash__crash_report__pack_to_buffer) +#define plcrash__crash_report__process_info__descriptor PLNS(plcrash__crash_report__process_info__descriptor) +#define plcrash__crash_report__process_info__init PLNS(plcrash__crash_report__process_info__init) +#define plcrash__crash_report__processor__descriptor PLNS(plcrash__crash_report__processor__descriptor) +#define plcrash__crash_report__processor__init PLNS(plcrash__crash_report__processor__init) +#define plcrash__crash_report__processor__type_encoding__descriptor PLNS(plcrash__crash_report__processor__type_encoding__descriptor) +#define plcrash__crash_report__report_info__descriptor PLNS(plcrash__crash_report__report_info__descriptor) +#define plcrash__crash_report__report_info__init PLNS(plcrash__crash_report__report_info__init) +#define plcrash__crash_report__signal__descriptor PLNS(plcrash__crash_report__signal__descriptor) +#define plcrash__crash_report__signal__init PLNS(plcrash__crash_report__signal__init) +#define plcrash__crash_report__signal__mach_exception__descriptor PLNS(plcrash__crash_report__signal__mach_exception__descriptor) +#define plcrash__crash_report__signal__mach_exception__init PLNS(plcrash__crash_report__signal__mach_exception__init) +#define plcrash__crash_report__symbol__descriptor PLNS(plcrash__crash_report__symbol__descriptor) +#define plcrash__crash_report__symbol__init PLNS(plcrash__crash_report__symbol__init) +#define plcrash__crash_report__system_info__descriptor PLNS(plcrash__crash_report__system_info__descriptor) +#define plcrash__crash_report__system_info__init PLNS(plcrash__crash_report__system_info__init) +#define plcrash__crash_report__system_info__operating_system__descriptor PLNS(plcrash__crash_report__system_info__operating_system__descriptor) +#define plcrash__crash_report__thread__descriptor PLNS(plcrash__crash_report__thread__descriptor) +#define plcrash__crash_report__thread__init PLNS(plcrash__crash_report__thread__init) +#define plcrash__crash_report__thread__register_value__descriptor PLNS(plcrash__crash_report__thread__register_value__descriptor) +#define plcrash__crash_report__thread__register_value__init PLNS(plcrash__crash_report__thread__register_value__init) +#define plcrash__crash_report__thread__stack_frame__descriptor PLNS(plcrash__crash_report__thread__stack_frame__descriptor) +#define plcrash__crash_report__thread__stack_frame__init PLNS(plcrash__crash_report__thread__stack_frame__init) +#define plcrash__crash_report__unpack PLNS(plcrash__crash_report__unpack) +#define plcrash_async_address_apply_offset PLNS(plcrash_async_address_apply_offset) +#define plcrash_async_byteorder_big_endian PLNS(plcrash_async_byteorder_big_endian) +#define plcrash_async_byteorder_direct PLNS(plcrash_async_byteorder_direct) +#define plcrash_async_byteorder_little_endian PLNS(plcrash_async_byteorder_little_endian) +#define plcrash_async_byteorder_swapped PLNS(plcrash_async_byteorder_swapped) +#define plcrash_async_cfe_entry_apply PLNS(plcrash_async_cfe_entry_apply) +#define plcrash_async_cfe_entry_free PLNS(plcrash_async_cfe_entry_free) +#define plcrash_async_cfe_entry_init PLNS(plcrash_async_cfe_entry_init) +#define plcrash_async_cfe_entry_register_count PLNS(plcrash_async_cfe_entry_register_count) +#define plcrash_async_cfe_entry_register_list PLNS(plcrash_async_cfe_entry_register_list) +#define plcrash_async_cfe_entry_return_address_register PLNS(plcrash_async_cfe_entry_return_address_register) +#define plcrash_async_cfe_entry_stack_adjustment PLNS(plcrash_async_cfe_entry_stack_adjustment) +#define plcrash_async_cfe_entry_stack_offset PLNS(plcrash_async_cfe_entry_stack_offset) +#define plcrash_async_cfe_entry_type PLNS(plcrash_async_cfe_entry_type) +#define plcrash_async_cfe_reader_find_pc PLNS(plcrash_async_cfe_reader_find_pc) +#define plcrash_async_cfe_reader_free PLNS(plcrash_async_cfe_reader_free) +#define plcrash_async_cfe_reader_init PLNS(plcrash_async_cfe_reader_init) +#define plcrash_async_cfe_register_decode PLNS(plcrash_async_cfe_register_decode) +#define plcrash_async_cfe_register_encode PLNS(plcrash_async_cfe_register_encode) +#define plcrash_async_file_close PLNS(plcrash_async_file_close) +#define plcrash_async_file_flush PLNS(plcrash_async_file_flush) +#define plcrash_async_file_init PLNS(plcrash_async_file_init) +#define plcrash_async_file_write PLNS(plcrash_async_file_write) +#define plcrash_async_find_symbol PLNS(plcrash_async_find_symbol) +#define plcrash_async_image_containing_address PLNS(plcrash_async_image_containing_address) +#define plcrash_async_image_list_next PLNS(plcrash_async_image_list_next) +#define plcrash_async_image_list_set_reading PLNS(plcrash_async_image_list_set_reading) +#define plcrash_async_mach_exception_get_siginfo PLNS(plcrash_async_mach_exception_get_siginfo) +#define plcrash_async_macho_byteorder PLNS(plcrash_async_macho_byteorder) +#define plcrash_async_macho_contains_address PLNS(plcrash_async_macho_contains_address) +#define plcrash_async_macho_cpu_subtype PLNS(plcrash_async_macho_cpu_subtype) +#define plcrash_async_macho_cpu_type PLNS(plcrash_async_macho_cpu_type) +#define plcrash_async_macho_find_command PLNS(plcrash_async_macho_find_command) +#define plcrash_async_macho_find_segment_cmd PLNS(plcrash_async_macho_find_segment_cmd) +#define plcrash_async_macho_find_symbol_by_name PLNS(plcrash_async_macho_find_symbol_by_name) +#define plcrash_async_macho_find_symbol_by_pc PLNS(plcrash_async_macho_find_symbol_by_pc) +#define plcrash_async_macho_header PLNS(plcrash_async_macho_header) +#define plcrash_async_macho_header_size PLNS(plcrash_async_macho_header_size) +#define plcrash_async_macho_map_section PLNS(plcrash_async_macho_map_section) +#define plcrash_async_macho_map_segment PLNS(plcrash_async_macho_map_segment) +#define plcrash_async_macho_mapped_segment_free PLNS(plcrash_async_macho_mapped_segment_free) +#define plcrash_async_macho_next_command PLNS(plcrash_async_macho_next_command) +#define plcrash_async_macho_next_command_type PLNS(plcrash_async_macho_next_command_type) +#define plcrash_async_macho_string_free PLNS(plcrash_async_macho_string_free) +#define plcrash_async_macho_string_get_length PLNS(plcrash_async_macho_string_get_length) +#define plcrash_async_macho_string_get_pointer PLNS(plcrash_async_macho_string_get_pointer) +#define plcrash_async_macho_string_init PLNS(plcrash_async_macho_string_init) +#define plcrash_async_macho_symtab_reader_free PLNS(plcrash_async_macho_symtab_reader_free) +#define plcrash_async_macho_symtab_reader_init PLNS(plcrash_async_macho_symtab_reader_init) +#define plcrash_async_macho_symtab_reader_read PLNS(plcrash_async_macho_symtab_reader_read) +#define plcrash_async_macho_symtab_reader_symbol_name PLNS(plcrash_async_macho_symtab_reader_symbol_name) +#define plcrash_async_memcpy PLNS(plcrash_async_memcpy) +#define plcrash_async_memset PLNS(plcrash_async_memset) +#define plcrash_async_mobject_base_address PLNS(plcrash_async_mobject_base_address) +#define plcrash_async_mobject_free PLNS(plcrash_async_mobject_free) +#define plcrash_async_mobject_init PLNS(plcrash_async_mobject_init) +#define plcrash_async_mobject_length PLNS(plcrash_async_mobject_length) +#define plcrash_async_mobject_read_uint16 PLNS(plcrash_async_mobject_read_uint16) +#define plcrash_async_mobject_read_uint32 PLNS(plcrash_async_mobject_read_uint32) +#define plcrash_async_mobject_read_uint64 PLNS(plcrash_async_mobject_read_uint64) +#define plcrash_async_mobject_read_uint8 PLNS(plcrash_async_mobject_read_uint8) +#define plcrash_async_mobject_remap_address PLNS(plcrash_async_mobject_remap_address) +#define plcrash_async_mobject_task PLNS(plcrash_async_mobject_task) +#define plcrash_async_mobject_verify_local_pointer PLNS(plcrash_async_mobject_verify_local_pointer) +#define plcrash_async_objc_cache_free PLNS(plcrash_async_objc_cache_free) +#define plcrash_async_objc_cache_init PLNS(plcrash_async_objc_cache_init) +#define plcrash_async_objc_find_method PLNS(plcrash_async_objc_find_method) +#define plcrash_async_signal_sigcode PLNS(plcrash_async_signal_sigcode) +#define plcrash_async_signal_signame PLNS(plcrash_async_signal_signame) +#define plcrash_async_strcmp PLNS(plcrash_async_strcmp) +#define plcrash_async_strerror PLNS(plcrash_async_strerror) +#define plcrash_async_strncmp PLNS(plcrash_async_strncmp) +#define plcrash_async_symbol_cache_free PLNS(plcrash_async_symbol_cache_free) +#define plcrash_async_symbol_cache_init PLNS(plcrash_async_symbol_cache_init) +#define plcrash_async_task_memcpy PLNS(plcrash_async_task_memcpy) +#define plcrash_async_task_read_uint16 PLNS(plcrash_async_task_read_uint16) +#define plcrash_async_task_read_uint32 PLNS(plcrash_async_task_read_uint32) +#define plcrash_async_task_read_uint64 PLNS(plcrash_async_task_read_uint64) +#define plcrash_async_task_read_uint8 PLNS(plcrash_async_task_read_uint8) +#define plcrash_async_thread_state_clear_all_regs PLNS(plcrash_async_thread_state_clear_all_regs) +#define plcrash_async_thread_state_clear_reg PLNS(plcrash_async_thread_state_clear_reg) +#define plcrash_async_thread_state_clear_volatile_regs PLNS(plcrash_async_thread_state_clear_volatile_regs) +#define plcrash_async_thread_state_copy PLNS(plcrash_async_thread_state_copy) +#define plcrash_async_thread_state_current PLNS(plcrash_async_thread_state_current) +#define plcrash_async_thread_state_current_stub PLNS(plcrash_async_thread_state_current_stub) +#define plcrash_async_thread_state_get_greg_size PLNS(plcrash_async_thread_state_get_greg_size) +#define plcrash_async_thread_state_get_reg PLNS(plcrash_async_thread_state_get_reg) +#define plcrash_async_thread_state_get_reg_count PLNS(plcrash_async_thread_state_get_reg_count) +#define plcrash_async_thread_state_get_reg_name PLNS(plcrash_async_thread_state_get_reg_name) +#define plcrash_async_thread_state_get_stack_direction PLNS(plcrash_async_thread_state_get_stack_direction) +#define plcrash_async_thread_state_has_reg PLNS(plcrash_async_thread_state_has_reg) +#define plcrash_async_thread_state_init PLNS(plcrash_async_thread_state_init) +#define plcrash_async_thread_state_mach_thread_init PLNS(plcrash_async_thread_state_mach_thread_init) +#define plcrash_async_thread_state_map_dwarf_to_reg PLNS(plcrash_async_thread_state_map_dwarf_to_reg) +#define plcrash_async_thread_state_map_reg_to_dwarf PLNS(plcrash_async_thread_state_map_reg_to_dwarf) +#define plcrash_async_thread_state_mcontext_init PLNS(plcrash_async_thread_state_mcontext_init) +#define plcrash_async_thread_state_set_reg PLNS(plcrash_async_thread_state_set_reg) +#define plcrash_async_writen PLNS(plcrash_async_writen) +#define plcrash_log_writer_close PLNS(plcrash_log_writer_close) +#define plcrash_log_writer_free PLNS(plcrash_log_writer_free) +#define plcrash_log_writer_init PLNS(plcrash_log_writer_init) +#define plcrash_log_writer_set_exception PLNS(plcrash_log_writer_set_exception) +#define plcrash_log_writer_write PLNS(plcrash_log_writer_write) +#define plcrash_log_writer_set_custom_data PLNS(plcrash_log_writer_set_custom_data) +#define plcrash_nasync_image_list_append PLNS(plcrash_nasync_image_list_append) +#define plcrash_nasync_image_list_free PLNS(plcrash_nasync_image_list_free) +#define plcrash_nasync_image_list_init PLNS(plcrash_nasync_image_list_init) +#define plcrash_nasync_image_list_remove PLNS(plcrash_nasync_image_list_remove) +#define plcrash_nasync_macho_free PLNS(plcrash_nasync_macho_free) +#define plcrash_nasync_macho_init PLNS(plcrash_nasync_macho_init) +#define plcrash_populate_error PLNS(plcrash_populate_error) +#define plcrash_populate_mach_error PLNS(plcrash_populate_mach_error) +#define plcrash_populate_posix_error PLNS(plcrash_populate_posix_error) +#define plcrash_signal_handler PLNS(plcrash_signal_handler) +#define plcrash_sysctl_int PLNS(plcrash_sysctl_int) +#define plcrash_sysctl_string PLNS(plcrash_sysctl_string) +#define plcrash_sysctl_valid_utf8_bytes PLNS(plcrash_sysctl_valid_utf8_bytes) +#define plcrash_sysctl_valid_utf8_bytes_max PLNS(plcrash_sysctl_valid_utf8_bytes_max) +#define plcrash_writer_pack PLNS(plcrash_writer_pack) +#define plframe_cursor_free PLNS(plframe_cursor_free) +#define plframe_cursor_get_reg PLNS(plframe_cursor_get_reg) +#define plframe_cursor_get_regcount PLNS(plframe_cursor_get_regcount) +#define plframe_cursor_get_regname PLNS(plframe_cursor_get_regname) +#define plframe_cursor_init PLNS(plframe_cursor_init) +#define plframe_cursor_next PLNS(plframe_cursor_next) +#define plframe_cursor_next_with_readers PLNS(plframe_cursor_next_with_readers) +#define plframe_cursor_read_compact_unwind PLNS(plframe_cursor_read_compact_unwind) +#define plframe_cursor_read_dwarf_unwind PLNS(plframe_cursor_read_dwarf_unwind) +#define plframe_cursor_read_frame_ptr PLNS(plframe_cursor_read_frame_ptr) +#define plframe_cursor_thread_init PLNS(plframe_cursor_thread_init) +#define plframe_strerror PLNS(plframe_strerror) + +#endif + +/* + * The following symbols are exported by the protobuf-c library. When building + * a shared library, we can hide these as private symbols. + * + * However, when building a static library, we can only do so if we use + * MH_OBJECT "single object prelink". The MH_OBJECT approach allows us to apply + * symbol hiding/aliasing/etc similar to that supported by dylibs, but because it is + * seemingly unused within Apple, the use thereof regularly introduces linking bugs + * and errors in new Xcode releases. + * + * Rather than fighting the linker, we use the namespacing machinery to rewrite these + * symbols, but only when explicitly compiling PLCrashReporter. Since protobuf-c is a library + * that may be used elsewhere, we don't want to rewrite these symbols if they're used + * independently by PLCrashReporter API clients. + */ +#ifdef PLCR_PRIVATE + /* If no prefix has been defined, we need to specify our own private prefix */ +# ifndef PLCRASHREPORTER_PREFIX +# define PLCRASHREPORTER_PREFIX PL_ +# endif + +# define protobuf_c_buffer_simple_append PLNS(protobuf_c_buffer_simple_append) +# define protobuf_c_empty_string PLNS(protobuf_c_empty_string) +# define protobuf_c_enum_descriptor_get_value PLNS(protobuf_c_enum_descriptor_get_value) +# define protobuf_c_enum_descriptor_get_value_by_name PLNS(protobuf_c_enum_descriptor_get_value_by_name) +# define protobuf_c_message_check PLNS(protobuf_c_message_check) +# define protobuf_c_message_descriptor_get_field PLNS(protobuf_c_message_descriptor_get_field) +# define protobuf_c_message_descriptor_get_field_by_name PLNS(protobuf_c_message_descriptor_get_field_by_name) +# define protobuf_c_message_free_unpacked PLNS(protobuf_c_message_free_unpacked) +# define protobuf_c_message_get_packed_size PLNS(protobuf_c_message_get_packed_size) +# define protobuf_c_message_init PLNS(protobuf_c_message_init) +# define protobuf_c_message_pack PLNS(protobuf_c_message_pack) +# define protobuf_c_message_pack_to_buffer PLNS(protobuf_c_message_pack_to_buffer) +# define protobuf_c_message_unpack PLNS(protobuf_c_message_unpack) +# define protobuf_c_service_descriptor_get_method_by_name PLNS(protobuf_c_service_descriptor_get_method_by_name) +# define protobuf_c_service_destroy PLNS(protobuf_c_service_destroy) +# define protobuf_c_service_generated_init PLNS(protobuf_c_service_generated_init) +# define protobuf_c_service_invoke_internal PLNS(protobuf_c_service_invoke_internal) +# define protobuf_c_version PLNS(protobuf_c_version) +# define protobuf_c_version_number PLNS(protobuf_c_version_number) +#endif /* PLCR_PRIVATE */ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReport.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReport.h new file mode 100644 index 0000000..f710c3f --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReport.h @@ -0,0 +1,230 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_H +#define PLCRASH_REPORT_H + +#if __has_include() +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#else +#import "PLCrashReportApplicationInfo.h" +#import "PLCrashReportBinaryImageInfo.h" +#import "PLCrashReportExceptionInfo.h" +#import "PLCrashReportMachineInfo.h" +#import "PLCrashReportMachExceptionInfo.h" +#import "PLCrashReportProcessInfo.h" +#import "PLCrashReportProcessorInfo.h" +#import "PLCrashReportRegisterInfo.h" +#import "PLCrashReportSignalInfo.h" +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportSymbolInfo.h" +#import "PLCrashReportSystemInfo.h" +#import "PLCrashReportThreadInfo.h" +#endif + +/** + * @ingroup constants + * Crash file magic identifier */ +#define PLCRASH_REPORT_FILE_MAGIC "plcrash" + +/** + * @ingroup constants + * Crash format version byte identifier. Will not change outside of the introduction of + * an entirely new crash log format. */ +#define PLCRASH_REPORT_FILE_VERSION 1 + +/** + * @ingroup types + * Crash log file header format. + * + * Crash log files start with 7 byte magic identifier (#PLCRASH_REPORT_FILE_MAGIC), + * followed by a single unsigned byte version number (#PLCRASH_REPORT_FILE_VERSION). + * The crash log message format itself is extensible, so this version number will only + * be incremented in the event of an incompatible encoding or format change. + */ +struct PLCrashReportFileHeader { + /** Crash log magic identifier, not NULL terminated */ + const char magic[7]; + + /** Crash log encoding/format version */ + const uint8_t version; + + /** File data */ + const uint8_t data[]; +} __attribute__((packed)); + + +/** + * @internal + * Private decoder instance variables (used to hide the underlying protobuf parser). + */ +typedef struct _PLCrashReportDecoder _PLCrashReportDecoder; + +@interface PLCrashReport : NSObject { +@private + /** Private implementation variables (used to hide the underlying protobuf parser) */ + _PLCrashReportDecoder *_decoder; + + /** System info */ + __strong PLCrashReportSystemInfo *_systemInfo; + + /** Machine info */ + __strong PLCrashReportMachineInfo *_machineInfo; + + /** Application info */ + __strong PLCrashReportApplicationInfo *_applicationInfo; + + /** Process info */ + __strong PLCrashReportProcessInfo *_processInfo; + + /** Signal info */ + __strong PLCrashReportSignalInfo *_signalInfo; + + /** Mach exception info */ + __strong PLCrashReportMachExceptionInfo *_machExceptionInfo; + + /** Thread info (PLCrashReportThreadInfo instances) */ + __strong NSArray *_threads; + + /** Binary images (PLCrashReportBinaryImageInfo instances */ + __strong NSArray *_images; + + /** Exception information (may be nil) */ + __strong PLCrashReportExceptionInfo *_exceptionInfo; + + /** User defined information (may be nil) */ + __strong NSData *_customData; + + /** Report UUID */ + CFUUIDRef _uuid; +} + +- (id) initWithData: (NSData *) encodedData error: (NSError **) outError; + +- (PLCrashReportBinaryImageInfo *) imageForAddress: (uint64_t) address; + +/** + * System information. + */ +@property(nonatomic, readonly, strong) PLCrashReportSystemInfo *systemInfo; + +/** + * YES if machine information is available. + */ +@property(nonatomic, readonly) BOOL hasMachineInfo; + +/** + * Machine information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachineInfo *machineInfo; + +/** + * Application information. + */ +@property(nonatomic, readonly, strong) PLCrashReportApplicationInfo *applicationInfo; + +/** + * YES if process information is available. + */ +@property(nonatomic, readonly) BOOL hasProcessInfo; + +/** + * Process information. Only available in later (v1.1+) crash report format versions. If not available, + * will be nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessInfo *processInfo; + +/** + * Signal information. This provides the signal and signal code of the fatal signal. + */ +@property(nonatomic, readonly, strong) PLCrashReportSignalInfo *signalInfo; + +/** + * Mach exception information, if available. This will only be included in the + * case that encoding crash reporter's exception-based reporting was enabled, and a Mach + * exception was caught. + * + * @warning If Mach exception information is available, the legacy signalInfo property will also be provided; this + * s required to maintain backwards compatibility with the established API. Note, however, that the signal info may be derived from the + * Mach exception info by the encoding crash reporter, and thus may not exactly match the kernel exception-to-signal + * mappings implemented in xnu. As such, when Mach exception info is available, its use should be preferred. + */ +@property(nonatomic, readonly, strong) PLCrashReportMachExceptionInfo *machExceptionInfo; + +/** + * Thread information. Returns a list of PLCrashReportThreadInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *threads; + +/** + * Binary image information. Returns a list of PLCrashReportBinaryImageInfo instances. + */ +@property(nonatomic, readonly, strong) NSArray *images; + +/** + * YES if exception information is available. + */ +@property(nonatomic, readonly) BOOL hasExceptionInfo; + +/** + * Exception information. Only available if a crash was caused by an uncaught exception, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) PLCrashReportExceptionInfo *exceptionInfo; + +/** + * Custom user data. Only available if user explicitly assigned it before crash happened, + * otherwise nil. + */ +@property(nonatomic, readonly, strong) NSData *customData; + +/** + * A client-generated 16-byte UUID. May be used to filter duplicate reports submitted or generated + * by a single client. Only available in later (v1.2+) crash report format versions. If not available, + * will be NULL. + */ +@property(nonatomic, readonly) CFUUIDRef uuidRef; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h new file mode 100644 index 0000000..787a286 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportApplicationInfo.h @@ -0,0 +1,62 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportApplicationInfo : NSObject { +@private + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; +} + +- (id) initWithApplicationIdentifier: (NSString *) applicationIdentifier + applicationVersion: (NSString *) applicationVersion + applicationMarketingVersion: (NSString *) applicationMarketingVersion; + +/** + * The application identifier. This is usually the application's CFBundleIdentifier value. + */ +@property(nonatomic, readonly, strong) NSString *applicationIdentifier; + +/** + * The application version. This is usually the application's CFBundleVersion value. + */ +@property(nonatomic, readonly, strong) NSString *applicationVersion; + +/** + * The application marketing version. This is usually the application's CFBundleShortVersionString value if available. May be nil. + */ +@property(nonatomic, readonly, strong) NSString *applicationMarketingVersion; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h new file mode 100644 index 0000000..1a75051 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportBinaryImageInfo.h @@ -0,0 +1,95 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportBinaryImageInfo : NSObject { +@private + /** Code type */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /** Base image address */ + uint64_t _baseAddress; + + /** Image segment size */ + uint64_t _imageSize; + + /** Name of binary image */ + __strong NSString *_imageName; + + /** If the UUID is available */ + BOOL _hasImageUUID; + + /** 128-bit object UUID. May be nil. */ + __strong NSString *_imageUUID; +} + +- (id) initWithCodeType: (PLCrashReportProcessorInfo *) processorInfo + baseAddress: (uint64_t) baseAddress + size: (uint64_t) imageSize + name: (NSString *) imageName + uuid: (NSData *) uuid; + +/** + * Image code type, or nil if unavailable. + */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *codeType; + +/** + * Image base address. + */ +@property(nonatomic, readonly) uint64_t imageBaseAddress; + +/** + * Segment size. + */ +@property(nonatomic, readonly) uint64_t imageSize; + +/** + * Image name (absolute path) + */ +@property(nonatomic, readonly, strong) NSString *imageName; + + +/** + * YES if this image has an associated UUID. + */ +@property(nonatomic, readonly) BOOL hasImageUUID; + +/** + * 128-bit object UUID (matches Mach-O DWARF dSYM files). May be nil if unavailable. + */ +@property(nonatomic, readonly, strong) NSString *imageUUID; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h new file mode 100644 index 0000000..7423ca9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportExceptionInfo.h @@ -0,0 +1,69 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportThreadInfo.h" +#endif + +@interface PLCrashReportExceptionInfo : NSObject { +@private + /** Name */ + __strong NSString *_name; + + /** Reason */ + __strong NSString *_reason; + + /** Ordered list of PLCrashReportStackFrame instances, or nil if unavailable. */ + __strong NSArray *_stackFrames; +} + +- (id) initWithExceptionName: (NSString *) name reason: (NSString *) reason; + +- (id) initWithExceptionName: (NSString *) name + reason: (NSString *) reason + stackFrames: (NSArray *) stackFrames; + +/** + * The exception name. + */ +@property(nonatomic, readonly, strong) NSString *exceptionName; + +/** + * The exception reason. + */ +@property(nonatomic, readonly, strong) NSString *exceptionReason; + +/* The exception's original call stack, as an array of PLCrashReportStackFrameInfo instances, or nil if unavailable. + * This may be preserved across rethrow of an exception, and can be used to determine the original call stack. */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportFormatter.h new file mode 100644 index 0000000..5cdf01b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportFormatter.h @@ -0,0 +1,55 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReport.h" +#endif + +/** + * A crash report formatter accepts a PLCrashReport instance, formats it according to implementation-specified rules, + * (such as implementing text output support), and returns the result. + */ +@protocol PLCrashReportFormatter + +/** + * Format the provided @a report. + * + * @param report Report to be formatted. + * @param outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error + * object indicating why the pending crash report could not be formatted. If no error occurs, this parameter will + * be left unmodified. You may specify nil for this parameter, and no error information will be provided. + * + * @return Returns the formatted report data on success, or nil on failure. + */ +- (NSData *) formatReport: (PLCrashReport *) report error: (NSError **) outError; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h new file mode 100644 index 0000000..19461a5 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportMachExceptionInfo.h @@ -0,0 +1,48 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportMachExceptionInfo : NSObject { +@private + /** The Mach exception type. */ + uint64_t _type; + + /** The Mach exception codes, represented as an ordered array of NSNumber instances. */ + __strong NSArray *_codes; +} + +- (id) initWithType: (uint64_t) type codes: (NSArray *) codes; + +/** The Mach exception type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The Mach exception codes, represented as an ordered array of 64-bit unsigned NSNumber instances. */ +@property(nonatomic, readonly, strong) NSArray *codes; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h new file mode 100644 index 0000000..ab6fee9 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportMachineInfo.h @@ -0,0 +1,77 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportProcessorInfo.h" +#endif + +@interface PLCrashReportMachineInfo : NSObject { +@private + /** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ + __strong NSString *_modelName; + + /** The processor type. */ + __strong PLCrashReportProcessorInfo *_processorInfo; + + /* The number of actual physical processor cores. */ + NSUInteger _processorCount; + + /* The number of logical processors. */ + NSUInteger _logicalProcessorCount; +} + +- (id) initWithModelName: (NSString *) modelName + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + processorCount: (NSUInteger) processorCount + logicalProcessorCount: (NSUInteger) logicalProcessorCount; + +/** The hardware model name (eg, MacBookPro6,1). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *modelName; + +/** The processor type. This will be unavailable in reports generated prior to PLCrashReporter 1.2, in which case this property will be nil. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +/* + * The number of actual physical processor cores. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger processorCount; + +/* + * The number of logical processors. Note that the number of active processors may be managed by the + * operating system's power management system, and this value may not reflect the number of active + * processors at the time of the crash. + */ +@property(nonatomic, readonly) NSUInteger logicalProcessorCount; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h new file mode 100644 index 0000000..802e8d4 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportProcessInfo.h @@ -0,0 +1,103 @@ +/* + * Author: Damian Morris + * + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * Copyright (c) 2010-2013 Plausible Labs Cooperative, Inc. + * + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportProcessInfo : NSObject { +@private + /** Process name, or nil if unavailable. */ + __strong NSString *_processName; + + /** Process ID */ + NSUInteger _processID; + + /** Process path */ + __strong NSString* _processPath; + + /** Date and time that the crashing process was started. This may be unavailable, and this property + * will be nil. */ + __strong NSDate *_processStartTime; + + /** Parent process name, or nil if unavailable. */ + __strong NSString *_parentProcessName; + + /** Parent process ID */ + NSUInteger _parentProcessID; + + /** If false, the process is being run via process-level CPU emulation (such as Rosetta). */ + BOOL _native; +} + +- (id) initWithProcessName: (NSString *) processName + processID: (NSUInteger) processID + processPath: (NSString *) processPath + processStartTime: (NSDate *) processStartTime + parentProcessName: (NSString *) parentProcessName + parentProcessID: (NSUInteger) parentProcessID + native: (BOOL) native; + +/** + * The process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processName; + +/** + * The process ID. + */ +@property(nonatomic, readonly) NSUInteger processID; + +/** + * The path to the process executable. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *processPath; + +/** + * Date and time that the crashing process was started. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSDate *processStartTime; + +/** + * The parent process name. This value may not be included in the crash report, in which case this property + * will be nil. + */ +@property(nonatomic, readonly, strong) NSString *parentProcessName; + +/** + * The parent process ID. + */ +@property(nonatomic, readonly) NSUInteger parentProcessID; + +/** The process' native execution status. If false, the process is being run via process-level CPU emulation (such as Rosetta). */ +@property(nonatomic, readonly) BOOL native; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h new file mode 100644 index 0000000..03d570b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportProcessorInfo.h @@ -0,0 +1,74 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +/** + * @ingroup constants + * + * The type encodings supported for CPU types and subtypes. Currently only Apple + * Mach-O defined encodings are supported. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Unknown cpu type encoding. */ + PLCrashReportProcessorTypeEncodingUnknown = 0, + + /** Apple Mach-defined processor types. */ + PLCrashReportProcessorTypeEncodingMach = 1 +} PLCrashReportProcessorTypeEncoding; + +@interface PLCrashReportProcessorInfo : NSObject { +@private + /** Type encoding */ + PLCrashReportProcessorTypeEncoding _typeEncoding; + + /** CPU type */ + uint64_t _type; + + /** CPU subtype */ + uint64_t _subtype; +} + +- (id) initWithTypeEncoding: (PLCrashReportProcessorTypeEncoding) typeEncoding + type: (uint64_t) type + subtype: (uint64_t) subtype; + +/** The CPU type encoding. */ +@property(nonatomic, readonly) PLCrashReportProcessorTypeEncoding typeEncoding; + +/** The CPU type. */ +@property(nonatomic, readonly) uint64_t type; + +/** The CPU subtype. */ +@property(nonatomic, readonly) uint64_t subtype; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h new file mode 100644 index 0000000..e0a1ca1 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportRegisterInfo.h @@ -0,0 +1,52 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportRegisterInfo : NSObject { +@private + /** Register name */ + __strong NSString *_registerName; + + /** Register value */ + uint64_t _registerValue; +} + +- (id) initWithRegisterName: (NSString *) registerName registerValue: (uint64_t) registerValue; + +/** + * Register name. + */ +@property(nonatomic, readonly, strong) NSString *registerName; + +/** + * Register value. + */ +@property(nonatomic, readonly) uint64_t registerValue; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h new file mode 100644 index 0000000..d949211 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSignalInfo.h @@ -0,0 +1,60 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSignalInfo : NSObject { +@private + /** Signal name */ + __strong NSString *_name; + + /** Signal code */ + __strong NSString *_code; + + /** Fauling instruction or address */ + uint64_t _address; +} + +- (id) initWithSignalName: (NSString *) name code: (NSString *) code address: (uint64_t) address; + +/** + * The signal name. + */ +@property(nonatomic, readonly, strong) NSString *name; + +/** + * The signal code. + */ +@property(nonatomic, readonly, strong) NSString *code; + +/** + * The faulting instruction or address. + */ +@property(nonatomic, readonly) uint64_t address; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h new file mode 100644 index 0000000..5fd4acc --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportStackFrameInfo.h @@ -0,0 +1,57 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportSymbolInfo.h" +#endif + +@interface PLCrashReportStackFrameInfo : NSObject { +@private + /** Frame instruction pointer. */ + uint64_t _instructionPointer; + + /** Symbol information, if available. Otherwise, will be nil. */ + __strong PLCrashReportSymbolInfo *_symbolInfo; +} + +- (id) initWithInstructionPointer: (uint64_t) instructionPointer symbolInfo: (PLCrashReportSymbolInfo *) symbolInfo; + +/** + * Frame's instruction pointer. + */ +@property(nonatomic, readonly) uint64_t instructionPointer; + +/** Symbol information for this frame. + * This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly) PLCrashReportSymbolInfo *symbolInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h new file mode 100644 index 0000000..bdb367c --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSymbolInfo.h @@ -0,0 +1,61 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2012-2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +@interface PLCrashReportSymbolInfo : NSObject { +@private + /** The symbol name. */ + __strong NSString *_symbolName; + + /** The symbol start address. */ + uint64_t _startAddress; + + /** The symbol end address, if explicitly defined. Will be 0 if unknown. */ + uint64_t _endAddress; +} + +- (id) initWithSymbolName: (NSString *) symbolName + startAddress: (uint64_t) startAddress + endAddress: (uint64_t) endAddress; + +/** The symbol name. */ +@property(nonatomic, readonly, strong) NSString *symbolName; + +/** The symbol start address. */ +@property(nonatomic, readonly) uint64_t startAddress; + +/* The symbol end address, if explicitly defined. This will only be included if the end address is + * explicitly defined (eg, by DWARF debugging information), will not be derived by best-guess + * heuristics. + * + * If unknown, the address will be 0. + */ +@property(nonatomic, readonly) uint64_t endAddress; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h new file mode 100644 index 0000000..eb8a447 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportSystemInfo.h @@ -0,0 +1,177 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashMacros.h" +#endif + +@class PLCrashReportProcessorInfo; + +/** + * @ingroup constants + * + * Indicates the Operating System under which a Crash Log was generated. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** Mac OS X. */ + PLCrashReportOperatingSystemMacOSX = 0, + + /** iPhone OS */ + PLCrashReportOperatingSystemiPhoneOS = 1, + + /** iPhone Simulator (Mac OS X with additional simulator-specific runtime libraries) */ + PLCrashReportOperatingSystemiPhoneSimulator = 2, + + /** Unknown operating system */ + PLCrashReportOperatingSystemUnknown = 3, + + /** Apple tvOS */ + PLCrashReportOperatingSystemAppleTVOS = 4, + +} PLCrashReportOperatingSystem; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** + * @ingroup constants + * + * Indicates the architecture under which a Crash Log was generated. + * + * @note The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * will make use of the new PLCrashReportProcessorInfo CPU type encodings. + * + * @internal + * These enum values match the protobuf values. Keep them synchronized. + */ +typedef enum { + /** x86-32. */ + PLCrashReportArchitectureX86_32 = 0, + + /** x86-64 */ + PLCrashReportArchitectureX86_64 = 1, + + /** ARMv6 */ + PLCrashReportArchitectureARMv6 = 2, + + /** + * ARMv6 + * @deprecated This value has been deprecated in favor of ARM subtype-specific + * values. + * @sa PLCrashReportArchitectureARMv6 + */ + PLCrashReportArchitectureARM PLCR_DEPRECATED = PLCrashReportArchitectureARMv6, + + /** PPC */ + PLCrashReportArchitecturePPC = 3, + + /** PPC64 */ + PLCrashReportArchitecturePPC64 = 4, + + /** ARMv7 */ + PLCrashReportArchitectureARMv7 = 5, + + /** Unknown */ + PLCrashReportArchitectureUnknown = 6 +} PLCrashReportArchitecture; +#pragma clang diagnostic pop + +extern PLCrashReportOperatingSystem PLCrashReportHostOperatingSystem; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); +extern PLCrashReportArchitecture PLCrashReportHostArchitecture PLCR_EXTERNAL_DEPRECATED; +PLCR_EXTERNAL_DEPRECATED_NOWARN_PUSH(); + +@interface PLCrashReportSystemInfo : NSObject { +@private + /** Operating system */ + PLCrashReportOperatingSystem _operatingSystem; + + /** Operating system version */ + __strong NSString *_osVersion; + + /** OS build. May be nil. */ + __strong NSString *_osBuild; + + /** Architecture */ + PLCrashReportArchitecture _architecture; + + /** Date crash report was generated. May be nil if the date is unknown. */ + __strong NSDate *_timestamp; + + /** Processor information. */ + __strong PLCrashReportProcessorInfo *_processorInfo; +} + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + timestamp: (NSDate *) timestamp PLCR_DEPRECATED; + +- (id) initWithOperatingSystem: (PLCrashReportOperatingSystem) operatingSystem + operatingSystemVersion: (NSString *) operatingSystemVersion + operatingSystemBuild: (NSString *) operatingSystemBuild + architecture: (PLCrashReportArchitecture) architecture + processorInfo: (PLCrashReportProcessorInfo *) processorInfo + timestamp: (NSDate *) timestamp; + +/** The operating system. */ +@property(nonatomic, readonly) PLCrashReportOperatingSystem operatingSystem; + +/** The operating system's release version. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemVersion; + +/** The operating system's build identifier (eg, 10J869). This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSString *operatingSystemBuild; + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation-deprecated-sync" +/** Architecture. @deprecated The architecture value has been deprecated in v1.1 and later crash reports. All new reports + * include the CPU type as part of the crash report's machine info structure, using the PLCrashReportProcessorInfo + * extensible encoding. */ +@property(nonatomic, readonly) PLCrashReportArchitecture architecture PLCR_DEPRECATED; + +/** Date and time that the crash report was generated. This may be unavailable, and this property will be nil. */ +@property(nonatomic, readonly, strong) NSDate *timestamp; + +/** The processor type. For v1.2 reports and later, this is an alias to the machine info's processorInfo. + * For earlier reports, this will be synthesized from the deprecated architecture property. */ +@property(nonatomic, readonly, strong) PLCrashReportProcessorInfo *processorInfo; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h new file mode 100644 index 0000000..adbc251 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportTextFormatter.h @@ -0,0 +1,66 @@ +/* + * Authors: + * Landon Fuller + * Damian Morris + * + * Copyright (c) 2008-2013 Plausible Labs Cooperative, Inc. + * Copyright (c) 2010 MOSO Corporation, Pty Ltd. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + + +#import + +#if __has_include() +#import +#else +#import "PLCrashReportFormatter.h" +#endif + +/** + * Supported text output formats. + * + * @ingroup enums + */ +typedef enum { + /** An iOS-compatible crash log text format. Compatible with the crash logs generated by the device and available + * through iTunes Connect. */ + PLCrashReportTextFormatiOS = 0 +} PLCrashReportTextFormat; + + +@interface PLCrashReportTextFormatter : NSObject { +@private + /** Text output format. */ + PLCrashReportTextFormat _textFormat; + + /** Encoding to use for string output. */ + NSStringEncoding _stringEncoding; +} + ++ (NSString *) stringValueForCrashReport: (PLCrashReport *) report withTextFormat: (PLCrashReportTextFormat) textFormat; + +- (id) initWithTextFormat: (PLCrashReportTextFormat) textFormat stringEncoding: (NSStringEncoding) stringEncoding; + +@end diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h new file mode 100644 index 0000000..b9092e2 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReportThreadInfo.h @@ -0,0 +1,88 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#ifndef PLCRASH_REPORT_THREAD_INFO_H +#define PLCRASH_REPORT_THREAD_INFO_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReportStackFrameInfo.h" +#import "PLCrashReportRegisterInfo.h" +#endif + + +@interface PLCrashReportThreadInfo : NSObject { +@private + /** The thread number. Should be unique within a given crash log. */ + NSInteger _threadNumber; + + /** Ordered list of PLCrashReportStackFrame instances */ + __strong NSArray *_stackFrames; + + /** YES if this thread crashed. */ + BOOL _crashed; + + /** List of PLCrashReportRegister instances. Will be empty if _crashed is NO. */ + __strong NSArray *_registers; +} + +- (id) initWithThreadNumber: (NSInteger) threadNumber + stackFrames: (NSArray *) stackFrames + crashed: (BOOL) crashed + registers: (NSArray *) registers; + +/** + * Application thread number. + */ +@property(nonatomic, readonly) NSInteger threadNumber; + +/** + * Thread backtrace. Provides an array of PLCrashReportStackFrameInfo instances. + * The array is ordered, last callee to first. + */ +@property(nonatomic, readonly, strong) NSArray *stackFrames; + +/** + * If this thread crashed, set to YES. + */ +@property(nonatomic, readonly) BOOL crashed; + +/** + * State of the general purpose and related registers, as a list of + * PLCrashReportRegister instances. If this thead did not crash (crashed returns NO), + * this list will be empty. + */ +@property(nonatomic, readonly, strong) NSArray *registers; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReporter.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReporter.h new file mode 100644 index 0000000..bdc8f83 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReporter.h @@ -0,0 +1,159 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2008-2009 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import +#import + +#ifndef PLCRASH_REPORTER_H +#define PLCRASH_REPORTER_H + +#if __has_include() +#import +#import +#else +#import "PLCrashReporterConfig.h" +#import "PLCrashMacros.h" +#endif + +@class PLCrashMachExceptionServer; +@class PLCrashMachExceptionPortSet; + +/** + * @ingroup functions + * + * Prototype of a callback function used to execute additional user code with signal information as provided + * by PLCrashReporter. Called upon completion of crash handling, after the crash report has been written to disk. + * + * @param info The signal info. + * @param uap The crash's threads context. + * @param context The API client's supplied context value. + * + * @sa The @ref async_safety documentation. + * @sa PLCrashReporter::setPostCrashCallbacks: + */ +typedef void (*PLCrashReporterPostCrashSignalCallback)(siginfo_t *info, ucontext_t *uap, void *context); + +/** + * @ingroup types + * + * This structure contains callbacks supported by PLCrashReporter to allow the host application to perform + * additional tasks prior to program termination after a crash has occurred. + * + * @sa The @ref async_safety documentation. + */ +typedef struct PLCrashReporterCallbacks { + /** The version number of this structure. If not one of the defined version numbers for this type, the behavior + * is undefined. The current version of this structure is 0. */ + uint16_t version; + + /** An arbitrary user-supplied context value. This value may be NULL. */ + void *context; + + /** + * The callback used to report caught signal information. In version 0 of this structure, all crashes will be + * reported via this function. + * + * @warning When using PLCrashReporterSignalHandlerTypeMach, the siginfo_t argument to this function will be derived + * from the Mach exception data, and may be incorrect, or may otherwise not match the expected data as provided via + * PLCrashReporterSignalHandlerTypeBSD. In addition, the provided ucontext_t value will be zero-initialized, and will + * not provide valid thread state. + * + * This callback will be deprecated in favor of a Mach-compatible replacement in a future release; support is maintained + * here to allow clients that rely on post-crash callbacks without thread state to make use of Mach exceptions. + */ + PLCrashReporterPostCrashSignalCallback handleSignal; +} PLCrashReporterCallbacks; + +@interface PLCrashReporter : NSObject { +@private + /** Reporter configuration */ + __strong PLCrashReporterConfig *_config; + + /** YES if the crash reporter has been enabled */ + BOOL _enabled; + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** The backing Mach exception server, if any. Nil if the reporter has not been enabled, or if + * the configured signal handler type is not PLCrashReporterSignalHandlerTypeMach. */ + __strong PLCrashMachExceptionServer *_machServer; + + /** Previously registered Mach exception ports, if any. */ + __strong PLCrashMachExceptionPortSet *_previousMachPorts; +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ + + /** Application identifier */ + __strong NSString *_applicationIdentifier; + + /** Application version */ + __strong NSString *_applicationVersion; + + /** Application marketing version */ + __strong NSString *_applicationMarketingVersion; + + /** Path to the crash reporter internal data directory */ + __strong NSString *_crashReportDirectory; +} + ++ (PLCrashReporter *) sharedReporter PLCR_DEPRECATED; + +- (instancetype) initWithConfiguration: (PLCrashReporterConfig *) config; + +- (BOOL) hasPendingCrashReport; + +- (NSData *) loadPendingCrashReportData; +- (NSData *) loadPendingCrashReportDataAndReturnError: (NSError **) outError; + +- (NSData *) generateLiveReportWithThread: (thread_t) thread; +- (NSData *) generateLiveReportWithThread: (thread_t) thread error: (NSError **) outError; +- (NSData *) generateLiveReportWithThread: (thread_t) thread exception: (NSException *) exception error: (NSError **) outError; + +- (NSData *) generateLiveReport; +- (NSData *) generateLiveReportAndReturnError: (NSError **) outError; +- (NSData *) generateLiveReportWithException: (NSException *) exception error: (NSError **) outError; + +- (BOOL) purgePendingCrashReport; +- (BOOL) purgePendingCrashReportAndReturnError: (NSError **) outError; + +- (BOOL) enableCrashReporter; +- (BOOL) enableCrashReporterAndReturnError: (NSError **) outError; + +- (void) setCrashCallbacks: (PLCrashReporterCallbacks *) callbacks; + +/** + * Return the path to live crash report (which may not yet, or ever, exist). + */ +- (NSString *) crashReportPath; + +/** + * Custom data to save in the crash report. + */ +@property(nonatomic, strong) NSData *customData; + +@end + +#endif diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReporterConfig.h b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReporterConfig.h new file mode 100644 index 0000000..f151e56 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Headers/PLCrashReporterConfig.h @@ -0,0 +1,197 @@ +/* + * Author: Landon Fuller + * + * Copyright (c) 2013 Plausible Labs Cooperative, Inc. + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +#import + +#if __has_include() +#import +#else +#import "PLCrashFeatureConfig.h" +#endif + +/** + * @ingroup enums + * Supported mechanisms for trapping and handling crashes. + */ +typedef NS_ENUM(NSUInteger, PLCrashReporterSignalHandlerType) { + /** + * Trap fatal signals via a sigaction(2)-registered BSD signal handler. + * + * PLCrashReporter's signal handler will supersede previously registered handlers; existing + * handlers will not be called. This behavior may be modified in a future release, and should + * not be relied upon as a mechanism to prevent existing signal handlers from being called. + * + * There are some limitations to signal-based crash handling on Mac OS X and iOS; specifically: + * + * - On Mac OS X, stack overflows will only be handled on the thread on which + * the crash reporter was initialized. This should generally be the main thread. + * - On iOS 6.0 and later, any stack overflows will not be handled due to sigaltstack() being + * non-functional on the device. (see rdar://13002712 - SA_ONSTACK/sigaltstack() ignored on iOS). + * - Some exit paths in Apple's Libc will deregister a signal handler before firing SIGABRT, resulting + * in the signal handler never being called (see rdar://14313497 - ___abort() disables SIGABRT signal + * handlers prior to raising SIGABRT). These __abort()-based checks are: + * - Implemented for unsafe memcpy/strcpy/snprintf C functions. + * - Only enabled when operating on a fixed-width target buffer (in which case the + * compiler rewrites the function calls to the built-in variants, and provides the fixed-width length as an argument). + * - Only trigger in the case that the source data exceeds the size of the fixed width target + * buffer, and the maximum length argument either isn't supplied by the caller (eg, when using strcpy), + * or a too-long argument is supplied (eg, strncpy with a length argument longer than the target buffer), + * AND that argument can't be checked at compile-time. + */ + PLCrashReporterSignalHandlerTypeBSD = 0, + +#if PLCRASH_FEATURE_MACH_EXCEPTIONS + /** + * Trap fatal signals via a Mach exception server. + * + * If any existing Mach exception server has been registered for the task, exceptions will be forwarded to that + * exception handler. Should the exceptions be handled by an existing handler, no report will be generated + * by PLCrashReporter. + * + * @par Mac OS X + * + * On Mac OS X, the Mach exception implementation is fully supported, using publicly available API -- note, + * however, that some kernel-internal constants, as well as architecture-specific trap information, + * may be required to fully interpret a Mach exception's root cause. + * + * @par iOS + * + * On iOS, the APIs required for a complete implementation are not fully public. + * + * The exposed surface of undocumented API usage is relatively low, and there has been strong user demand to + * implement Mach exception handling regardless of concerns over API visiblity. Given this, we've included + * Mach exception handling as an optional feature, with both build-time and runtime configuration + * to disable its inclusion or use, respectively. + * + * @par Debugger Incompatibility + * + * The Mach exception handler executes in-process, and will interfere with debuggers when they attempt to + * suspend all active threads (which will include the Mach exception handler). Mach-based handling + * should not be used when a debugger is attached. + * + * @par More Details + * + * For more information, refer to @ref mach_exceptions. + */ + PLCrashReporterSignalHandlerTypeMach = 1 +#endif /* PLCRASH_FEATURE_MACH_EXCEPTIONS */ +}; + +/** + * @ingroup enums + * Supported mechanisms for performing local symbolication. + * + * Local symbolication is performed using inexact heuristics and symbol data available at runtime; it may + * return information that is incorrect. This may still be useful in the case where DWARF data is unavailable + * for a given build; in that case, it can provide function and method names (though not line numbers) for a + * crash report that may otherwise be unusable. + * + * Note, however, this comes at the cost of a significant increase in code that must run within the critical + * crash reporting section, where failures may result in crash reports being corrupted or left unwritten. In + * addition, some of the provided symbolication strategies rely on knowledge of runtime internals that may + * change in future iOS releases. Given that DWARF symbolication data will always be more accurate, and + * the risks inherent in executing considerably more code at crash time, it is strongly recommended that local + * symbolication only be enabled for non-release builds. + * + * Multiple symbolication strategies may be enabled, in which case a best-match heuristic will be applied to the + * results. + */ +typedef NS_OPTIONS(NSUInteger, PLCrashReporterSymbolicationStrategy) { + /** No symbolication. */ + PLCrashReporterSymbolicationStrategyNone = 0, + + /** + * Use the standard binary symbol table. On iOS, this alone will return + * incomplete results, as most symbols are rewritten to the common '\' string. + */ + PLCrashReporterSymbolicationStrategySymbolTable = 1 << 0, + + /** + * Use Objective-C metadata to find method and class names. This relies on detailed parsing + * of the Objective-C runtime data, including undefined flags and other runtime internals. As such, + * it may return incorrect data should the runtime be changed incompatibly. + */ + PLCrashReporterSymbolicationStrategyObjC = 1 << 1, + + /** + * Enable all available symbolication strategies. + */ + PLCrashReporterSymbolicationStrategyAll = (PLCrashReporterSymbolicationStrategySymbolTable|PLCrashReporterSymbolicationStrategyObjC) +}; + +@interface PLCrashReporterConfig : NSObject { +@private + /** The configured signal handler type. */ + PLCrashReporterSignalHandlerType _signalHandlerType; + + /** The configured symbolication strategy. */ + PLCrashReporterSymbolicationStrategy _symbolicationStrategy; + + /** + * Flag indicating if the uncaughtExceptionHandler should be initialized or not. It usually is, except in a + * Xamarin environment. + */ + BOOL _shouldRegisterUncaughtExceptionHandler; +} + ++ (instancetype) defaultConfiguration; + +- (instancetype) init; + +- (instancetype) initWithBasePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + basePath: (NSString *) basePath; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler; + +- (instancetype) initWithSignalHandlerType: (PLCrashReporterSignalHandlerType) signalHandlerType + symbolicationStrategy: (PLCrashReporterSymbolicationStrategy) symbolicationStrategy + shouldRegisterUncaughtExceptionHandler: (BOOL) shouldRegisterUncaughtExceptionHandler + basePath: (NSString *) basePath; + +/** The base path to save the crash data. */ +@property(nonatomic, readonly) NSString *basePath; + +/** The configured signal handler type. */ +@property(nonatomic, readonly) PLCrashReporterSignalHandlerType signalHandlerType; + +/** The configured symbolication strategy. */ +@property(nonatomic, readonly) PLCrashReporterSymbolicationStrategy symbolicationStrategy; + +/** Should PLCrashReporter regiser an uncaught exception handler? This is entended to be used in Xamarin apps */ +@property(nonatomic, readonly) BOOL shouldRegisterUncaughtExceptionHandler; + +@end + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Info.plist b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Info.plist new file mode 100644 index 0000000..613dabd Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Info.plist differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Modules/module.modulemap b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Modules/module.modulemap new file mode 100644 index 0000000..4fa4304 --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/Modules/module.modulemap @@ -0,0 +1,8 @@ +framework module CrashReporter { + umbrella header "CrashReporter.h" + + export * + module * { export * } + + link framework "Foundation" +} diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeDirectory b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeDirectory new file mode 100644 index 0000000..25e0db7 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeDirectory differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeRequirements b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeRequirements new file mode 100644 index 0000000..dbf9d61 Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeRequirements differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeRequirements-1 b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeRequirements-1 new file mode 100644 index 0000000..2650aab Binary files /dev/null and b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeRequirements-1 differ diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeResources b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeResources new file mode 100644 index 0000000..1e8e62b --- /dev/null +++ b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeResources @@ -0,0 +1,447 @@ + + + + + files + + Headers/CrashReporter.h + + oU1aDvwwGfw5VO+AJWhXmX6M0h0= + + Headers/PLCrashFeatureConfig.h + + n52MK11FnpreEtuoKRTG8TrBOA8= + + Headers/PLCrashMacros.h + + EgfEfSDoo+ipdGXg9d2sqTsTOgc= + + Headers/PLCrashNamespace.h + + iju+4ZZz8ziKAwQQqdBZLrALkGw= + + Headers/PLCrashReport.h + + Gy6IE4DKfujVP4s/bfcPp+TnPZw= + + Headers/PLCrashReportApplicationInfo.h + + rCQLAtwJCv/srYztEH5cfECm8nU= + + Headers/PLCrashReportBinaryImageInfo.h + + H6EGcFdy29+0QvrKgqdM4zWMnOk= + + Headers/PLCrashReportExceptionInfo.h + + COa2VFUf0SqrmXfs7P0LrKRuVNE= + + Headers/PLCrashReportFormatter.h + + vX2oRdkxfIkphwG2QZAMBk5eyqQ= + + Headers/PLCrashReportMachExceptionInfo.h + + W17FCxf8giHWOyLk1t95TdCIWwk= + + Headers/PLCrashReportMachineInfo.h + + p9+mHt6/82wDX2EzNaUTN4rPGr4= + + Headers/PLCrashReportProcessInfo.h + + jOUd4pc0gnpcOTKG5QAFHElxwNk= + + Headers/PLCrashReportProcessorInfo.h + + WEkRtOu12c0Wh4WByQj7lh686to= + + Headers/PLCrashReportRegisterInfo.h + + O9MYY+c9RFP62QneurY8OAUmYSI= + + Headers/PLCrashReportSignalInfo.h + + l6oXnbSlUBitgXtLnpViLTIwLz8= + + Headers/PLCrashReportStackFrameInfo.h + + eCwk4wpWqrrnMMI1dIzmATv3+D0= + + Headers/PLCrashReportSymbolInfo.h + + WdFQeKsVIkrDDFK1dlK5xt7JCpc= + + Headers/PLCrashReportSystemInfo.h + + X7hNYQDtDQpFKItKCflaXjT8Zas= + + Headers/PLCrashReportTextFormatter.h + + GioWs2cl5BonqBFrrdMkAu9DH8c= + + Headers/PLCrashReportThreadInfo.h + + onzgp2Mf0YWSOfmwEdjqileRTTg= + + Headers/PLCrashReporter.h + + UYRMI0IEWikT6CY3r9pziLDvmms= + + Headers/PLCrashReporterConfig.h + + yJB6jCUNlu0cnvq8C2sF6t1gDtc= + + Info.plist + + IF18gUjoUfiHJLTRHVCPp6SHG0I= + + Modules/module.modulemap + + GevHSzc93CvcJCM//BXzSveGpGE= + + + files2 + + Headers/CrashReporter.h + + hash + + oU1aDvwwGfw5VO+AJWhXmX6M0h0= + + hash2 + + fJg+ghi2Wtl6wuJBTakT9vU+csdID4zshN5fDkm3RXQ= + + + Headers/PLCrashFeatureConfig.h + + hash + + n52MK11FnpreEtuoKRTG8TrBOA8= + + hash2 + + vm9fLELpj4LXkcSkP2mcp0HkR29lDezMCLbyVX/p524= + + + Headers/PLCrashMacros.h + + hash + + EgfEfSDoo+ipdGXg9d2sqTsTOgc= + + hash2 + + onONQ05LiikrFVtyJyeHxsRLgrz8/U0BLgGlQXvbeRE= + + + Headers/PLCrashNamespace.h + + hash + + iju+4ZZz8ziKAwQQqdBZLrALkGw= + + hash2 + + ZERqK4S7+eVGTv2RvTDivKwapSL6OiHx6nnGyb9+Kmw= + + + Headers/PLCrashReport.h + + hash + + Gy6IE4DKfujVP4s/bfcPp+TnPZw= + + hash2 + + dmFoK6TXfoq7iBIixwdjMxJLstvZrpaer7NkL4X4N4c= + + + Headers/PLCrashReportApplicationInfo.h + + hash + + rCQLAtwJCv/srYztEH5cfECm8nU= + + hash2 + + 7/uQ0EM0lh6buw1mRQ29F6oy0zj/5gfZEFGoq0OH7GM= + + + Headers/PLCrashReportBinaryImageInfo.h + + hash + + H6EGcFdy29+0QvrKgqdM4zWMnOk= + + hash2 + + qPKt+Vpvb5yKwy5YnDVQrtRiUXKDtMTz1eDwJzzWMW8= + + + Headers/PLCrashReportExceptionInfo.h + + hash + + COa2VFUf0SqrmXfs7P0LrKRuVNE= + + hash2 + + vhn8etGnXpXWwdC5COrFJ9Hc9OkgJHFDk85oWPgyQFc= + + + Headers/PLCrashReportFormatter.h + + hash + + vX2oRdkxfIkphwG2QZAMBk5eyqQ= + + hash2 + + JJT26JJEqQMNGhrYjRid8UfRBFNc5LJVMzZHHcJaSYA= + + + Headers/PLCrashReportMachExceptionInfo.h + + hash + + W17FCxf8giHWOyLk1t95TdCIWwk= + + hash2 + + JDIeCA5ip7MsJqCN4EqQa8FXR/jPN1C4eMMtv/0HD6s= + + + Headers/PLCrashReportMachineInfo.h + + hash + + p9+mHt6/82wDX2EzNaUTN4rPGr4= + + hash2 + + wzibgN5Dnn+3NpNUy4RxbLYb22YoN0Ma2xXHf06vLJ8= + + + Headers/PLCrashReportProcessInfo.h + + hash + + jOUd4pc0gnpcOTKG5QAFHElxwNk= + + hash2 + + T0EJVBBej8ulfhEtWVUCEXqylnw+QsYmw89lpCw7lF0= + + + Headers/PLCrashReportProcessorInfo.h + + hash + + WEkRtOu12c0Wh4WByQj7lh686to= + + hash2 + + hYUwvgD28VIk3GLO3Srhz6jgMF1wJBr+ASLY/4DCLww= + + + Headers/PLCrashReportRegisterInfo.h + + hash + + O9MYY+c9RFP62QneurY8OAUmYSI= + + hash2 + + 9ST+qLa/nu1YnrYtX5mrfHKp/607Xp9MYrbAVshb3l4= + + + Headers/PLCrashReportSignalInfo.h + + hash + + l6oXnbSlUBitgXtLnpViLTIwLz8= + + hash2 + + ycVcVPGO+newWVaHBGP7aFg7Y5cZ+UWdkUCF32rPQ+Y= + + + Headers/PLCrashReportStackFrameInfo.h + + hash + + eCwk4wpWqrrnMMI1dIzmATv3+D0= + + hash2 + + jYlHKqtsD4X4w4c77VfW9ImXG6SonGkWXtapgZeKEiA= + + + Headers/PLCrashReportSymbolInfo.h + + hash + + WdFQeKsVIkrDDFK1dlK5xt7JCpc= + + hash2 + + wm+QGSC8bSqrtAiMqfOsm2QOV3l1nhvw0oX/MH2YBFo= + + + Headers/PLCrashReportSystemInfo.h + + hash + + X7hNYQDtDQpFKItKCflaXjT8Zas= + + hash2 + + V+uaKx4KohhYCu8yqRGnAJKUHwkU3bA01/O8v9HD/L0= + + + Headers/PLCrashReportTextFormatter.h + + hash + + GioWs2cl5BonqBFrrdMkAu9DH8c= + + hash2 + + LxFU3hM5fCT+Puo1F44kuMORirDWpjTNzFL6BeSuF2k= + + + Headers/PLCrashReportThreadInfo.h + + hash + + onzgp2Mf0YWSOfmwEdjqileRTTg= + + hash2 + + b9XzFC1Nsx92T55WvW6cgS+3lvR8Eai7PbajhGslveA= + + + Headers/PLCrashReporter.h + + hash + + UYRMI0IEWikT6CY3r9pziLDvmms= + + hash2 + + aINUhmY4EmnBT0W5ddIwTRwI4tKT+beXKsBVNxZuO84= + + + Headers/PLCrashReporterConfig.h + + hash + + yJB6jCUNlu0cnvq8C2sF6t1gDtc= + + hash2 + + 83lSiMTxSMjOEnuD5nLWABoJKG/yc8G9UIKT8Mm6Ngg= + + + Modules/module.modulemap + + hash + + GevHSzc93CvcJCM//BXzSveGpGE= + + hash2 + + iru6hi0cnStthQ0L2aQ0Hxz0/f4aP3jQgCrN0ok2aUM= + + + + rules + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^version.plist$ + + + rules2 + + .*\.dSYM($|/) + + weight + 11 + + ^(.*/)?\.DS_Store$ + + omit + + weight + 2000 + + ^.* + + ^.*\.lproj/ + + optional + + weight + 1000 + + ^.*\.lproj/locversion.plist$ + + omit + + weight + 1100 + + ^Base\.lproj/ + + weight + 1010 + + ^Info\.plist$ + + omit + + weight + 20 + + ^PkgInfo$ + + omit + + weight + 20 + + ^embedded\.provisionprofile$ + + weight + 20 + + ^version\.plist$ + + weight + 20 + + + + diff --git a/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeSignature b/packages/rum_sdk/ios/CrashReporter.xcframework/tvos-arm64_x86_64-simulator/CrashReporter.framework/_CodeSignature/CodeSignature new file mode 100644 index 0000000..e69de29 diff --git a/packages/rum_sdk/ios/rum_sdk.podspec b/packages/rum_sdk/ios/rum_sdk.podspec new file mode 100644 index 0000000..6dfa5e8 --- /dev/null +++ b/packages/rum_sdk/ios/rum_sdk.podspec @@ -0,0 +1,27 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint rum_sdk.podspec` to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'rum_sdk' + s.version = '0.0.1' + s.summary = 'A new Flutter plugin project.' + s.description = <<-DESC +A new Flutter plugin project. + DESC + s.homepage = 'http://example.com' + s.license = { :file => '../LICENSE' } + s.author = { 'Your Company' => 'email@example.com' } + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.dependency 'Flutter' + s.static_framework = true + s.ios.deployment_target = '11.0' + s.platform = :ios, '11.0' + s.preserve_paths = 'CrashReporter.xcframework' + s.vendored_frameworks = 'CrashReporter.xcframework' + + # Flutter.framework does not contain a i386 slice. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } + s.swift_version = '5.0' +end diff --git a/packages/rum_sdk/lib/rum_flutter.dart b/packages/rum_sdk/lib/rum_flutter.dart new file mode 100644 index 0000000..6e3a9e7 --- /dev/null +++ b/packages/rum_sdk/lib/rum_flutter.dart @@ -0,0 +1,230 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; +import 'package:flutter/cupertino.dart'; + +import 'package:rum_sdk/rum_native_methods.dart'; +import 'package:rum_sdk/rum_sdk.dart'; +import 'package:rum_sdk/src/transport/batch_transport.dart'; +import 'package:rum_sdk/src/transport/rum_base_transport.dart'; +import 'package:rum_sdk/src/util/generate_session.dart'; + + +Timer? timer; + +typedef AppRunner = FutureOr Function(); + +class RumFlutter { + // Private constructor + RumFlutter._(); + + // Singleton instance + static RumFlutter _instance = RumFlutter._(); + + factory RumFlutter() { + return _instance; + } + + @visibleForTesting + static set instance(RumFlutter instance)=> _instance = instance; + + RumConfig? config; + List _transports = []; + BatchTransport? _batchTransport; + List get transports => _transports; + + Meta meta = Meta( + session: Session(generateSessionID(), attributes: { + "device": Platform.operatingSystem, + "device_version": Platform.operatingSystemVersion, + "dart_version": Platform.version + }), + sdk: Sdk("rum-flutter", "0.0.1", []), + app: App("", "", ""), + view: ViewMeta("default")); + + List? ignoreUrls = []; + Map eventMark = {}; + RumNativeMethods? _nativeChannel; + + RumNativeMethods? get nativeChannel => _nativeChannel; + + @visibleForTesting + set nativeChannel(RumNativeMethods? nativeChannel) { + _nativeChannel = nativeChannel; + } + + @visibleForTesting + set transports(List transports) { + _transports = transports; + } + @visibleForTesting + set batchTransport(BatchTransport? batchTransport) { + _batchTransport = batchTransport; + } + + Future init( + {required RumConfig optionsConfiguration}) async { + _nativeChannel ??= RumNativeMethods(); + config = optionsConfiguration; + _batchTransport = _batchTransport ?? BatchTransport( + payload: Payload(meta), + batchConfig: config?.batchConfig ?? BatchConfig(), + transports: _transports); + + if(config?.transports == null){ + RumFlutter()._transports.add( + RUMTransport(collectorUrl: optionsConfiguration.collectorUrl ?? '', + apiKey: optionsConfiguration.apiKey, + maxBufferLimit: config?.maxBufferLimit , + ) + ); + } + else{ + RumFlutter()._transports.addAll(config?.transports ?? []); + } + _instance.ignoreUrls = optionsConfiguration.ignoreUrls ?? []; + _instance.setAppMeta( + appName: optionsConfiguration.appName, + appEnv: optionsConfiguration.appEnv, + appVersion: optionsConfiguration.appVersion == null + ? "1.0.0" + : optionsConfiguration.appVersion!); + if(config?.enableCrashReporting == true){ + _instance.enableCrashReporter(app: _instance.meta.app!, apiKey: optionsConfiguration.apiKey, collectorUrl: optionsConfiguration.collectorUrl ?? "" ); + } + if (Platform.isAndroid || Platform.isIOS){ + NativeIntegration.instance.init( + memusage: optionsConfiguration.memoryUsageVitals, + cpuusage: optionsConfiguration.cpuUsageVitals, + anr: optionsConfiguration.anrTracking, + refreshrate: optionsConfiguration.refreshRateVitals, + setSendUsageInterval: optionsConfiguration.fetchVitalsInterval); + } + await _instance.pushEvent("session_start"); + WidgetsBinding.instance.addPostFrameCallback((_) { + NativeIntegration.instance.getAppStart(); + }); + WidgetsBinding.instance.addObserver(RumWidgetsBindingObserver()); + + } + + Future runApp( + {required RumConfig optionsConfiguration, + required AppRunner? appRunner}) async { + OnErrorIntegration().call(); + FlutterErrorIntegration().call(); + await init(optionsConfiguration: optionsConfiguration); + await appRunner!(); + } + + void setAppMeta( + {required String appName, + required String appEnv, + required String appVersion}) { + App appMeta = App(appName, appEnv, appVersion); + _instance.meta = + Meta.fromJson({..._instance.meta.toJson(), "app": appMeta.toJson()}); + _instance._batchTransport?.updatePayloadMeta(_instance.meta); + } + + void setUserMeta({String? userId, String? userName, String? userEmail}) { + User userMeta = User(id: userId, username: userName, email: userEmail); + _instance.meta = + Meta.fromJson({..._instance.meta.toJson(), "user": userMeta.toJson()}); + _instance._batchTransport?.updatePayloadMeta(_instance.meta); + } + + void setViewMeta({String? name}) { + ViewMeta viewMeta = ViewMeta(name); + _instance.meta = + Meta.fromJson({..._instance.meta.toJson(), "view": viewMeta.toJson()}); + _instance._batchTransport?.updatePayloadMeta(_instance.meta); + } + + Future? pushEvent(String name, {Map? attributes}) { + _batchTransport?.addEvent(Event(name, attributes: attributes)); + return null; + } + + Future? pushLog(String message, + {String? level, + Map? context, + Map? trace}) { + _batchTransport?.addLog(RumLog(message, level: level, context: context, trace: trace)); + return null; + } + + Future? pushError( + {required type, + required value, + StackTrace? stacktrace, + Map? context}) { + Map parsedStackTrace = {}; + if (stacktrace != null) { + parsedStackTrace = {"frames": RumException.stackTraceParse(stacktrace)}; + } + _batchTransport?.addExceptions(RumException(type, value, parsedStackTrace, context: context)); + return null; + } + + Future? pushMeasurement(Map? values, String type) { + _batchTransport?.addMeasurement(Measurement(values, type)); + return null; + } + + void markEventStart(String key, String name) { + var eventStartTime = DateTime.now().millisecondsSinceEpoch; + eventMark[key] = { + "eventName": name, + "eventStartTime": eventStartTime, + }; + } + + Future? markEventEnd(String key, String name, + {Map attributes = const {}}) { + var eventEndTime = DateTime.now().millisecondsSinceEpoch; + if (name == "http_request" && ignoreUrls != null) { + if (ignoreUrls! + .any((element) => element.stringMatch(attributes["url"]) != null)) { + return null; + } + } + if (!eventMark.containsKey(key)) { + return null; + } + var duration = eventEndTime - eventMark[key]["eventStartTime"]; + pushEvent(name, attributes: { + ...attributes, + "duration": duration.toString(), + "eventStart": eventMark[key]["eventStartTime"].toString(), + "eventEnd": eventEndTime.toString() + }); + eventMark.remove(key); + return null; + } + + Future? enableCrashReporter({required App app, required String apiKey, required String collectorUrl} ) async { + Map metadata = meta.toJson(); + metadata["app"] = app.toJson(); + metadata["apiKey"] = apiKey; + metadata["collectorUrl"] = collectorUrl; + if(Platform.isIOS){ + _nativeChannel?.enableCrashReporter(metadata); + } + if(Platform.isAndroid){ + List? crashReports = await _nativeChannel?.getCrashReport(); + if(crashReports != null){ + for(var crashInfo in crashReports){ + final crashInfoJson = json.decode(crashInfo); + String reason = crashInfoJson["reason"]; + int status = crashInfoJson["status"]; + // String description = crashInfoJson["description"]; + // description/stacktrace fails to send format and sanitize before push + await _instance.pushError(type: "crash", value: " $reason , status: $status"); + } + + } + } + } +} diff --git a/packages/rum_sdk/lib/rum_native_methods.dart b/packages/rum_sdk/lib/rum_native_methods.dart new file mode 100644 index 0000000..7de022d --- /dev/null +++ b/packages/rum_sdk/lib/rum_native_methods.dart @@ -0,0 +1,39 @@ +import 'rum_sdk_platform_interface.dart'; + +class RumNativeMethods{ + Future getMemoryUsage(){ + return RumSdkPlatform.instance.getMemoryUsage(); + } + Future getRefreshRate(){ + return RumSdkPlatform.instance.getRefreshRate(); + } + Future initRefreshRate(){ + return RumSdkPlatform.instance.initRefreshRate(); + } + Future getCpuUsage(){ + return RumSdkPlatform.instance.getCpuUsage(); + } + Future?> getAppStart(){ + return RumSdkPlatform.instance.getAppStart(); + } + Future?> getWarmStart(){ + return RumSdkPlatform.instance.getWarmStart(); + } + Future?> stopFramesTracker(){ + return RumSdkPlatform.instance.stopFramesTracker(); + } + Future startFramesTracker(){ + return RumSdkPlatform.instance.startFramesTracker(); + } + Future?> getANRStatus(){ + return RumSdkPlatform.instance.getANRStatus(); + } + Future enableCrashReporter( Map config){ + return RumSdkPlatform.instance.enableCrashReporter(config); + } + Future?> getCrashReport(){ + return RumSdkPlatform.instance.getCrashReport(); + + } +} + diff --git a/packages/rum_sdk/lib/rum_sdk.dart b/packages/rum_sdk/lib/rum_sdk.dart new file mode 100644 index 0000000..5715c01 --- /dev/null +++ b/packages/rum_sdk/lib/rum_sdk.dart @@ -0,0 +1,21 @@ +library; + + +export 'rum_flutter.dart' + if (dart.library.html) 'package:rum_sdk/rum_web.dart'; +export 'rum_sdk_method_channel.dart'; +export 'rum_sdk_platform_interface.dart'; +export './src/rum_widgets_binding_observer.dart'; +export './src/rum_navigation_observer.dart'; +export './src/rum_asset_bundle.dart'; +export './src/rum_user_interaction_widget.dart'; +export './src/integrations/http_tracking_client.dart'; +export './src/integrations/flutter_error_integration.dart'; +export './src/integrations/native_integration.dart'; +export './src/integrations/run_zoned_integration.dart'; +export './src/integrations/on_error_integration.dart'; +export './src/transport/rum_transport.dart'; +export './src/models/models.dart'; +export './src/configurations/rum_config.dart'; +export './src/configurations/batch_config.dart'; + diff --git a/packages/rum_sdk/lib/rum_sdk_method_channel.dart b/packages/rum_sdk/lib/rum_sdk_method_channel.dart new file mode 100644 index 0000000..03251ea --- /dev/null +++ b/packages/rum_sdk/lib/rum_sdk_method_channel.dart @@ -0,0 +1,71 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter/services.dart'; + +import 'rum_sdk_platform_interface.dart'; + +/// An implementation of [RumSdkPlatform] that uses method channels. +class MethodChannelRumSdk extends RumSdkPlatform { + /// The method channel used to interact with the native platform. + @visibleForTesting + final methodChannel = const MethodChannel('rum_sdk'); + + @override + Future initRefreshRate() async { + await methodChannel.invokeMethod('initRefreshRate'); + } + + @override + Future?> getAppStart() async { + final appStart = await methodChannel.invokeMapMethod('getAppStart'); + return appStart; + } + + @override + Future?> getWarmStart() async { + final appStart = await methodChannel.invokeMapMethod('getWarmStart'); + return appStart; + } + @override + Future?> getANRStatus() async { + final anr = await methodChannel.invokeListMethod('getANRStatus'); + return anr; + } + + + @override + Future getRefreshRate() async { + final refreshRate = await methodChannel.invokeMethod('getRefreshRate'); + return refreshRate; + } + + @override + Future getMemoryUsage() async { + return await methodChannel.invokeMethod('getMemoryUsage'); + } + @override + Future getCpuUsage() async { + return await methodChannel.invokeMethod('getCpuUsage'); + } + + @override + Future coldStart() async { + final coldstart = await methodChannel.invokeMethod('coldStart'); + return coldstart; + } + + @override + Future warmStart() async { + final warmstart = await methodChannel.invokeMethod('warmStart'); + return warmstart; + } + + @override + Future enableCrashReporter(Map config) async { + await methodChannel.invokeMethod('enableCrashReporter',config); + } + @override + Future?> getCrashReport() async { + final crashInfo = await methodChannel.invokeListMethod('getCrashReport'); + return crashInfo; + } +} diff --git a/packages/rum_sdk/lib/rum_sdk_platform_interface.dart b/packages/rum_sdk/lib/rum_sdk_platform_interface.dart new file mode 100644 index 0000000..be9708b --- /dev/null +++ b/packages/rum_sdk/lib/rum_sdk_platform_interface.dart @@ -0,0 +1,66 @@ +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; + +import 'rum_sdk_method_channel.dart'; + +abstract class RumSdkPlatform extends PlatformInterface { + /// Constructs a RumSdkPlatform. + RumSdkPlatform() : super(token: _token); + + static final Object _token = Object(); + + static RumSdkPlatform _instance = MethodChannelRumSdk(); + + /// The default instance of [RumSdkPlatform] to use. + /// Defaults to [MethodChannelRumSdk]. + static RumSdkPlatform get instance => _instance; + + static set instance(RumSdkPlatform instance) { + PlatformInterface.verifyToken(instance, _token); + _instance = instance; + } + + Future?> getAppStart(){ + throw UnimplementedError('getAppStart() has not been implemented.'); + } + Future?> getWarmStart(){ + throw UnimplementedError('getWarmStart() has not been implemented.'); + } + + Future getRefreshRate(){ + throw UnimplementedError('getRefreshRate() has not been implemented.'); + } + Future initRefreshRate(){ + throw UnimplementedError('initRefreshRate() has not been implemented.'); + } + Future coldStart(){ + throw UnimplementedError('coldStart() has not been implemented.'); + } + Future warmStart(){ + throw UnimplementedError('warmStart() has not been implemented.'); + } + Future getMemoryUsage(){ + throw UnimplementedError('getMemoryUsage() has not been implemented.'); + } + Future getCpuUsage(){ + throw UnimplementedError('getCpuUsage() has not been implemented.'); + } + Future startFramesTracker(){ + throw UnimplementedError('startFramesTracker() has not been implemented.'); + } + Future?> getANRStatus(){ + throw UnimplementedError('getANRStatus() has not been implemented.'); + } +// Test + Future?> stopFramesTracker(){ + throw UnimplementedError('stopFramesTracker() has not been implemented.'); + } + + Future enableCrashReporter(Map config){ + throw UnimplementedError('enableCrashReporter() has not been implemented.'); + } + + Future?> getCrashReport() { + throw UnimplementedError("getCrashReport() has not been implemented"); + } + +} diff --git a/packages/rum_sdk/lib/rum_web.dart b/packages/rum_sdk/lib/rum_web.dart new file mode 100644 index 0000000..e69de29 diff --git a/packages/rum_sdk/lib/src/configurations/batch_config.dart b/packages/rum_sdk/lib/src/configurations/batch_config.dart new file mode 100644 index 0000000..0df8653 --- /dev/null +++ b/packages/rum_sdk/lib/src/configurations/batch_config.dart @@ -0,0 +1,7 @@ +class BatchConfig{ + Duration sendTimeout; + int payloadItemLimit; + bool enabled; + + BatchConfig({this.sendTimeout = const Duration(milliseconds: 300), this.payloadItemLimit = 30, this.enabled = true}); +} diff --git a/packages/rum_sdk/lib/src/configurations/rum_config.dart b/packages/rum_sdk/lib/src/configurations/rum_config.dart new file mode 100644 index 0000000..9cf30b6 --- /dev/null +++ b/packages/rum_sdk/lib/src/configurations/rum_config.dart @@ -0,0 +1,44 @@ +import 'package:rum_sdk/rum_sdk.dart'; + +import './batch_config.dart'; +class RumConfig { + final String appName; + final String appEnv; + final String apiKey; + final String? appVersion; + final String? collectorUrl; + final List? transports; + final bool memoryUsageVitals; + final bool cpuUsageVitals; + final bool anrTracking; + final bool enableCrashReporting; + final bool refreshRateVitals; + final BatchConfig batchConfig; + final int maxBufferLimit; + final Duration? fetchVitalsInterval; + final List? ignoreUrls; + + RumConfig({ + required this.appName, + required this.appEnv, + required this.apiKey, + this.collectorUrl, + this.appVersion, + this.transports, + this.enableCrashReporting = false, + this.memoryUsageVitals = true, + this.cpuUsageVitals = true, + this.anrTracking = false, + this.refreshRateVitals = false, + this.fetchVitalsInterval = const Duration(seconds: 30), + BatchConfig? batchConfig, + this.ignoreUrls, + this.maxBufferLimit = 30, + }) : assert(appName.isNotEmpty, 'appName cannot be empty'), + assert(appEnv.isNotEmpty, 'appEnv cannot be empty'), + assert(apiKey.isNotEmpty, 'apiKey cannot be empty'), + assert(maxBufferLimit > 0, 'maxBufferLimit must be greater than 0'), + this.batchConfig = batchConfig ?? BatchConfig(); + +// Other methods or properties of RumConfig can be added here +} \ No newline at end of file diff --git a/packages/rum_sdk/lib/src/integrations/flutter_error_integration.dart b/packages/rum_sdk/lib/src/integrations/flutter_error_integration.dart new file mode 100644 index 0000000..02e957b --- /dev/null +++ b/packages/rum_sdk/lib/src/integrations/flutter_error_integration.dart @@ -0,0 +1,27 @@ +import 'package:flutter/foundation.dart'; +import 'package:rum_sdk/rum_flutter.dart'; + + +class FlutterErrorIntegration{ + FlutterExceptionHandler? _defaultOnError; + + FlutterExceptionHandler? _onErrorIntegration; + + void call(){ + _defaultOnError = FlutterError.onError; + _onErrorIntegration = (FlutterErrorDetails details) async { + if(details.stack !=null){ + RumFlutter().pushError(type:"flutter_error",value: details.exceptionAsString(),stacktrace: details.stack); + } + + if(_defaultOnError !=null){ + _defaultOnError?.call(details); + } + }; + FlutterError.onError = _onErrorIntegration; + + } + void close(){ + FlutterError.onError = _defaultOnError; + } +} diff --git a/packages/rum_sdk/lib/src/integrations/http_tracking_client.dart b/packages/rum_sdk/lib/src/integrations/http_tracking_client.dart new file mode 100644 index 0000000..1a9e95e --- /dev/null +++ b/packages/rum_sdk/lib/src/integrations/http_tracking_client.dart @@ -0,0 +1,410 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; +import 'package:uuid/uuid.dart'; + +import '../../rum_flutter.dart'; + + +class RumHttpOverrides extends HttpOverrides { + final HttpOverrides? existingOverrides; + + RumHttpOverrides(this.existingOverrides); + + @override + HttpClient createHttpClient(SecurityContext? context) { + var innerClient = existingOverrides?.createHttpClient(context) ?? + super.createHttpClient(context); + return RumHttpTrackingClient(innerClient); + } +} + +class RumHttpTrackingClient implements HttpClient { + final HttpClient innerClient; + + RumHttpTrackingClient( + this.innerClient, + ); + + @override + Future open( + String method, String host, int port, String path) { + const int hashMark = 0x23; + const int questionMark = 0x3f; + int fragmentStart = path.length; + int queryStart = path.length; + for (int i = path.length - 1; i >= 0; i--) { + var char = path.codeUnitAt(i); + if (char == hashMark) { + fragmentStart = i; + queryStart = i; + } else if (char == questionMark) { + queryStart = i; + } + } + String? query; + if (queryStart < fragmentStart) { + query = path.substring(queryStart + 1, fragmentStart); + path = path.substring(0, queryStart); + } + Uri uri = + Uri(scheme: 'http', host: host, port: port, path: path, query: query); + return _openUrl(method, uri); + } + + Future _openUrl(String method, Uri url) async { + + HttpClientRequest request; + Map userAttributes = {}; + try { + request = await innerClient.openUrl(method, url); + if(url.toString()!= RumFlutter().config?.collectorUrl) { + String key = const Uuid().v1(); + RumFlutter().markEventStart(key, "http_request"); + request = RumTrackingHttpClientRequest(key, request, userAttributes); + } + } catch (e) { + rethrow; + } + return request; + } + + @override + set connectionFactory( + Future> Function( + Uri url, String? proxyHost, int? proxyPort)? + f) => + innerClient.connectionFactory = f; + + @override + set keyLog(Function(String line)? callback) => innerClient.keyLog = callback; + + @override + bool get autoUncompress => innerClient.autoUncompress; + @override + set autoUncompress(bool value) => innerClient.autoUncompress = value; + + @override + Duration? get connectionTimeout => innerClient.connectionTimeout; + @override + set connectionTimeout(Duration? value) => + innerClient.connectionTimeout = value; + + @override + Duration get idleTimeout => innerClient.idleTimeout; + @override + set idleTimeout(Duration value) => innerClient.idleTimeout = value; + + @override + int? get maxConnectionsPerHost => innerClient.maxConnectionsPerHost; + @override + set maxConnectionsPerHost(int? value) => + innerClient.maxConnectionsPerHost = value; + + @override + String? get userAgent => innerClient.userAgent; + @override + set userAgent(String? value) => innerClient.userAgent = value; + + @override + void addCredentials( + Uri url, String realm, HttpClientCredentials credentials) { + innerClient.addCredentials(url, realm, credentials); + } + + @override + void addProxyCredentials( + String host, int port, String realm, HttpClientCredentials credentials) { + innerClient.addProxyCredentials(host, port, realm, credentials); + } + + @override + set authenticate( + Future Function(Uri url, String scheme, String? realm)? f) => + innerClient.authenticate = f; + + @override + set authenticateProxy( + Future Function( + String host, int port, String scheme, String? realm)? + f) => + innerClient.authenticateProxy = f; + + @override + set badCertificateCallback( + bool Function(X509Certificate cert, String host, int port)? + callback) => + innerClient.badCertificateCallback = callback; + + @override + void close({bool force = false}) { + innerClient.close(force: force); + } + + @override + Future delete(String host, int port, String path) { + return innerClient.delete(host, port, path); + } + + @override + Future deleteUrl(Uri url) => _openUrl('delete', url); + + @override + set findProxy(String Function(Uri url)? f) => innerClient.findProxy = f; + + @override + Future get(String host, int port, String path) => + open('get', host, port, path); + + @override + Future getUrl(Uri url) => _openUrl('get', url); + + @override + Future head(String host, int port, String path) => + open('head', host, port, path); + + @override + Future headUrl(Uri url) => _openUrl('head', url); + + @override + Future openUrl(String method, Uri url) => + _openUrl(method, url); + + @override + Future patch(String host, int port, String path) => + open('patch', host, port, path); + + @override + Future patchUrl(Uri url) => _openUrl('patch', url); + + @override + Future post(String host, int port, String path) => + open('post', host, port, path); + + @override + Future postUrl(Uri url) => _openUrl('post', url); + + @override + Future put(String host, int port, String path) => + open('post', host, port, path); + + @override + Future putUrl(Uri url) => _openUrl('put', url); +} + +class RumTrackingHttpClientRequest implements HttpClientRequest { + final HttpClientRequest innerContext; + final Map userAttributes; + String key; + + + RumTrackingHttpClientRequest( + this.key, + this.innerContext, + this.userAttributes, + ) { + } + + @override + Future get done { + final innerFuture = innerContext.done; + return innerFuture.then((value) { + return value; + }, onError: (Object e, StackTrace? st) { + throw e; + }); + } + + @override + Future close() { + + return innerContext.close().then((value) { + return RumTrackingHttpResponse(key,value,{ + "response_size": "${value.headers.contentLength}", + "content_type": "${value.headers.contentType}", + "status_code": "${value.statusCode}", + "method": innerContext.method, + "request_size": "${innerContext.contentLength}", + "url": innerContext.uri.toString(), + }); + }, onError: (Object e, StackTrace? st) { + throw e; + }); + } + + + @override + bool get bufferOutput => innerContext.bufferOutput; + @override + set bufferOutput(bool value) => innerContext.bufferOutput = value; + + @override + int get contentLength => innerContext.contentLength; + @override + set contentLength(int value) => innerContext.contentLength = value; + + @override + Encoding get encoding => innerContext.encoding; + @override + set encoding(Encoding value) => innerContext.encoding = value; + + @override + bool get followRedirects => innerContext.followRedirects; + @override + set followRedirects(bool value) => innerContext.followRedirects = value; + + @override + int get maxRedirects => innerContext.maxRedirects; + @override + set maxRedirects(int value) => innerContext.maxRedirects = value; + + @override + bool get persistentConnection => innerContext.persistentConnection; + @override + set persistentConnection(bool value) => + innerContext.persistentConnection = value; + + @override + void abort([Object? exception, StackTrace? stackTrace]) => + innerContext.abort(exception, stackTrace); + + @override + void add(List data) => innerContext.add(data); + + @override + void addError(Object error, [StackTrace? stackTrace]) => + innerContext.addError(error, stackTrace); + + @override + Future addStream(Stream> stream) { + return innerContext.addStream(stream); + } + + @override + HttpConnectionInfo? get connectionInfo => innerContext.connectionInfo; + + @override + List get cookies => innerContext.cookies; + + @override + Future flush() => innerContext.flush(); + + @override + HttpHeaders get headers => innerContext.headers; + + @override + String get method => innerContext.method; + + @override + Uri get uri => innerContext.uri; + + @override + void write(Object? object) { + innerContext.write(object); + } + + @override + void writeAll(Iterable objects, [String separator = '']) { + innerContext.writeAll(objects, separator); + } + + @override + void writeCharCode(int charCode) { + innerContext.writeCharCode(charCode); + } + + @override + void writeln([Object? object = '']) { + innerContext.writeln(object); + } +} + +class RumTrackingHttpResponse extends Stream> + implements HttpClientResponse { + final HttpClientResponse innerResponse; + final Map userAttributes; + Object? lastError; + String key; + + RumTrackingHttpResponse( + this.key, + this.innerResponse, + this.userAttributes, + ); + + @override + StreamSubscription> listen(void Function(List event)? onData, + {Function? onError, void Function()? onDone, bool? cancelOnError}) { + return innerResponse.listen( + onData, + cancelOnError: cancelOnError, + onError: (Object e, StackTrace st) { + if (onError == null) { + return; + } + if (onError is void Function(Object, StackTrace)) { + onError(e, st); + } else if (onError is void Function(Object)) { + onError(e); + } else { + RumFlutter().pushLog("network_error on : ${userAttributes["method"]} : ${userAttributes["url"]}", level:"error"); + } + }, + onDone: () { + _onFinish(); + if (onDone != null) { + onDone(); + } + }, + ); + } + + void _onFinish() { + RumFlutter().markEventEnd(key, "http_request", attributes: userAttributes); + } + + @override + X509Certificate? get certificate => innerResponse.certificate; + + @override + HttpClientResponseCompressionState get compressionState => + innerResponse.compressionState; + + @override + HttpConnectionInfo? get connectionInfo => innerResponse.connectionInfo; + + @override + int get contentLength => innerResponse.contentLength; + + @override + List get cookies => innerResponse.cookies; + + @override + Future detachSocket() { + return innerResponse.detachSocket(); + } + + @override + HttpHeaders get headers => innerResponse.headers; + + @override + bool get isRedirect => innerResponse.isRedirect; + + @override + bool get persistentConnection => innerResponse.persistentConnection; + + @override + String get reasonPhrase => innerResponse.reasonPhrase; + + @override + Future redirect( + [String? method, Uri? url, bool? followLoops]) { + return innerResponse.redirect(method, url, followLoops); + } + + @override + List get redirects => innerResponse.redirects; + + @override + int get statusCode => innerResponse.statusCode; +} diff --git a/packages/rum_sdk/lib/src/integrations/native_integration.dart b/packages/rum_sdk/lib/src/integrations/native_integration.dart new file mode 100644 index 0000000..52bd16a --- /dev/null +++ b/packages/rum_sdk/lib/src/integrations/native_integration.dart @@ -0,0 +1,143 @@ +import 'dart:async'; +import 'dart:developer'; +import 'dart:io'; +import 'package:rum_sdk/rum_flutter.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter/cupertino.dart'; + + +class NativeIntegration{ + final MethodChannel _channel = const MethodChannel('rum_sdk'); + + static final NativeIntegration instance = NativeIntegration(); + static int warmStart = 0; + + void init({bool? memusage, bool? cpuusage, bool? anr, bool? refreshrate, Duration? setSendUsageInterval}){ + _scheduleCalls(memusage: memusage?? false, cpuusage: cpuusage?? false, anr: anr?? false, refreshrate: refreshrate?? false , setSendUsageInterval: setSendUsageInterval?? const Duration(seconds: 60)); + initRefreshRate(); + initializeMethodChannel(); + } + + void initRefreshRate() async { + await RumFlutter().nativeChannel?.initRefreshRate(); + } + + void getAppStart() async { + Map? appStart = await RumFlutter().nativeChannel + ?.getAppStart(); + RumFlutter().pushMeasurement({ + "appStartDuration": appStart!["appStartDuration"], + "coldStart": 1 + }, "app_startup"); + } + void setWarmStart() { + warmStart = DateTime.now().millisecondsSinceEpoch; + } + void getWarmStart() async { + int warmStartDuration = DateTime.now().millisecondsSinceEpoch - warmStart; + if(warmStartDuration>0){ + RumFlutter().pushMeasurement({ + "appStartDuration":warmStartDuration, + "coldStart": 0 + },"app_startup"); + } + } + + @visibleForTesting + void _scheduleCalls({ + bool memusage=false, + bool cpuusage=false, + bool anr=false, + bool refreshrate = false, + Duration setSendUsageInterval = const Duration(seconds: 60) }) { + if(memusage || cpuusage || anr || refreshrate){ + Timer.periodic(setSendUsageInterval, (timer) { + if(memusage) { + _pushMemoryUsage(); + } + if(cpuusage){ + _pushCpuUsage(); + } + if(anr && Platform.isAndroid) { + _getAnrStatus(); + } + if(refreshrate){ + if(Platform.isAndroid){ + initRefreshRate(); + }else{ + _pushRefreshRate(); + } + } + + }); + } + } + + void _pushRefreshRate() async{ + double? refreshRate = await RumFlutter().nativeChannel?.getRefreshRate(); + log("refreshRate $refreshRate"); + if(refreshRate != null){ + RumFlutter().pushMeasurement({ + "refresh_rate" :refreshRate + },"app_refresh_rate"); + } + + } + + void _pushCpuUsage() async { + double? cpuUsage = await RumFlutter().nativeChannel?.getCpuUsage(); + if(cpuUsage!>0.0 && cpuUsage<100.0){ + RumFlutter().pushMeasurement({ + "cpu_usage" :cpuUsage + },"app_cpu_usage"); + } + } + void _getAnrStatus() async { + List? anr = await RumFlutter().nativeChannel?.getANRStatus(); + if(anr !=null && anr.length>0){ + RumFlutter().pushMeasurement({ + "anr_count" :anr.length + },"anr"); + } + } + void _pushMemoryUsage() async { + double? memUsage = await RumFlutter().nativeChannel?.getMemoryUsage(); + RumFlutter().pushMeasurement({ + "mem_usage" :memUsage + },"app_memory"); + } + + static void initializeMethodChannel() { + instance._channel.setMethodCallHandler((MethodCall call) async { + if(call.method == 'lastCrashReport'){ + RumFlutter().pushLog(call.arguments,level: "error"); + } + if (call.method == 'onFrozenFrame') { + + if(call.arguments != null) { + RumFlutter().pushMeasurement({ + "frozen_frames": call.arguments, + }, "app_frozen_frame"); + } + } + if (call.method == 'onRefreshRate') { + if(call.arguments !=null) { + RumFlutter().pushMeasurement({ + "refresh_rate": call.arguments, + }, "app_refresh_rate"); + // Handle the message from Java + } + } + if (call.method == 'onSlowFrames') { + if(call.arguments!=null){ + RumFlutter().pushMeasurement({ + "slow_frames" :call.arguments + },"app_frames_rate"); + } + + } + + }); + } + +} \ No newline at end of file diff --git a/packages/rum_sdk/lib/src/integrations/on_error_integration.dart b/packages/rum_sdk/lib/src/integrations/on_error_integration.dart new file mode 100644 index 0000000..0aa8a3c --- /dev/null +++ b/packages/rum_sdk/lib/src/integrations/on_error_integration.dart @@ -0,0 +1,33 @@ +import 'dart:ui'; + +import '../../rum_flutter.dart'; + +class OnErrorIntegration{ + + ErrorCallback? _defaultOnError; + ErrorCallback? _onErrorIntegration; + + void call(){ + _defaultOnError = PlatformDispatcher.instance.onError; + _onErrorIntegration = (Object exception, StackTrace stackTrace) { + RumFlutter().pushError(type:"flutter_error", value: exception.toString(),stacktrace: stackTrace); + if(_defaultOnError !=null){ + _defaultOnError!(exception,stackTrace); + } + return true; + }; + + PlatformDispatcher.instance.onError = _onErrorIntegration; + } + bool isOnErrorSupported(){ + try { + PlatformDispatcher.instance.onError; + } on NoSuchMethodError { + return false; + } catch (exception, stacktrace) { + return false; + } + return true; + } + +} diff --git a/packages/rum_sdk/lib/src/integrations/run_zoned_integration.dart b/packages/rum_sdk/lib/src/integrations/run_zoned_integration.dart new file mode 100644 index 0000000..72966a3 --- /dev/null +++ b/packages/rum_sdk/lib/src/integrations/run_zoned_integration.dart @@ -0,0 +1,8 @@ +import 'package:rum_sdk/rum_flutter.dart'; + + +class RunZonedIntegration{ + static void runZonedOnError(Object exception, StackTrace stackTrace){ + RumFlutter().pushError(type:"flutter_error",value: exception.toString(), stacktrace: stackTrace); + } +} diff --git a/packages/rum_sdk/lib/src/models/app.dart b/packages/rum_sdk/lib/src/models/app.dart new file mode 100644 index 0000000..aae89ef --- /dev/null +++ b/packages/rum_sdk/lib/src/models/app.dart @@ -0,0 +1,23 @@ +class App { + String? name; + String? version; + String? environment; + + App(this.name, this.environment, this.version); + + App.fromJson(dynamic json) { + name = json['name']; + version = json['version']; + environment = json['environment']; + } + + Map toJson() { + final map = {}; + + map['name'] = name; + map['version'] = version; + map['environment'] = environment; + + return map; + } +} diff --git a/packages/rum_sdk/lib/src/models/browser.dart b/packages/rum_sdk/lib/src/models/browser.dart new file mode 100644 index 0000000..5e47474 --- /dev/null +++ b/packages/rum_sdk/lib/src/models/browser.dart @@ -0,0 +1,31 @@ +class Browser { + String name = ""; + String version = ""; + String os = ""; + String userAgent = ""; + String language = ""; + bool mobile = false; + + Browser(this.name, this.version, this.os, this.userAgent, this.language, + this.mobile); + + Browser.fromJson(dynamic json) { + name = json['name']; + version = json['version']; + os = json['os']; + userAgent = json['userAgent']; + language = json['language']; + mobile = json['mobile']; + } + + Map toJson() { + final map = {}; + map['name'] = name; + map['version'] = version; + map['os'] = os; + map['userAgent'] = userAgent; + map['language'] = language; + map['mobile'] = mobile; + return map; + } +} diff --git a/packages/rum_sdk/lib/src/models/event.dart b/packages/rum_sdk/lib/src/models/event.dart new file mode 100644 index 0000000..146c004 --- /dev/null +++ b/packages/rum_sdk/lib/src/models/event.dart @@ -0,0 +1,27 @@ +import 'package:intl/intl.dart'; + +class Event { + String name = ""; + String domain = "flutter"; + Map? attributes = {}; + String timestamp = DateFormat('yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'').format(DateTime.now().toUtc()); + + Event(this.name, {this.attributes}); + + Event.fromJson(dynamic json) { + name = json['name']; + domain = json['domain']; + attributes = json['attributes']; + timestamp = json['timestamp']; + } + + Map toJson() { + final map = {}; + + map['name'] = name; + map['domain'] = domain; + map['timestamp'] = timestamp; + map['attributes'] = attributes; + return map; + } +} diff --git a/packages/rum_sdk/lib/src/models/exception.dart b/packages/rum_sdk/lib/src/models/exception.dart new file mode 100644 index 0000000..cc89bf6 --- /dev/null +++ b/packages/rum_sdk/lib/src/models/exception.dart @@ -0,0 +1,74 @@ +import 'dart:convert'; +import 'dart:core'; +import 'package:intl/intl.dart'; + +class StackFrames{ + int colno=0; + int lineno=0; + String filename=""; + String function=""; + StackFrames(this.filename,this.function,this.lineno,this.colno); + StackFrames.fromJson(dynamic json) { + colno= json['colno'] ; + lineno= json['lineno']; + filename= json['filename']; + function = json['function']; + } + Map toJson() { + final map = {}; + + map['colno'] = colno; + map['lineno'] = lineno; + map['filename'] = filename; + map['function'] = function; + return map; + } + +} +class RumException { + String type = ""; + String value = ""; + Map stacktrace = {}; + String trace = ""; + Map? context = {}; + String timestamp = DateFormat('yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'').format(DateTime.now().toUtc()); + + RumException(this.type, this.value, this.stacktrace,{this.context}); + + RumException.fromJson(dynamic json) { + type = json['type']; + value = json['value']; + stacktrace = json['stacktrace']; + timestamp = json['timestamp']; + context = json['context']; + } + + Map toJson() { + final map = {}; + + map['type'] = type; + map['value'] = value; + map['stacktrace'] = stacktrace; + map['timestamp'] = timestamp; + map['context'] = context; + return map; + } + + static List> stackTraceParse(StackTrace stacktrace) { + LineSplitter ls = LineSplitter(); + List stackFrames = ls.convert(stacktrace.toString()); + List> parsedStackFrames = []; + for (final stackFrame in stackFrames) { + List sf =stackFrame.split(" "); + const pattern = ".*((?[a-zA-Z]*):(?[a-zA-Z-_/.]*):(?[0-9]*):(?[0-9]*)).*"; + final regExp = RegExp(pattern); + RegExpMatch? regExpMatch = regExp.firstMatch(sf[sf.length-1]); + final filename = "${regExpMatch?.namedGroup("module")}:${regExpMatch?.namedGroup("filename")}"; + final lineno = regExpMatch?.namedGroup("lineno"); + final colno = regExpMatch?.namedGroup("colno"); + parsedStackFrames.add(StackFrames(filename, sf[sf.length-2], int.parse(lineno ?? "0"), int.parse(colno ?? "0")).toJson()); + } + return parsedStackFrames; + } + +} diff --git a/packages/rum_sdk/lib/src/models/integrations.dart b/packages/rum_sdk/lib/src/models/integrations.dart new file mode 100644 index 0000000..6590a3b --- /dev/null +++ b/packages/rum_sdk/lib/src/models/integrations.dart @@ -0,0 +1,20 @@ +class Integration { + String name = ""; + String version = ""; + + Integration(this.name, this.version); + + Integration.fromJson(dynamic json) { + name = json['name']; + version = json['version']; + } + + Map toJson() { + final map = {}; + + map['name'] = name; + map['version'] = version; + + return map; + } +} diff --git a/packages/rum_sdk/lib/src/models/log.dart b/packages/rum_sdk/lib/src/models/log.dart new file mode 100644 index 0000000..0a75b5f --- /dev/null +++ b/packages/rum_sdk/lib/src/models/log.dart @@ -0,0 +1,30 @@ +import 'package:intl/intl.dart'; + +class RumLog{ + String message = ""; + String? level = ""; + Map? context = {}; + Map? trace = {}; + String timestamp = DateFormat('yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\'').format(DateTime.now().toUtc()); + + RumLog(this.message, {this.level,this.context,this.trace}); + + RumLog.fromJson(dynamic json) { + message = json['message']; + level = json['level']; + context = json['context']; + timestamp = json['timestamp']; + trace = json['trace']; + } + + Map toJson() { + final map = {}; + + map['message'] = message; + map['level'] = level; + map['timestamp'] = timestamp; + map['context'] = context; + map['trace'] = trace; + return map; + } +} diff --git a/packages/rum_sdk/lib/src/models/measurement.dart b/packages/rum_sdk/lib/src/models/measurement.dart new file mode 100644 index 0000000..14aa9be --- /dev/null +++ b/packages/rum_sdk/lib/src/models/measurement.dart @@ -0,0 +1,18 @@ +class Measurement { + Map? values; + String type=""; + + Measurement(this.values,this.type); + + Measurement.fromJson(dynamic json) { + values = json['values']; + type = json['type']; + } + + Map toJson() { + final map = {}; + map['values'] = values; + map['type'] = type; + return map; + } +} diff --git a/packages/rum_sdk/lib/src/models/meta.dart b/packages/rum_sdk/lib/src/models/meta.dart new file mode 100644 index 0000000..5d22053 --- /dev/null +++ b/packages/rum_sdk/lib/src/models/meta.dart @@ -0,0 +1,63 @@ +import 'session.dart'; +import 'sdk.dart'; +import 'app.dart'; +import 'view_meta.dart'; +import 'browser.dart'; +import 'user.dart'; +import 'page.dart'; + +class Meta { + Session? session; + Sdk? sdk; + App? app; + ViewMeta? view; + Browser? browser; + Page? page; + User? user; + + Meta({ + this.session, + this.sdk, + this.app, + this.view, + this.browser, + this.page, + this.user + }); + + Meta.fromJson(dynamic json) { + session = + json['session'] != null ? Session.fromJson(json['session']) : null; + sdk = json['sdk'] != null ? Sdk.fromJson(json['sdk']) : null; + app = json['app'] != null ? App.fromJson(json['app']) : null; + view = json['view'] != null ? ViewMeta.fromJson(json['view']) : null; + browser = + json['browser'] != null ? Browser.fromJson(json['browser']) : null; + page = json['page'] != null ? Page.fromJson(json['page']) : null; + user = json['user'] != null ? User.fromJson(json['user']) : null; + } + + Map toJson() { + final map = {}; + if (session != null) { + map['session'] = session!.toJson(); + } + if (sdk != null) { + map['sdk'] = sdk!.toJson(); + } + if (app != null) { + map['app'] = app!.toJson(); + } + map['view'] = view!.toJson(); + if (browser != null) { + map['browser'] = browser!.toJson(); + } + if (page != null) { + map['page'] = page!.toJson(); + } + if (user != null) { + map['user'] = user!.toJson(); + } + return map; + } +} diff --git a/packages/rum_sdk/lib/src/models/models.dart b/packages/rum_sdk/lib/src/models/models.dart new file mode 100644 index 0000000..f6c17d3 --- /dev/null +++ b/packages/rum_sdk/lib/src/models/models.dart @@ -0,0 +1,14 @@ +export './app.dart'; +export './browser.dart'; +export './event.dart'; +export './exception.dart'; +export './integrations.dart'; +export './log.dart'; +export './measurement.dart'; +export './meta.dart'; +export './page.dart'; +export './payload.dart'; +export './sdk.dart'; +export './session.dart'; +export './user.dart'; +export './view_meta.dart'; diff --git a/packages/rum_sdk/lib/src/models/page.dart b/packages/rum_sdk/lib/src/models/page.dart new file mode 100644 index 0000000..4801f7a --- /dev/null +++ b/packages/rum_sdk/lib/src/models/page.dart @@ -0,0 +1,15 @@ +class Page { + String url = ""; + + Page(this.url); + + Page.fromJson(dynamic json) { + url = json['url']; + } + + Map toJson() { + final map = {}; + map['url'] = url; + return map; + } +} diff --git a/packages/rum_sdk/lib/src/models/payload.dart b/packages/rum_sdk/lib/src/models/payload.dart new file mode 100644 index 0000000..19c7402 --- /dev/null +++ b/packages/rum_sdk/lib/src/models/payload.dart @@ -0,0 +1,58 @@ +import 'package:rum_sdk/rum_sdk.dart'; +import 'package:rum_sdk/src/models/models.dart'; +class Payload { + List events = []; + List measurements = []; + List logs = []; + List exceptions = []; + Meta? meta; + + Payload(this.meta) { + events = []; + } + + Payload.fromJson(dynamic json) { + if (json['events'] != null) { + events = []; + json['events'].forEach((v) { + events.add(Event.fromJson(v)); + }); + } + if (json['measurements'] != null) { + measurements = []; + json['measurements'].forEach((v) { + measurements.add(Measurement.fromJson(v)); + }); + } + if (json['logs'] != null) { + logs = []; + json['logs'].forEach((v) { + logs.add(RumLog.fromJson(v)); + }); + } + if (json['exceptions'] != null) { + exceptions = []; + json['exceptions'].forEach((v) { + exceptions.add(RumException.fromJson(v)); + }); + } + meta = json['meta'] != null ? Meta.fromJson(json['meta']) : null; + } + + + + Map toJson() { + final map = {}; + + map['events'] = events.map((v) => v.toJson()).toList(); + map['measurements'] = measurements.map((v) => v.toJson()).toList(); + map['logs'] = logs.map((v) => v.toJson()).toList(); + map['exceptions'] = exceptions.map((v) => v.toJson()).toList(); + + if (meta != null) { + map['meta'] = meta!.toJson(); + } + return map; + } + +} \ No newline at end of file diff --git a/packages/rum_sdk/lib/src/models/sdk.dart b/packages/rum_sdk/lib/src/models/sdk.dart new file mode 100644 index 0000000..d7cfa8a --- /dev/null +++ b/packages/rum_sdk/lib/src/models/sdk.dart @@ -0,0 +1,28 @@ +import 'integrations.dart'; + +class Sdk { + String name = ""; + String version = ""; + List integrations = []; + + Sdk(this.name, this.version, this.integrations); + + Sdk.fromJson(dynamic json) { + name = json['name']; + version = json['version']; + if (json['integrations'] != null) { + integrations = []; + json['integrations'].forEach((v) { + integrations.add(Integration.fromJson(v)); + }); + } + } + + Map toJson() { + final map = {}; + map['name'] = name; + map['version'] = version; + map['integrations'] = integrations.map((v) => v.toJson()).toList(); + return map; + } +} diff --git a/packages/rum_sdk/lib/src/models/session.dart b/packages/rum_sdk/lib/src/models/session.dart new file mode 100644 index 0000000..9fab2ae --- /dev/null +++ b/packages/rum_sdk/lib/src/models/session.dart @@ -0,0 +1,18 @@ +class Session { + String? id; + Map? attributes; + + Session(this.id, {this.attributes}); + + Session.fromJson(dynamic json) { + id = json['id'] ?? ""; + attributes = json['attributes'] ?? {}; + } + + Map toJson() { + final map = {}; + map['id'] = id; + map['attributes'] = attributes; + return map; + } +} diff --git a/packages/rum_sdk/lib/src/models/user.dart b/packages/rum_sdk/lib/src/models/user.dart new file mode 100644 index 0000000..216d6e6 --- /dev/null +++ b/packages/rum_sdk/lib/src/models/user.dart @@ -0,0 +1,23 @@ +class User { + String? id; + String? username; + String? email; + + User({this.id, this.username, this.email}); + + User.fromJson(dynamic json) { + id = json['id']; + username = json['username']; + email = json['email']; + } + + Map toJson() { + final map = {}; + + map['username'] = username; + map['id'] = id; + map['email'] = email; + + return map; + } +} diff --git a/packages/rum_sdk/lib/src/models/view_meta.dart b/packages/rum_sdk/lib/src/models/view_meta.dart new file mode 100644 index 0000000..4bb9681 --- /dev/null +++ b/packages/rum_sdk/lib/src/models/view_meta.dart @@ -0,0 +1,17 @@ +class ViewMeta { + String? name; + + ViewMeta(this.name); + + ViewMeta.fromJson(dynamic json) { + name = json['name'] ?? ""; + } + + Map toJson() { + final map = {}; + + map['name'] = name; + + return map; + } +} \ No newline at end of file diff --git a/packages/rum_sdk/lib/src/rum_asset_bundle.dart b/packages/rum_sdk/lib/src/rum_asset_bundle.dart new file mode 100644 index 0000000..2eb4270 --- /dev/null +++ b/packages/rum_sdk/lib/src/rum_asset_bundle.dart @@ -0,0 +1,86 @@ + +import 'dart:typed_data'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/services.dart'; +import 'package:rum_sdk/rum_flutter.dart'; + +class RumAssetBundle extends AssetBundle{ + AssetBundle _bundle; + RumAssetBundle({ + AssetBundle? bundle +}): _bundle = bundle?? rootBundle; + + @override + Future load(String key) async { + ByteData? data; + int? dataSize; + try{ + var beforeLoad = DateTime.now().millisecondsSinceEpoch; + data = await _bundle.load(key); + var afterLoad = DateTime.now().millisecondsSinceEpoch; + int duration = afterLoad - beforeLoad; + dataSize = _getDataLength(data); + RumFlutter().pushEvent("Asset-load",attributes: { + "name":_getFileName(key), + "size":"$dataSize", + "duration":"$duration" + }); + } catch(exception){ + rethrow; + } + return data; + + } + @override + Future loadString(String key,{bool cache=true}) async{ + String? data; + int? dataSize; + try{ + var beforeLoad = DateTime.now().millisecondsSinceEpoch; + data = await _bundle.loadString(key,cache:cache); + var afterLoad = DateTime.now().millisecondsSinceEpoch; + int duration = afterLoad-beforeLoad; + dataSize = _getDataLength(data); + RumFlutter().pushEvent("Asset-load", attributes: { + "name":_getFileName(key), + "size":"$dataSize", + "duration":"$duration" + } + ); + } catch (exception){ + rethrow; + } + return data; + } + + + @override + Future loadStructuredData(String key, Future Function(String value) parser) { + return _bundle.loadStructuredData(key, parser); + } + + String? _getFileName(String key){ + final uri = Uri.tryParse(key); + if (uri == null) { + return key; + } + return uri.pathSegments.isEmpty ? key : uri.pathSegments.last; + } + + int? _getDataLength(dynamic data){ + int? dataLength; + if(data is List){ + dataLength = data.length; + } + else if(data is ByteData){ + dataLength = data.lengthInBytes; + } + else if (data is ImmutableBuffer){ + dataLength = data.length; + } + return dataLength; + + } + +} \ No newline at end of file diff --git a/packages/rum_sdk/lib/src/rum_navigation_observer.dart b/packages/rum_sdk/lib/src/rum_navigation_observer.dart new file mode 100644 index 0000000..c1f538c --- /dev/null +++ b/packages/rum_sdk/lib/src/rum_navigation_observer.dart @@ -0,0 +1,32 @@ +import 'package:flutter/widgets.dart'; +import 'package:rum_sdk/rum_sdk.dart'; + +class RumNavigationObserver extends RouteObserver>{ +@override + void didPop(Route route, Route? previousRoute) { + super.didPop(route, previousRoute); + RumFlutter().setViewMeta(name:previousRoute?.settings.name); + RumFlutter().pushEvent("view_changed",attributes: { + "route":previousRoute?.settings.name + }); + } + + + @override + void didPush(Route route, Route? previousRoute) { + super.didPush(route, previousRoute); + RumFlutter().setViewMeta(name:route.settings.name); + RumFlutter().pushEvent("view_changed",attributes: { + "route":route.settings.name + }); + + } + @override + void didReplace({Route? newRoute, Route? oldRoute}) { + super.didReplace(newRoute:newRoute, oldRoute:oldRoute); + RumFlutter().setViewMeta(name: newRoute?.settings.name!); + RumFlutter().pushEvent("view_changed",attributes: { + "route":newRoute?.settings.name + }); + } +} diff --git a/packages/rum_sdk/lib/src/rum_user_interaction_widget.dart b/packages/rum_sdk/lib/src/rum_user_interaction_widget.dart new file mode 100644 index 0000000..4a17423 --- /dev/null +++ b/packages/rum_sdk/lib/src/rum_user_interaction_widget.dart @@ -0,0 +1,223 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'dart:developer'; + +import '../rum_flutter.dart'; + +Element? _clickTrackerElement; +const _tapAreaSizeSquared = 20 * 20.0; + + +class UserInteractionProperties{ + Element? element; + String? elementType; + String? description; + String? eventType; + UserInteractionProperties({this.element,this.elementType,this.description,this.eventType}) { +} +} + +class RumUserInteractionWidget extends StatefulWidget { + final Widget child; + const RumUserInteractionWidget({Key? key, required this.child}) : super(key: key); + + @override + StatefulElement createElement() { + final element = super.createElement(); + _clickTrackerElement = element; + return element; + } + + @override + _RumUserInteractionWidgetState createState() => + _RumUserInteractionWidgetState(); +} + +class _RumUserInteractionWidgetState extends State { + int? _lastPointerId; + Offset? _lastPointerDownLocation; + + @override + Widget build(BuildContext context) { + return Listener( + behavior: HitTestBehavior.translucent, + onPointerDown: _onPointerDown, + onPointerUp: _onPointerUp, + child: widget.child, + ); + } + + void _onPointerDown(PointerDownEvent event) { + _lastPointerId = event.pointer; + _lastPointerDownLocation = event.localPosition; + } + + void _onPointerUp(PointerUpEvent event) { + if (_lastPointerDownLocation != null && event.pointer == _lastPointerId) { + final distanceOffset = Offset( + _lastPointerDownLocation!.dx - event.localPosition.dx, + _lastPointerDownLocation!.dy - event.localPosition.dy); + + final distanceSquared = distanceOffset.distanceSquared; + if (distanceSquared < _tapAreaSizeSquared) { + _onTapped(event.localPosition, "tap"); + } + } + } + + void _onTapped(Offset localPosition, String tap) { + final tappedElement = _findElementTapped(localPosition); + if(tappedElement !=null) { + RumFlutter().pushEvent('user_interaction', attributes: { + "element_type": tappedElement.elementType, + "element_description": tappedElement.description, + "event_type": tappedElement.eventType, + "event": "onClick" + }); + } + } + + UserInteractionProperties? _findElementTapped(Offset position) { + final rootElement = _clickTrackerElement; + if (rootElement == null || rootElement.widget != widget) { + return null; + } + UserInteractionProperties? tappedWidget; + void elementFind(Element element) { + if (tappedWidget != null) { + return; + } + final renderObject = element.renderObject; + if (renderObject == null) { + return null; + } + var hitFound = true; + final hitTest = BoxHitTestResult(); + if (renderObject is RenderPointerListener) { + final widgetName = element?.widget.toString(); + final widgetKey = element?.widget.key.toString(); + hitFound = renderObject.hitTest(hitTest, position: position); + } + final transform = renderObject.getTransformTo(rootElement.renderObject); + final paintBounds = + MatrixUtils.transformRect(transform, renderObject.paintBounds); + + if (!paintBounds.contains(position)) { + return; + } + + tappedWidget = _getWidgetfromElement(element); + + if (tappedWidget == null || !hitFound) { + tappedWidget = null; + element.visitChildElements(elementFind); + } + } + rootElement.visitChildElements(elementFind); + return tappedWidget; + } + + String _getElementDescription(Element element, {bool allowText = true}) { + String description = ""; + // traverse tree to find a suiting element + void descriptionFinder(Element element) { + bool foundDescription = false; + + final widget = element.widget; + if (allowText && widget is Text) { + final data = widget.data; + if (data != null && data.isNotEmpty) { + description = data; + foundDescription = true; + } + } else if (widget is Semantics) { + if (widget.properties.label?.isNotEmpty ?? false) { + description = widget.properties.label!; + foundDescription = true; + } + } else if (widget is Icon) { + if (widget.semanticLabel?.isNotEmpty ?? false) { + description = widget.semanticLabel!; + foundDescription = true; + } + } + + if (!foundDescription) { + element.visitChildren(descriptionFinder); + } + } + descriptionFinder(element); + return description; + } + + UserInteractionProperties? _getWidgetfromElement(Element element) { + final widget = element.widget; + if (widget is ButtonStyleButton) { + if (widget.enabled) { + return UserInteractionProperties( + element: element, + elementType: "ButtonStyleButton", + description: _getElementDescription(element), + eventType: "onClick" + ); + } + } + else if (widget is MaterialButton) { + if (widget.enabled) { + return UserInteractionProperties( + element: element, + elementType: "MaterialButton", + description: _getElementDescription(element), + eventType: "onClick" + ); + } + } else if (widget is CupertinoButton) { + if (widget.enabled) { + return UserInteractionProperties( + element: element, + elementType: "CupertinoButton", + description: _getElementDescription(element), + eventType: "onPressed" + ); + } + } else if (widget is PopupMenuButton) { + if (widget.enabled) { + return UserInteractionProperties( + element: element, + elementType: "PopupMenuButton", + description: _getElementDescription(element), + eventType: "onTap" + ); + } + } else if (widget is PopupMenuItem) { + if (widget.enabled) { + return UserInteractionProperties( + element: element, + elementType: "PopupMenuItem", + description: _getElementDescription(element), + eventType: "onTap" + ); + } + } else if (widget is InkWell) { + if (widget.onTap != null) { + return UserInteractionProperties( + element: element, + elementType: "InkWell", + description: _getElementDescription(element), + eventType: "onTap" + ); + } + } else if (widget is IconButton) { + if (widget.onPressed != null) { + return UserInteractionProperties( + element: element, + elementType: "IconButton", + description: _getElementDescription(element), + eventType: "onPressed" + ); + } + } + return null; + } + } \ No newline at end of file diff --git a/packages/rum_sdk/lib/src/rum_widgets_binding_observer.dart b/packages/rum_sdk/lib/src/rum_widgets_binding_observer.dart new file mode 100644 index 0000000..fe6620e --- /dev/null +++ b/packages/rum_sdk/lib/src/rum_widgets_binding_observer.dart @@ -0,0 +1,21 @@ +import 'package:flutter/cupertino.dart'; +import 'package:rum_sdk/src/integrations/native_integration.dart'; +import 'package:rum_sdk/rum_sdk.dart'; + +class RumWidgetsBindingObserver extends WidgetsBindingObserver{ + @override + void didChangeAppLifecycleState(AppLifecycleState state) { + super.didChangeAppLifecycleState(state); + if(state==AppLifecycleState.resumed){ + WidgetsBinding.instance!.addPostFrameCallback((timeStamp) { + NativeIntegration.instance.getWarmStart(); + }); + NativeIntegration.instance.setWarmStart(); + } + } + @override + void didHaveMemoryPressure() { + super.didHaveMemoryPressure(); + } + +} \ No newline at end of file diff --git a/packages/rum_sdk/lib/src/transport/batch_transport.dart b/packages/rum_sdk/lib/src/transport/batch_transport.dart new file mode 100644 index 0000000..3f884f9 --- /dev/null +++ b/packages/rum_sdk/lib/src/transport/batch_transport.dart @@ -0,0 +1,89 @@ +import 'dart:async'; +import 'package:rum_sdk/rum_sdk.dart'; +import 'package:rum_sdk/src/configurations/batch_config.dart'; +import 'package:rum_sdk/src/models/models.dart'; +import 'package:rum_sdk/src/transport/rum_base_transport.dart'; + +class BatchTransport { + int items=0; + Payload payload; + BatchConfig batchConfig; + List transports; + Timer? flushTimer; + BatchTransport({ required this.payload, required this.batchConfig, required this.transports}){ + if(batchConfig.enabled){ + Timer.periodic(batchConfig.sendTimeout,(Timer t){ + flushTimer = t; + flush(); + }); + } + else{ + batchConfig.payloadItemLimit = 1; + } + } + + + Future addEvent(Event event) async { + payload.events.add(event); + items++; + checkPayloadItemLimit(); + } + + Future addMeasurement(Measurement measurement) async { + payload.measurements.add(measurement); + items++; + checkPayloadItemLimit(); } + + Future addLog(RumLog rumLog) async { + payload.logs.add(rumLog); + items++; + checkPayloadItemLimit(); + } + Future addExceptions(RumException exception) async { + payload.exceptions.add(exception); + items++; + checkPayloadItemLimit(); + } + + void updatePayloadMeta(Meta meta){ + flush(); + payload.meta = meta; + } + + Future flush() async{ + if(isPayloadEmpty()){ + return; + } + if(transports.isNotEmpty){ + for (var transport in transports) { + await transport.send(payload); + } + } + resetPayload(); + } + + void checkPayloadItemLimit(){ + if(items >= batchConfig.payloadItemLimit){ + items =0; + flush(); + } + } + + void dispose(){ + flushTimer?.cancel(); + } + + bool isPayloadEmpty(){ + return (payload.events.isEmpty && + payload.measurements.isEmpty && + payload.logs.isEmpty && + payload.exceptions.isEmpty) ; + } + + void resetPayload(){ + payload.events = []; + payload.measurements = []; + payload.logs = []; + payload.exceptions = []; + } +} diff --git a/packages/rum_sdk/lib/src/transport/rum_base_transport.dart b/packages/rum_sdk/lib/src/transport/rum_base_transport.dart new file mode 100644 index 0000000..55a6f8f --- /dev/null +++ b/packages/rum_sdk/lib/src/transport/rum_base_transport.dart @@ -0,0 +1,6 @@ +import 'dart:async'; +import 'package:rum_sdk/src/models/models.dart'; + +abstract class BaseTransport { + Future send(Payload payload) async{} +} diff --git a/packages/rum_sdk/lib/src/transport/rum_transport.dart b/packages/rum_sdk/lib/src/transport/rum_transport.dart new file mode 100644 index 0000000..de88dd3 --- /dev/null +++ b/packages/rum_sdk/lib/src/transport/rum_transport.dart @@ -0,0 +1,33 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:developer'; +import 'package:http/http.dart' as http; +import 'package:rum_sdk/src/transport/rum_base_transport.dart'; +import 'package:rum_sdk/src/transport/task_buffer.dart'; +import 'package:rum_sdk/src/models/payload.dart'; + + +class RUMTransport extends BaseTransport { + final String collectorUrl; + final String apiKey; + TaskBuffer? _taskBuffer; + RUMTransport({required this.collectorUrl, required this.apiKey, maxBufferLimit = 30 }) { + _taskBuffer = TaskBuffer(maxBufferLimit); + } + + @override + Future send(Payload payload) async { + final headers = {'Content-Type': 'application/json', 'x-api-key': apiKey}; + final response = await _taskBuffer?.add((){ + return http.post( + Uri.parse(collectorUrl), + headers: headers, + body: jsonEncode(payload.toJson()), + ); + }); + if (response!= null && response?.statusCode ~/ 100 != 2) { + log("Error sending payload: ${response?.statusCode}"); + } + } + +} diff --git a/packages/rum_sdk/lib/src/transport/task_buffer.dart b/packages/rum_sdk/lib/src/transport/task_buffer.dart new file mode 100644 index 0000000..06d69a9 --- /dev/null +++ b/packages/rum_sdk/lib/src/transport/task_buffer.dart @@ -0,0 +1,30 @@ +import 'dart:async'; +import 'dart:developer'; + +typedef Task = Future Function(); + +class TaskBuffer { + TaskBuffer(this._maxBufferLimit); + + final int _maxBufferLimit; + int _bufferCount = 0; + + Future add(Task task) async { + if (_bufferCount >= _maxBufferLimit) { + log("Task Buffer is full, skipping task"); + return await Future.value(null); + } else { + _bufferCount++; + try { + return await task(); + } + catch (e) { + log("Error executing task: $e"); + return await Future.value(null); + } + finally { + _bufferCount--; + } + } + } +} \ No newline at end of file diff --git a/packages/rum_sdk/lib/src/util/generate_session.dart b/packages/rum_sdk/lib/src/util/generate_session.dart new file mode 100644 index 0000000..bd0d67e --- /dev/null +++ b/packages/rum_sdk/lib/src/util/generate_session.dart @@ -0,0 +1,12 @@ +import 'dart:math'; + +String generateSessionID(){ + const String chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; + final Random rnd = Random(); + const length = 10; + + return String.fromCharCodes(Iterable.generate( + length, (_) => chars.codeUnitAt(rnd.nextInt(chars.length)), + )); + +} \ No newline at end of file diff --git a/packages/rum_sdk/linux/CMakeLists.txt b/packages/rum_sdk/linux/CMakeLists.txt new file mode 100644 index 0000000..4329131 --- /dev/null +++ b/packages/rum_sdk/linux/CMakeLists.txt @@ -0,0 +1,47 @@ +# The Flutter tooling requires that developers have CMake 3.10 or later +# installed. You should not increase this version, as doing so will cause +# the plugin to fail to compile for some customers of the plugin. +cmake_minimum_required(VERSION 3.10) + +# Project-level configuration. +set(PROJECT_NAME "rum_sdk") +project(${PROJECT_NAME} LANGUAGES CXX) + +# This value is used when generating builds using this plugin, so it must +# not be changed. +set(PLUGIN_NAME "rum_sdk_plugin") + +# Define the plugin library target. Its name must not be changed (see comment +# on PLUGIN_NAME above). +# +# Any new source files that you add to the plugin should be added here. +add_library(${PLUGIN_NAME} SHARED + "rum_sdk_plugin.cc" +) + +# Apply a standard set of build settings that are configured in the +# application-level CMakeLists.txt. This can be removed for plugins that want +# full control over build settings. +apply_standard_settings(${PLUGIN_NAME}) + +# Symbols are hidden by default to reduce the chance of accidental conflicts +# between plugins. This should not be removed; any symbols that should be +# exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro. +set_target_properties(${PLUGIN_NAME} PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) + +# Source include directories and library dependencies. Add any plugin-specific +# dependencies here. +target_include_directories(${PLUGIN_NAME} INTERFACE + "${CMAKE_CURRENT_SOURCE_DIR}/include") +target_link_libraries(${PLUGIN_NAME} PRIVATE flutter) +target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK) + +# List of absolute paths to libraries that should be bundled with the plugin. +# This list could contain prebuilt libraries, or libraries created by an +# external build triggered from this build file. +set(rum_sdk_bundled_libraries + "" + PARENT_SCOPE +) diff --git a/packages/rum_sdk/linux/include/rum_sdk/rum_sdk_plugin.h b/packages/rum_sdk/linux/include/rum_sdk/rum_sdk_plugin.h new file mode 100644 index 0000000..c3688d2 --- /dev/null +++ b/packages/rum_sdk/linux/include/rum_sdk/rum_sdk_plugin.h @@ -0,0 +1,26 @@ +#ifndef FLUTTER_PLUGIN_RUM_SDK_PLUGIN_H_ +#define FLUTTER_PLUGIN_RUM_SDK_PLUGIN_H_ + +#include + +G_BEGIN_DECLS + +#ifdef FLUTTER_PLUGIN_IMPL +#define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default"))) +#else +#define FLUTTER_PLUGIN_EXPORT +#endif + +typedef struct _RumSdkPlugin RumSdkPlugin; +typedef struct { + GObjectClass parent_class; +} RumSdkPluginClass; + +FLUTTER_PLUGIN_EXPORT GType rum_sdk_plugin_get_type(); + +FLUTTER_PLUGIN_EXPORT void rum_sdk_plugin_register_with_registrar( + FlPluginRegistrar* registrar); + +G_END_DECLS + +#endif // FLUTTER_PLUGIN_RUM_SDK_PLUGIN_H_ diff --git a/packages/rum_sdk/linux/rum_sdk_plugin.cc b/packages/rum_sdk/linux/rum_sdk_plugin.cc new file mode 100644 index 0000000..b4b2cec --- /dev/null +++ b/packages/rum_sdk/linux/rum_sdk_plugin.cc @@ -0,0 +1,70 @@ +#include "include/rum_sdk/rum_sdk_plugin.h" + +#include +#include +#include + +#include + +#define RUM_SDK_PLUGIN(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj), rum_sdk_plugin_get_type(), \ + RumSdkPlugin)) + +struct _RumSdkPlugin { + GObject parent_instance; +}; + +G_DEFINE_TYPE(RumSdkPlugin, rum_sdk_plugin, g_object_get_type()) + +// Called when a method call is received from Flutter. +static void rum_sdk_plugin_handle_method_call( + RumSdkPlugin* self, + FlMethodCall* method_call) { + g_autoptr(FlMethodResponse) response = nullptr; + + const gchar* method = fl_method_call_get_name(method_call); + + if (strcmp(method, "getPlatformVersion") == 0) { + struct utsname uname_data = {}; + uname(&uname_data); + g_autofree gchar *version = g_strdup_printf("Linux %s", uname_data.version); + g_autoptr(FlValue) result = fl_value_new_string(version); + response = FL_METHOD_RESPONSE(fl_method_success_response_new(result)); + } else { + response = FL_METHOD_RESPONSE(fl_method_not_implemented_response_new()); + } + + fl_method_call_respond(method_call, response, nullptr); +} + +static void rum_sdk_plugin_dispose(GObject* object) { + G_OBJECT_CLASS(rum_sdk_plugin_parent_class)->dispose(object); +} + +static void rum_sdk_plugin_class_init(RumSdkPluginClass* klass) { + G_OBJECT_CLASS(klass)->dispose = rum_sdk_plugin_dispose; +} + +static void rum_sdk_plugin_init(RumSdkPlugin* self) {} + +static void method_call_cb(FlMethodChannel* channel, FlMethodCall* method_call, + gpointer user_data) { + RumSdkPlugin* plugin = RUM_SDK_PLUGIN(user_data); + rum_sdk_plugin_handle_method_call(plugin, method_call); +} + +void rum_sdk_plugin_register_with_registrar(FlPluginRegistrar* registrar) { + RumSdkPlugin* plugin = RUM_SDK_PLUGIN( + g_object_new(rum_sdk_plugin_get_type(), nullptr)); + + g_autoptr(FlStandardMethodCodec) codec = fl_standard_method_codec_new(); + g_autoptr(FlMethodChannel) channel = + fl_method_channel_new(fl_plugin_registrar_get_messenger(registrar), + "rum_sdk", + FL_METHOD_CODEC(codec)); + fl_method_channel_set_method_call_handler(channel, method_call_cb, + g_object_ref(plugin), + g_object_unref); + + g_object_unref(plugin); +} diff --git a/packages/rum_sdk/macos/Classes/RumSdkPlugin.swift b/packages/rum_sdk/macos/Classes/RumSdkPlugin.swift new file mode 100644 index 0000000..a6015fa --- /dev/null +++ b/packages/rum_sdk/macos/Classes/RumSdkPlugin.swift @@ -0,0 +1,19 @@ +import Cocoa +import FlutterMacOS + +public class RumSdkPlugin: NSObject, FlutterPlugin { + public static func register(with registrar: FlutterPluginRegistrar) { + let channel = FlutterMethodChannel(name: "rum_sdk", binaryMessenger: registrar.messenger) + let instance = RumSdkPlugin() + registrar.addMethodCallDelegate(instance, channel: channel) + } + + public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { + switch call.method { + case "getPlatformVersion": + result("macOS " + ProcessInfo.processInfo.operatingSystemVersionString) + default: + result(FlutterMethodNotImplemented) + } + } +} diff --git a/packages/rum_sdk/macos/rum_sdk.podspec b/packages/rum_sdk/macos/rum_sdk.podspec new file mode 100644 index 0000000..04d211c --- /dev/null +++ b/packages/rum_sdk/macos/rum_sdk.podspec @@ -0,0 +1,23 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint rum_sdk.podspec` to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'rum_sdk' + s.version = '0.0.1' + s.summary = 'A new Flutter plugin project.' + s.description = <<-DESC +A new Flutter plugin project. + DESC + s.homepage = 'http://example.com' + s.license = { :file => '../LICENSE' } + s.author = { 'Your Company' => 'email@example.com' } + + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.dependency 'FlutterMacOS' + + s.platform = :osx, '10.11' + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } + s.swift_version = '5.0' +end diff --git a/packages/rum_sdk/pubspec.lock b/packages/rum_sdk/pubspec.lock new file mode 100644 index 0000000..c87f963 --- /dev/null +++ b/packages/rum_sdk/pubspec.lock @@ -0,0 +1,618 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + url: "https://pub.dev" + source: hosted + version: "67.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + url: "https://pub.dev" + source: hosted + version: "6.4.1" + args: + dependency: transitive + description: + name: args + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + url: "https://pub.dev" + source: hosted + version: "2.5.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" + url: "https://pub.dev" + source: hosted + version: "4.0.1" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "3ac61a79bfb6f6cc11f693591063a7f19a7af628dc52f141743edac5c16e8c22" + url: "https://pub.dev" + source: hosted + version: "2.4.9" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "4ae8ffe5ac758da294ecf1802f2aff01558d8b1b00616aa7538ea9a8a5d50799" + url: "https://pub.dev" + source: hosted + version: "7.3.0" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb + url: "https://pub.dev" + source: hosted + version: "8.9.2" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 + url: "https://pub.dev" + source: hosted + version: "4.10.0" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" + url: "https://pub.dev" + source: hosted + version: "2.3.6" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + graphs: + dependency: transitive + description: + name: graphs + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + http: + dependency: transitive + description: + name: http + sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf + url: "https://pub.dev" + source: hosted + version: "0.19.0" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf + url: "https://pub.dev" + source: hosted + version: "0.7.1" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + url: "https://pub.dev" + source: hosted + version: "10.0.4" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + url: "https://pub.dev" + source: hosted + version: "3.0.3" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + url: "https://pub.dev" + source: hosted + version: "3.0.0" + logging: + dependency: transitive + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + url: "https://pub.dev" + source: hosted + version: "0.8.0" + meta: + dependency: transitive + description: + name: meta + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + mime: + dependency: transitive + description: + name: mime + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" + url: "https://pub.dev" + source: hosted + version: "1.0.5" + mocktail: + dependency: "direct dev" + description: + name: mocktail + sha256: c4b5007d91ca4f67256e720cb1b6d704e79a510183a12fa551021f652577dce6 + url: "https://pub.dev" + source: hosted + version: "1.0.3" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + package_info_plus: + dependency: "direct main" + description: + name: package_info_plus + sha256: cb44f49b6e690fa766f023d5b22cac6b9affe741dd792b6ac7ad4fabe0d7b097 + url: "https://pub.dev" + source: hosted + version: "6.0.0" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + plugin_platform_interface: + dependency: "direct main" + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" + source: hosted + version: "1.2.3" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + uuid: + dependency: "direct main" + description: + name: uuid + sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8" + url: "https://pub.dev" + source: hosted + version: "4.4.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + url: "https://pub.dev" + source: hosted + version: "14.2.1" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42" + url: "https://pub.dev" + source: hosted + version: "2.4.5" + win32: + dependency: transitive + description: + name: win32 + sha256: "0a989dc7ca2bb51eac91e8fd00851297cfffd641aa7538b165c62637ca0eaa4a" + url: "https://pub.dev" + source: hosted + version: "5.4.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.19.0" diff --git a/packages/rum_sdk/pubspec.yaml b/packages/rum_sdk/pubspec.yaml new file mode 100644 index 0000000..1231669 --- /dev/null +++ b/packages/rum_sdk/pubspec.yaml @@ -0,0 +1,39 @@ +publish_to: none +name: rum_sdk +description: A new Flutter plugin project. +version: 1.0.0 + +environment: + sdk: '>=3.0.0 <4.0.0' + flutter: ">=3.0.0" + +dependencies: + plugin_platform_interface: ^2.0.2 + package_info_plus: ^6.0.0 + uuid: ^4.1.0 + intl: ^0.19.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^3.0.2 + build_runner: ^2.4.8 + mocktail: ^1.0.3 +# mockito: ^5.4.4 + +flutter: + + plugin: + platforms: + android: + package: com.example.rum_sdk + pluginClass: RumSdkPlugin + ios: + pluginClass: RumSdkPlugin + linux: + pluginClass: RumSdkPlugin + macos: + pluginClass: RumSdkPlugin + windows: + pluginClass: RumSdkPluginCApi + diff --git a/packages/rum_sdk/test/unit_test/batch_transport_test.dart b/packages/rum_sdk/test/unit_test/batch_transport_test.dart new file mode 100644 index 0000000..815a579 --- /dev/null +++ b/packages/rum_sdk/test/unit_test/batch_transport_test.dart @@ -0,0 +1,156 @@ +import 'dart:async'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; +import 'package:rum_sdk/rum_sdk.dart'; +import 'package:rum_sdk/src/configurations/batch_config.dart'; +import 'package:rum_sdk/src/models/models.dart'; +import 'package:rum_sdk/src/transport/rum_base_transport.dart'; +import 'package:rum_sdk/src/transport/batch_transport.dart'; + +class MockPayload extends Mock implements Payload {} +class MockBatchConfig extends Mock implements BatchConfig {} +class MockBaseTransport extends Mock implements BaseTransport {} + +void main() { + late MockPayload mockPayload; + late MockBatchConfig mockBatchConfig; + late MockBaseTransport mockBaseTransport; + late BatchTransport batchTransport; + + setUp(() { + mockPayload = MockPayload(); + mockBatchConfig = MockBatchConfig(); + mockBaseTransport =MockBaseTransport(); + + when(() => mockBatchConfig.enabled).thenReturn(true); + when(() => mockBatchConfig.sendTimeout).thenReturn(Duration(seconds: 1)); + when(() => mockBatchConfig.payloadItemLimit).thenReturn(2); + when(() => mockPayload.events).thenReturn([]); + when(() => mockPayload.measurements).thenReturn([]); + when(() => mockPayload.logs).thenReturn([]); + when(() => mockPayload.exceptions).thenReturn([]); + when(() => mockBaseTransport.send(any())).thenAnswer((_) async {}); + batchTransport = BatchTransport( + payload: mockPayload, + transports: [mockBaseTransport], + batchConfig: BatchConfig(), + ); + + }); + + setUpAll((){ + registerFallbackValue(Payload(Meta())); + + }); + + tearDown(() { + batchTransport.dispose(); + }); + + test('addEvent should add event and check payload item limit', () async { + final event = Event("test_event"); + await batchTransport.addEvent(event); + verify(() => mockPayload.events.add(event)).called(1); + expect(batchTransport.items, equals(1)); + }); + + test('addMeasurement should add measurement and check payload item limit', () async { + final measurement = Measurement({"test_value":12}, "test") ; + await batchTransport.addMeasurement(measurement); + verify(() => mockPayload.measurements.add(measurement)).called(1); + expect(batchTransport.items, equals(1)); + }); + + test('addLog should add log and check payload item limit', () async { + final log = RumLog("Test log"); + await batchTransport.addLog(log); + verify(() => mockPayload.logs.add(log)).called(1); + expect(batchTransport.items, equals(1)); + }); + + test('addExceptions should add exception and check payload item limit', () async { + final exception = RumException("TestException", "Test", {}); + await batchTransport.addExceptions(exception); + verify(() => mockPayload.exceptions.add(exception)).called(1); + expect(batchTransport.items, equals(1)); + }); + // + test('flush should send payload and reset it', () async { + final exception = RumException("TestException", "Test", {}); + await batchTransport.addExceptions(exception); + await batchTransport.flush(); + verify(() => mockBaseTransport.send(any())).called(1); + verify(() => mockPayload.events = []).called(1); + verify(() => mockPayload.measurements = []).called(1); + verify(() => mockPayload.logs = []).called(1); + verify(() => mockPayload.exceptions = []).called(1); + }); + test('flush should not send empty payload', () async { + when(() => mockPayload.events).thenReturn([]); + when(() => mockPayload.measurements).thenReturn([]); + when(() => mockPayload.logs).thenReturn([]); + when(() => mockPayload.exceptions).thenReturn([]); + await batchTransport.flush(); + verifyNever(() => mockBaseTransport.send(any())); + }); + test('checkPayloadItemLimit should flush when item limit is reached', () async { + final event = Event("test_event"); + batchTransport = BatchTransport( + payload: mockPayload, + transports: [mockBaseTransport], + batchConfig:BatchConfig(sendTimeout: const Duration(seconds: 5),payloadItemLimit: 1) + ); + await batchTransport.addEvent(event); + await batchTransport.addEvent(event); // This should trigger flush + verify(() => mockBaseTransport.send(any())).called(2); + }); + test('dispose should cancel flush timer', () { + batchTransport.dispose(); + expect(batchTransport.flushTimer, isNull); + }); + test('isPayloadEmpty should return true if payload is empty', () { + when(() => mockPayload.events).thenReturn([]); + when(() => mockPayload.measurements).thenReturn([]); + when(() => mockPayload.logs).thenReturn([]); + when(() => mockPayload.exceptions).thenReturn([]); + + expect(batchTransport.isPayloadEmpty(), isTrue); + }); + test('isPayloadEmpty should return false if payload is not empty', () { + when(() => mockPayload.events).thenReturn([Event("test_event")]); + when(() => mockPayload.measurements).thenReturn([]); + when(() => mockPayload.logs).thenReturn([]); + when(() => mockPayload.exceptions).thenReturn([]); + + expect(batchTransport.isPayloadEmpty(), isFalse); + }); + + test('resetPayload should clear all payloads', () { + batchTransport.resetPayload(); + verify(() => mockPayload.events = []).called(1); + verify(() => mockPayload.measurements = []).called(1); + verify(() => mockPayload.logs = []).called(1); + verify(() => mockPayload.exceptions = []).called(1); + }); + test('constructor with batchConfig disabled should set payloadItemLimit to 1', () { + final batchTransportDisabled = BatchTransport( + payload: mockPayload, + batchConfig: BatchConfig(enabled: false), + transports: [mockBaseTransport], + ); + expect(batchTransportDisabled.batchConfig.payloadItemLimit, equals(1)); + }); + test('addEvent should flush immediately if batchConfig is disabled and not wait for timeout', () async { + when(() => mockBatchConfig.enabled).thenReturn(false); + final batchTransportDisabled = BatchTransport( + payload: mockPayload, + batchConfig: BatchConfig(sendTimeout: const Duration(seconds:10)), + transports: [mockBaseTransport], + ); + + final event = Event("test_event"); + await batchTransportDisabled.addEvent(event); + await Future.delayed(const Duration(milliseconds: 500)); + verify(() => mockBaseTransport.send(any())).called(1); + }); +} diff --git a/packages/rum_sdk/test/unit_test/flutter_error_integration_test.dart b/packages/rum_sdk/test/unit_test/flutter_error_integration_test.dart new file mode 100644 index 0000000..aa29732 --- /dev/null +++ b/packages/rum_sdk/test/unit_test/flutter_error_integration_test.dart @@ -0,0 +1,63 @@ +import 'package:flutter/foundation.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; +import 'package:rum_sdk/rum_sdk.dart'; +import 'package:rum_sdk/src/transport/batch_transport.dart'; + +class Functions { + void defaultOnError(FlutterErrorDetails details) async { + return; + } +} + +class MockFunctions extends Mock implements Functions {} +class MockRUMTransport extends Mock implements RUMTransport {} +class MockBatchTransport extends Mock implements BatchTransport {} + +void main(){ + group('Flutter Error Integration', (){ + + late MockBatchTransport mockBatchTransport; + late FlutterErrorDetails flutterErrorDetails; + late MockFunctions mockFunctions; + + setUpAll((){ + registerFallbackValue(FlutterErrorDetails(exception: FlutterError("Fallback Error"))); + registerFallbackValue(RumException("exception", "test exception", {})); + }); + + setUp((){ + mockBatchTransport = MockBatchTransport(); + mockFunctions = MockFunctions(); + RumFlutter().batchTransport = mockBatchTransport; + when(()=> mockBatchTransport.addExceptions(any())).thenAnswer((_) async {}); + flutterErrorDetails = FlutterErrorDetails(exception: FlutterError("Test Error"),stack: StackTrace.fromString("Test Stack Trace")); + }); + + tearDown((){}); + + test("call method should push errors to rum when error occurs ", (){ + FlutterError.onError = null; + FlutterErrorIntegration().call(); + FlutterError.onError?.call(flutterErrorDetails); + verify(()=>mockBatchTransport.addExceptions(any())).called(1); + }); + + test('Default error handler executes after Pushing Errors', () { + FlutterError.onError = mockFunctions.defaultOnError; + FlutterErrorIntegration().call(); + + FlutterError.onError?.call(flutterErrorDetails); + verify(() => mockBatchTransport.addExceptions(any())).called(1); + verify(() => mockFunctions.defaultOnError(flutterErrorDetails)).called(1); + }); + + test('Closing Flutter Error Integration sets back the default error handler', () { + FlutterErrorIntegration flutterErrorIntegration = FlutterErrorIntegration(); + FlutterError.onError = mockFunctions.defaultOnError; + flutterErrorIntegration.call(); + flutterErrorIntegration.close(); + expect(FlutterError.onError, mockFunctions.defaultOnError); + }); + }); +} diff --git a/packages/rum_sdk/test/unit_test/http_tracking_client_test.dart b/packages/rum_sdk/test/unit_test/http_tracking_client_test.dart new file mode 100644 index 0000000..71a17cc --- /dev/null +++ b/packages/rum_sdk/test/unit_test/http_tracking_client_test.dart @@ -0,0 +1,66 @@ +import 'dart:async'; +import 'dart:io'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; +import 'package:rum_sdk/rum_sdk.dart'; +import 'package:rum_sdk/src/transport/batch_transport.dart'; + +class MockHttpClient extends Mock implements HttpClient {} +class MockHttpClientRequest extends Mock implements HttpClientRequest {} +class MockHttpClientResponse extends Mock implements HttpClientResponse {} +class MockStreamSubscription extends Mock implements StreamSubscription {} + +void main() { + group('RumHttpTrackingClient', () { + late MockHttpClient mockHttpClient; + late RumHttpTrackingClient rumHttpTrackingClient; + + setUp(() { + mockHttpClient = MockHttpClient(); + rumHttpTrackingClient = RumHttpTrackingClient(mockHttpClient); + }); + + + test('openUrl should call innerClient.openUrl', () async { + final mockHttpClientRequest = MockHttpClientRequest(); + final url = Uri.parse('http://example.com/path'); + + when(() => mockHttpClient.openUrl('GET', url)).thenAnswer((_) async => mockHttpClientRequest); + + final requestFuture = rumHttpTrackingClient.openUrl('GET', url); + + verify(() => mockHttpClient.openUrl('GET', url)).called(1); + + expect(await requestFuture, isA()); + }); + }); + + group('RumTrackingHttpClientRequest', () { + late MockHttpClientRequest mockHttpClientRequest; + late RumTrackingHttpClientRequest rumTrackingHttpClientRequest; + late Map userAttributes; + + setUp(() { + mockHttpClientRequest = MockHttpClientRequest(); + userAttributes = { + 'method': 'GET', + 'url': 'http://example.com/path', + }; + rumTrackingHttpClientRequest = RumTrackingHttpClientRequest('key', mockHttpClientRequest, userAttributes); + }); + + test('close should call innerContext.close ', () async { + final mockHttpClientResponse = MockHttpClientResponse(); + when(() => mockHttpClientRequest.close()).thenAnswer((_) async => mockHttpClientResponse); + + final responseFuture = rumTrackingHttpClientRequest.close(); + + + verify(() => mockHttpClientRequest.close()).called(1); + + expect(await responseFuture, isA()); + }); + + }); +} + diff --git a/packages/rum_sdk/test/unit_test/native_integration_test.dart b/packages/rum_sdk/test/unit_test/native_integration_test.dart new file mode 100644 index 0000000..4dad1ad --- /dev/null +++ b/packages/rum_sdk/test/unit_test/native_integration_test.dart @@ -0,0 +1,51 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:mocktail/mocktail.dart'; +import 'package:rum_sdk/rum_flutter.dart'; +import 'dart:async'; +import 'package:rum_sdk/rum_native_methods.dart'; +import 'package:rum_sdk/rum_sdk.dart'; + +class MockRumFlutter extends Mock implements RumFlutter {} +class MockNativeChannel extends Mock implements RumNativeMethods {} + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + late MockRumFlutter mockRumFlutter; + late MockNativeChannel mockNativeChannel; + late NativeIntegration nativeIntegration; + + setUp(() { + mockRumFlutter = MockRumFlutter(); + mockNativeChannel = MockNativeChannel(); + nativeIntegration = NativeIntegration(); + + when(() => mockRumFlutter.nativeChannel).thenReturn(mockNativeChannel); + when(() => mockNativeChannel.getMemoryUsage()).thenAnswer((_) async => 50.0); + when(() => mockNativeChannel.initRefreshRate()).thenAnswer((_) async {}); + + RumFlutter.instance = mockRumFlutter; + }); + + group('NativeIntegration', () { + test('init initializes refresh rate and method channel', () async { + + nativeIntegration.init( + memusage: true, + cpuusage: true, + anr: true, + refreshrate: true, + setSendUsageInterval: Duration(seconds: 60), + ); + + verify(() => mockNativeChannel.initRefreshRate()).called(1); + }); + + test('getWarmStart correctly pushes warm start measurement', () async { + nativeIntegration.setWarmStart(); + await Future.delayed(Duration(milliseconds: 10)); + nativeIntegration.getWarmStart(); + + verify(() => mockRumFlutter.pushMeasurement(any(), "app_startup")).called(1); + }); + }); +} diff --git a/packages/rum_sdk/test/unit_test/on_error_integration_test.dart b/packages/rum_sdk/test/unit_test/on_error_integration_test.dart new file mode 100644 index 0000000..11ca940 --- /dev/null +++ b/packages/rum_sdk/test/unit_test/on_error_integration_test.dart @@ -0,0 +1,65 @@ +import 'package:mocktail/mocktail.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'dart:ui'; + +class MockPlatformDispatcher extends Mock implements PlatformDispatcher {} + +class OnErrorIntegration { + final PlatformDispatcher platformDispatcher; + + OnErrorIntegration({required this.platformDispatcher}); + + bool isOnErrorSupported() { + try { + platformDispatcher.onError; + return true; + } catch (e) { + return false; + } + } +} + +void main() { + late OnErrorIntegration onErrorIntegration; + late MockPlatformDispatcher mockPlatformDispatcher; + + setUp(() { + mockPlatformDispatcher = MockPlatformDispatcher(); + onErrorIntegration = OnErrorIntegration(platformDispatcher: mockPlatformDispatcher); + }); + + test('call method sets up error integration correctly', () { + when(() => mockPlatformDispatcher.onError).thenReturn((_, __) => true); + + final result = onErrorIntegration.isOnErrorSupported(); + + expect(result, true); + }); + + test('isOnErrorSupported returns false when onError is not supported', () { + when(() => mockPlatformDispatcher.onError).thenThrow(NoSuchMethodError.withInvocation( + mockPlatformDispatcher, + Invocation.getter(#onError), + )); + + final result = onErrorIntegration.isOnErrorSupported(); + + expect(result, false); + }); + + test('isOnErrorSupported returns false when onError throws an exception', () { + when(() => mockPlatformDispatcher.onError).thenThrow(Exception()); + + final result = onErrorIntegration.isOnErrorSupported(); + + expect(result, false); + }); + + test('isOnErrorSupported returns true when onError is supported', () { + when(() => mockPlatformDispatcher.onError).thenReturn((_, __) => true); + + final result = onErrorIntegration.isOnErrorSupported(); + + expect(result, true); + }); +} diff --git a/packages/rum_sdk/test/unit_test/rum_flutter_test.dart b/packages/rum_sdk/test/unit_test/rum_flutter_test.dart new file mode 100644 index 0000000..23522e8 --- /dev/null +++ b/packages/rum_sdk/test/unit_test/rum_flutter_test.dart @@ -0,0 +1,119 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:flutter/foundation.dart'; +import 'package:mocktail/mocktail.dart'; +import 'package:rum_sdk/rum_native_methods.dart'; +import 'package:rum_sdk/src/transport/batch_transport.dart'; + +import 'package:rum_sdk/rum_sdk.dart'; + +class MockRUMTransport extends Mock implements RUMTransport {} +class MockBatchTransport extends Mock implements BatchTransport {} +class MockRumNativeMethods extends Mock implements RumNativeMethods {} + + +void main(){ + + group('RUM Flutter initialization', (){ + + late MockRUMTransport mockRUMTransport; + late MockBatchTransport mockBatchTransport; + late MockRumNativeMethods mockRumNativeMethods; + setUp(() { + registerFallbackValue(RumException("test", "something", {"frames":[]})); + registerFallbackValue(Event("test", attributes: {"test":"test"})); + registerFallbackValue(RumLog("This is a message")); + registerFallbackValue(Measurement({"test":123},"test")); + registerFallbackValue(Payload(Meta())); + mockRUMTransport = MockRUMTransport(); + mockBatchTransport = MockBatchTransport(); + mockRumNativeMethods = MockRumNativeMethods(); + RumFlutter().transports = [mockRUMTransport]; + RumFlutter().nativeChannel = mockRumNativeMethods; + RumFlutter().batchTransport = mockBatchTransport; + when(()=>mockRumNativeMethods.enableCrashReporter(any())).thenAnswer((_) async {}); + when(()=>mockBatchTransport.addExceptions(any())).thenAnswer((_) async {}); + when(()=>mockBatchTransport.addLog(any())).thenAnswer((_) async {}); + when(()=>mockBatchTransport.addEvent(any())).thenAnswer((_) async {}); + when(()=>mockBatchTransport.addMeasurement(any())).thenAnswer((_) async {}); + when(()=>mockRUMTransport.send(any())).thenAnswer((_) async {}); + }); + tearDown(() {}); + test('init called with no error', () async{ + TestWidgetsFlutterBinding.ensureInitialized(); + var rumConfig = RumConfig( + appName: "TestApp", + appVersion: "2.0.3", + appEnv: "Test", + apiKey: "TestAPIKey", + anrTracking: true, + cpuUsageVitals: false, + memoryUsageVitals: false, + refreshRateVitals: false, + fetchVitalsInterval: const Duration(seconds: 30), + ); + + await RumFlutter().init( optionsConfiguration: rumConfig + ); + expect(RumFlutter().meta.app?.name, rumConfig.appName); + expect(RumFlutter().meta.app?.version, rumConfig.appVersion); + expect(RumFlutter().meta.app?.environment, rumConfig.appEnv); + verify(()=>mockBatchTransport.addEvent(any())).called(1); + }); + + + test("set App Meta data",(){ + RumFlutter().setAppMeta(appName: "TestApp", appEnv: "TestEnv", appVersion: "2.0.3"); + expect(RumFlutter().meta.app?.name, "TestApp"); + expect(RumFlutter().meta.app?.environment, "TestEnv"); + expect(RumFlutter().meta.app?.version, "2.0.3"); + }); + + test("set user meta data ",(){ + RumFlutter().setUserMeta(userId: "testuserid",userName:"testusername" ,userEmail: "testusermail@example.com"); + expect(RumFlutter().meta.user?.id, "testuserid"); + expect(RumFlutter().meta.user?.username, "testusername"); + expect(RumFlutter().meta.user?.email, "testusermail@example.com"); + }); + test("set view meta data ",(){ + RumFlutter().setViewMeta(name: 'Testview'); + expect(RumFlutter().meta.view?.name, "Testview"); + }); + + test("send custom event",(){ + const eventName = "TestEvent"; + const eventAttributes = {"testkey":"testvalue"}; + RumFlutter().pushEvent(eventName, attributes: eventAttributes); + verify(()=>mockBatchTransport.addEvent(any())).called(1); + }); + test("send custom log",(){ + const logMessage = "Log Message"; + const logLevel = "info"; + const logContext = {"testkey":"testvalue"}; + const trace = {"traceId":"testtraceid","spanId":"testspanid"}; + RumFlutter().pushLog(logMessage, level: logLevel, context: logContext, trace: trace); + verify(()=>mockBatchTransport.addLog(any())).called(1); + }); + test("send Error Logs",(){ + var flutterErrorDetails = FlutterErrorDetails(exception: FlutterError("Test Error")); + const errorType = "flutter_error"; + RumFlutter().pushError(type:errorType, value: flutterErrorDetails.exception.toString(), stacktrace: flutterErrorDetails.stack ); + Map parsedStackTrace = {}; + if(flutterErrorDetails.stack != null){ + parsedStackTrace = {"frames":RumException.stackTraceParse(flutterErrorDetails.stack!)}; + } + verify(()=>mockBatchTransport.addExceptions(any())).called(1); + }); + test("send custom measurement",(){ + const measurementType = "TestMeasurement"; + const measurementValue = { + "key1":1233, + "key2":100 + }; + RumFlutter().pushMeasurement(measurementValue, measurementType); + verify(()=>mockBatchTransport.addMeasurement(any())).called(1); + }); + + + }); + +} \ No newline at end of file diff --git a/packages/rum_sdk/windows/.gitignore b/packages/rum_sdk/windows/.gitignore new file mode 100644 index 0000000..b3eb2be --- /dev/null +++ b/packages/rum_sdk/windows/.gitignore @@ -0,0 +1,17 @@ +flutter/ + +# Visual Studio user-specific files. +*.suo +*.user +*.userosscache +*.sln.docstates + +# Visual Studio build-related files. +x64/ +x86/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ diff --git a/packages/rum_sdk/windows/CMakeLists.txt b/packages/rum_sdk/windows/CMakeLists.txt new file mode 100644 index 0000000..641a6b2 --- /dev/null +++ b/packages/rum_sdk/windows/CMakeLists.txt @@ -0,0 +1,53 @@ +# The Flutter tooling requires that developers have a version of Visual Studio +# installed that includes CMake 3.14 or later. You should not increase this +# version, as doing so will cause the plugin to fail to compile for some +# customers of the plugin. +cmake_minimum_required(VERSION 3.14) + +# Project-level configuration. +set(PROJECT_NAME "rum_sdk") +project(${PROJECT_NAME} LANGUAGES CXX) + +# This value is used when generating builds using this plugin, so it must +# not be changed +set(PLUGIN_NAME "rum_sdk_plugin") + +# Any new source files that you add to the plugin should be added here. +list(APPEND PLUGIN_SOURCES + "rum_sdk_plugin.cpp" + "rum_sdk_plugin.h" +) + +# Define the plugin library target. Its name must not be changed (see comment +# on PLUGIN_NAME above). +add_library(${PLUGIN_NAME} SHARED + "include/rum_sdk/rum_sdk_plugin_c_api.h" + "rum_sdk_plugin_c_api.cpp" + ${PLUGIN_SOURCES} +) + +# Apply a standard set of build settings that are configured in the +# application-level CMakeLists.txt. This can be removed for plugins that want +# full control over build settings. +apply_standard_settings(${PLUGIN_NAME}) + +# Symbols are hidden by default to reduce the chance of accidental conflicts +# between plugins. This should not be removed; any symbols that should be +# exported should be explicitly exported with the FLUTTER_PLUGIN_EXPORT macro. +set_target_properties(${PLUGIN_NAME} PROPERTIES + CXX_VISIBILITY_PRESET hidden) +target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) + +# Source include directories and library dependencies. Add any plugin-specific +# dependencies here. +target_include_directories(${PLUGIN_NAME} INTERFACE + "${CMAKE_CURRENT_SOURCE_DIR}/include") +target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) + +# List of absolute paths to libraries that should be bundled with the plugin. +# This list could contain prebuilt libraries, or libraries created by an +# external build triggered from this build file. +set(rum_sdk_bundled_libraries + "" + PARENT_SCOPE +) diff --git a/packages/rum_sdk/windows/include/rum_sdk/rum_sdk_plugin_c_api.h b/packages/rum_sdk/windows/include/rum_sdk/rum_sdk_plugin_c_api.h new file mode 100644 index 0000000..8eefb7d --- /dev/null +++ b/packages/rum_sdk/windows/include/rum_sdk/rum_sdk_plugin_c_api.h @@ -0,0 +1,23 @@ +#ifndef FLUTTER_PLUGIN_RUM_SDK_PLUGIN_C_API_H_ +#define FLUTTER_PLUGIN_RUM_SDK_PLUGIN_C_API_H_ + +#include + +#ifdef FLUTTER_PLUGIN_IMPL +#define FLUTTER_PLUGIN_EXPORT __declspec(dllexport) +#else +#define FLUTTER_PLUGIN_EXPORT __declspec(dllimport) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + +FLUTTER_PLUGIN_EXPORT void RumSdkPluginCApiRegisterWithRegistrar( + FlutterDesktopPluginRegistrarRef registrar); + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // FLUTTER_PLUGIN_RUM_SDK_PLUGIN_C_API_H_ diff --git a/packages/rum_sdk/windows/rum_sdk_plugin.cpp b/packages/rum_sdk/windows/rum_sdk_plugin.cpp new file mode 100644 index 0000000..175dd62 --- /dev/null +++ b/packages/rum_sdk/windows/rum_sdk_plugin.cpp @@ -0,0 +1,59 @@ +#include "rum_sdk_plugin.h" + +// This must be included before many other Windows headers. +#include + +// For getPlatformVersion; remove unless needed for your plugin implementation. +#include + +#include +#include +#include + +#include +#include + +namespace rum_sdk { + +// static +void RumSdkPlugin::RegisterWithRegistrar( + flutter::PluginRegistrarWindows *registrar) { + auto channel = + std::make_unique>( + registrar->messenger(), "rum_sdk", + &flutter::StandardMethodCodec::GetInstance()); + + auto plugin = std::make_unique(); + + channel->SetMethodCallHandler( + [plugin_pointer = plugin.get()](const auto &call, auto result) { + plugin_pointer->HandleMethodCall(call, std::move(result)); + }); + + registrar->AddPlugin(std::move(plugin)); +} + +RumSdkPlugin::RumSdkPlugin() {} + +RumSdkPlugin::~RumSdkPlugin() {} + +void RumSdkPlugin::HandleMethodCall( + const flutter::MethodCall &method_call, + std::unique_ptr> result) { + if (method_call.method_name().compare("getPlatformVersion") == 0) { + std::ostringstream version_stream; + version_stream << "Windows "; + if (IsWindows10OrGreater()) { + version_stream << "10+"; + } else if (IsWindows8OrGreater()) { + version_stream << "8"; + } else if (IsWindows7OrGreater()) { + version_stream << "7"; + } + result->Success(flutter::EncodableValue(version_stream.str())); + } else { + result->NotImplemented(); + } +} + +} // namespace rum_sdk diff --git a/packages/rum_sdk/windows/rum_sdk_plugin.h b/packages/rum_sdk/windows/rum_sdk_plugin.h new file mode 100644 index 0000000..5a21a59 --- /dev/null +++ b/packages/rum_sdk/windows/rum_sdk_plugin.h @@ -0,0 +1,32 @@ +#ifndef FLUTTER_PLUGIN_RUM_SDK_PLUGIN_H_ +#define FLUTTER_PLUGIN_RUM_SDK_PLUGIN_H_ + +#include +#include + +#include + +namespace rum_sdk { + +class RumSdkPlugin : public flutter::Plugin { + public: + static void RegisterWithRegistrar(flutter::PluginRegistrarWindows *registrar); + + RumSdkPlugin(); + + virtual ~RumSdkPlugin(); + + // Disallow copy and assign. + RumSdkPlugin(const RumSdkPlugin&) = delete; + RumSdkPlugin& operator=(const RumSdkPlugin&) = delete; + + private: + // Called when a method is called on this plugin's channel from Dart. + void HandleMethodCall( + const flutter::MethodCall &method_call, + std::unique_ptr> result); +}; + +} // namespace rum_sdk + +#endif // FLUTTER_PLUGIN_RUM_SDK_PLUGIN_H_ diff --git a/packages/rum_sdk/windows/rum_sdk_plugin_c_api.cpp b/packages/rum_sdk/windows/rum_sdk_plugin_c_api.cpp new file mode 100644 index 0000000..5d2ebeb --- /dev/null +++ b/packages/rum_sdk/windows/rum_sdk_plugin_c_api.cpp @@ -0,0 +1,12 @@ +#include "include/rum_sdk/rum_sdk_plugin_c_api.h" + +#include + +#include "rum_sdk_plugin.h" + +void RumSdkPluginCApiRegisterWithRegistrar( + FlutterDesktopPluginRegistrarRef registrar) { + rum_sdk::RumSdkPlugin::RegisterWithRegistrar( + flutter::PluginRegistrarManager::GetInstance() + ->GetRegistrar(registrar)); +} diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..822a73f --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,11 @@ +publish_to: none +name: rum_flutter +description: Flutter Real User Monitoring +version: 1.0.0 + +environment: + sdk: ">=3.0.0 <4.0.0" + +dependencies: +dev_dependencies: + melos: ^6.0.0