#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报告的更多相关文章

  1. iOS应用的crash日志的分析基础

        Outline如何获得crash日志如何解析crash日志如何分析crash日志     1. iOS策略相关     2. 常见错误标识     3. 代码bug 一.如何获得crash日志 ...

  2. 转 理解与分析ios应用的崩溃报告

    理解与分析ios应用的崩溃报告 源网址: http://developer.apple.com/library/ios/#technotes/tn2151/_index.html 当一个应用程序崩溃时 ...

  3. [转载]Matlab生成Word报告

    最近在进行一批来料的检验测试,一个个手动填写报告存图片太慢了,就有了种想要使用Matlab在分析完后数据可以自动生成PDF报告的想法,于是就去网上搜索了相关的资料,发现Matlab中文论坛上有xiez ...

  4. iOS项目生成通用Windows应用

    WinObjc - 使用iOS项目生成通用Windows应用   Github上一周年的WinObjc项目最近发布了预览版本,终于等到了这一天.WinObjc项目就是Build 2015大会上微软宣布 ...

  5. ORACLE AWR概述及生成AWR报告

    1.Overview of the Automatic Workload Repository The Automatic Workload Repository (AWR) collects, pr ...

  6. 生成awr报告

    主要参考文献: http://343766868.blog.163.com/blog/static/48314056201110124513396/ 概况 Oracle内部以一定的频率把系统关键的统计 ...

  7. 自动生成AWR报告

    --自动生成AWR报告 -------------------2013/09/23   脚本代码:   #!/bin/bash   AWR_FORMAT=html NUM_DAYS=1   MAX_S ...

  8. Oracle 每天自动生成AWR报告

    经验丰富的老员工希望能够每天为数据库生成1个AWR报告,以便于后期分析数据库的性能变化,手动生成太麻烦,查了一下资料,发现可以自动生成,过程如下. 数据库环境:11gR2 RAC(双节点) AWR报告 ...

  9. oracle手工生成AWR报告方法记录

    AWR(Automatic Workload Repository)报告是我们进行日常数据库性能评定.问题SQL发现的重要手段.熟练掌握AWR报告,是做好开发.运维DBA工作的重要基本功. AWR报告 ...

随机推荐

  1. offsetLeft, offsetTop以及postion().left , postion().top有神马区别

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. Spring 作用域 scope

    spring的作用域将对Bean的生命周期和创建方式产生影响.  主要分为五种类型的作用域 singleton (默认)在spring IOC容器中仅存在一个Bean实例,Bean以单实例的方式存在. ...

  3. Hamcrest

    Hamcrest比起JUnit的assert系列方法来,有更好的可读性,它按照参数从左到右的符合自然的顺序来展示,如actual is(notNullValue()),是对测试断言的改进.同时不会被哪 ...

  4. 【bzoj3246】 Ioi2013—Dreaming

    www.lydsy.com/JudgeOnline/problem.php?id=3246 (题目链接) 题意 给出一棵不完全的树,要求在树上连最少的边使得所有点联通,并且使得两点间最大距离最小. S ...

  5. DataSet筛选数据然后添加到新的DataSet中引发的一系列血案

    直入代码: var ds2 = new DataSet(); ) { ].Select(" usertype <> 'UU'"); ) { DataTable tmp ...

  6. Server Data Synchronization Via Linux rsync、rsync+inotify Between Load Balance Server

    目录 . 远程文件同步的应用场景 . rsync+crontab . rsync+inotify 1. 远程文件同步的应用场景 在负载均衡集群的应用场景中,往往在多台web server的前端有一个提 ...

  7. POJ3233Matrix Power Series(十大矩阵问题之三 + 二分+矩阵快速幂)

    http://poj.org/problem?id=3233 Matrix Power Series Time Limit: 3000MS   Memory Limit: 131072K Total ...

  8. 网络html查看器

    1)演示效果:

  9. find只查当前目录 和 -exec和xargs区别

    1.find默认查找当前目录和子目录,通过maxdepth限制只查当前目录: find . -maxdepth 1 -type f -name "*.php" 2. find . ...

  10. ARP欺骗病毒,网页“篡改”,注入iframe代码!

    ---------------权威资料看这里--------------- 清华大学信息网络工程研究中心-中国教育和科研计算机网应急响应组<ARP 欺骗网页劫持攻击分析>PDF文件,直接I ...