ios如何生成crash报告
#include <signal.h>
#include <execinfo.h> void OnProcessExceptionHandler(int sigl)
{
do
{
std::string str = ""; void* arrayList[];
int count = backtrace(arrayList, );
char** pStr = backtrace_symbols(arrayList, count);
if (pStr == NULL)
break; for (int i=; i<count; i++)
{
str += pStr[i];
str += "\n";
} if (str.size() <= )
break; char buffer[] = "";
time_t t = time(NULL);
tm* pTm = localtime(&t);
sprintf(buffer, "[TRACE]%02d:%02d:%02d : \n", pTm->tm_hour,pTm->tm_min,pTm->tm_sec); std::string logFile = "";//writeable dir
logFile += "exception.txt";
FILE* pFile = fopen(logFile.c_str(), "ab");
if (pFile == NULL)
break; fwrite(buffer, strlen(buffer), , pFile);
fwrite(str.c_str(), str.size(), , pFile);
fclose(pFile);
}
while (false); exit();
} int _tmain(int argc, _TCHAR* argv[])
{
signal(SIGQUIT, CrashReportSystem::OnProcessExceptionHandler);
signal(SIGILL, CrashReportSystem::OnProcessExceptionHandler);
signal(SIGTRAP, CrashReportSystem::OnProcessExceptionHandler);
signal(SIGABRT, CrashReportSystem::OnProcessExceptionHandler);
signal(SIGEMT, CrashReportSystem::OnProcessExceptionHandler);
signal(SIGFPE, CrashReportSystem::OnProcessExceptionHandler);
signal(SIGBUS, CrashReportSystem::OnProcessExceptionHandler);
signal(SIGSEGV, CrashReportSystem::OnProcessExceptionHandler);
signal(SIGSYS, CrashReportSystem::OnProcessExceptionHandler);
signal(SIGPIPE, CrashReportSystem::OnProcessExceptionHandler);
signal(SIGALRM, CrashReportSystem::OnProcessExceptionHandler);
signal(SIGXCPU, CrashReportSystem::OnProcessExceptionHandler);
signal(SIGXFSZ, CrashReportSystem::OnProcessExceptionHandler); return ;
}
ios如何生成crash报告的更多相关文章
- iOS应用的crash日志的分析基础
Outline如何获得crash日志如何解析crash日志如何分析crash日志 1. iOS策略相关 2. 常见错误标识 3. 代码bug 一.如何获得crash日志 ...
- 转 理解与分析ios应用的崩溃报告
理解与分析ios应用的崩溃报告 源网址: http://developer.apple.com/library/ios/#technotes/tn2151/_index.html 当一个应用程序崩溃时 ...
- [转载]Matlab生成Word报告
最近在进行一批来料的检验测试,一个个手动填写报告存图片太慢了,就有了种想要使用Matlab在分析完后数据可以自动生成PDF报告的想法,于是就去网上搜索了相关的资料,发现Matlab中文论坛上有xiez ...
- iOS项目生成通用Windows应用
WinObjc - 使用iOS项目生成通用Windows应用 Github上一周年的WinObjc项目最近发布了预览版本,终于等到了这一天.WinObjc项目就是Build 2015大会上微软宣布 ...
- ORACLE AWR概述及生成AWR报告
1.Overview of the Automatic Workload Repository The Automatic Workload Repository (AWR) collects, pr ...
- 生成awr报告
主要参考文献: http://343766868.blog.163.com/blog/static/48314056201110124513396/ 概况 Oracle内部以一定的频率把系统关键的统计 ...
- 自动生成AWR报告
--自动生成AWR报告 -------------------2013/09/23 脚本代码: #!/bin/bash AWR_FORMAT=html NUM_DAYS=1 MAX_S ...
- Oracle 每天自动生成AWR报告
经验丰富的老员工希望能够每天为数据库生成1个AWR报告,以便于后期分析数据库的性能变化,手动生成太麻烦,查了一下资料,发现可以自动生成,过程如下. 数据库环境:11gR2 RAC(双节点) AWR报告 ...
- oracle手工生成AWR报告方法记录
AWR(Automatic Workload Repository)报告是我们进行日常数据库性能评定.问题SQL发现的重要手段.熟练掌握AWR报告,是做好开发.运维DBA工作的重要基本功. AWR报告 ...
随机推荐
- [Asp.net mvc] 在Asp.net mvc 中使用MiniProfiler
MiniProfiler是Stack Overflow团队设计的一款性能分析的小程序.可以对一个页面本身,及该页面通过直接引用.Ajax.Iframe形式访问的其它页面进行监控,监控内容包括数据库内容 ...
- 【HDU 4602】Partition
题意 给你一个数n,把它写成几个正整数相加的形式,即把n拆开成若干段,把所有可能的式子里正整数 k 出现的次数取模是多少. 分析 特判 k>=n 的情况. k<n时:问题相当于n个点排一行 ...
- 【HDU 2203】亲和串
题 题意 给你一个字符串s1,字符串s2,s1循环移位,使s2包含在s1中,则s2 是s1的亲和串 分析 把s1自身复制一遍接在后面. 方法一: 用strstr函数. 方法二: KMP算法. 方法三: ...
- SOM自组织映射网络 教程
概述 SOM是芬兰教授Teuvo Kohonen提出的一种神经网络算法,它提供一种将高维数据在低维空间进行表示的方法(通常是一维或二维).缩减向量维度的过程,叫做向量量化(vector quantis ...
- 利用symbolsource/gitlink调试你的nuget包
关键字: 如何调试Nuget下载的dll? VS github 调试 参考文章: http://docs.nuget.org/create/creating-and-publishing-a-sy ...
- poj1056 (Trie入门)寻找字符串前缀
题意:给你一堆字符串,问是否满足对于任意两个字符串a.b,a不是b的前缀 字典树==前缀树==Trie树 trie入门题,只用到了insert和query操作 #include <cstdio& ...
- POJ 1273 Drainage Ditches -dinic
dinic版本 感觉dinic算法好帅,比Edmonds-Karp算法不知高到哪里去了 Description Every time it rains on Farmer John's fields, ...
- IPC机制
转:http://blog.chinaunix.net/uid-26125381-id-3206237.html IPC 三种通信机制 2012-05-13 17:23:55 最近看了,IPC三种通 ...
- Activity启动模式 及 Intent Flags 与 栈 的关联分析
http://blog.csdn.net/vipzjyno1/article/details/25463457 Android启动模式Flags栈Task 目录(?)[+] 什么是栈 栈 ...
- CentOS 6.6编译安装Nginx1.6.2+MySQL5.6.21+PHP5.6.3(转)
vi /etc/sysconfig/iptables #编辑防火墙配置文件 # Firewall configuration written by system-config-firewall # M ...