[Google Breakpad] crash_generation_app例子研究 -- 进程外和进程内dump的区别
来源:互联网 发布:unity3d做ar 编辑:程序博客网 时间:2024/05/18 03:39
src/client/windows/tests/crash_generation_app下的例子编译失败,看了看,有些地方需要更改一下(以release为例)
1.C++ -> Code Generation -> Runtime Library -> Multi-threaded (/MT)
2. Linker -> Additional Library Directories -> ../../$(ConfigurationName)/lib
3. Linker -> Input -> Additional Dependencies -> common.lib exception_handler.lib crash_report_sender.lib crash_generation_client.lib crash_generation_server.lib
4.crash_generation_app.cc 中将dump路径"C://Dump"之类的改成"."
从网上找了个两个图简单解释一下breakpad的流程
进程外Dump :由独立的Crash Handle Process处理Dump的生成过程,主进程产生异常时,通过IPC方式通知Crash Handle Process。由Crash Handle Process中的crash_generation_server负责写Dump文件。大致流程如下:
上图中,crash_generation_client和crash_generation_server之间是进程间通讯(IPC)。crash_report_sender负责将dump信息发送到google的crash report server(https://clients2.google.com/cr/report)。
进程内Dump :与进程外方式类似,只不过在Browser进程中增加了一个crash_handle_thread线程,由此线程负责写dump.基本流程如下:
在crash_generation_app中,默认的代码是使用了IPC的进程外dump方式
CrashServerStart();
// This is needed for CRT to not show dialog for invalid param
// failures and instead let the code handle it.
_CrtSetReportMode(_CRT_ASSERT, 0);
handler = new ExceptionHandler(L".",
NULL,
google_breakpad::ShowDumpResults,
NULL,
ExceptionHandler::HANDLER_ALL,
MiniDumpNormal,
kPipeName,
&custom_info );
// This is needed for CRT to not show dialog for invalid param
// failures and instead let the code handle it.
_CrtSetReportMode(_CRT_ASSERT, 0);
handler = new ExceptionHandler(L".",
NULL,
google_breakpad::ShowDumpResults,
NULL,
ExceptionHandler::HANDLER_ALL,
MiniDumpNormal,
kPipeName,
&custom_info );
这种方式生成的exe在只运行一个程序crash时,生成的dmp文件,用vs打开无法定位崩溃点
而运行两个程序,第二个程序crash后生成的dump文件,用vs打开可以正确定位崩溃点
说明进程外dump外方式需要一个独立的进程生成dump文件
而要想使用进程内dump方式,需要改成如下代码
//CrashServerStart();
// This is needed for CRT to not show dialog for invalid param
// failures and instead let the code handle it.
_CrtSetReportMode(_CRT_ASSERT, 0);
handler = new ExceptionHandler(L".",
NULL,
google_breakpad::ShowDumpResults,
NULL,
ExceptionHandler::HANDLER_ALL);
// This is needed for CRT to not show dialog for invalid param
// failures and instead let the code handle it.
_CrtSetReportMode(_CRT_ASSERT, 0);
handler = new ExceptionHandler(L".",
NULL,
google_breakpad::ShowDumpResults,
NULL,
ExceptionHandler::HANDLER_ALL);
- [Google Breakpad] crash_generation_app例子研究 -- 进程外和进程内dump的区别
- breakpad进程外dump捕获浅析
- Breakpad在进程中完成dump的流程描述
- Google Breakpad 上传的dump数据格式
- 使用google breakpad生成dump文件
- 使用google breakpad生成dump文件
- 进程内和进程外Session
- Android应用内多进程分析和研究
- Android应用内多进程分析和研究
- Android基础 Android应用内多进程分析和研究
- Android基础 Android应用内多进程分析和研究
- Android应用内多进程分析和研究
- Android应用内多进程分析和研究
- 僵尸进程和孤儿进程的区别
- 孤儿进程和僵尸进程的区别
- 孤儿进程和僵尸进程的区别
- 私有进程和全局进程的区别
- 进程和线程的区别,进程和程序的区别
- MyEclipse优化速度方案的四大方面
- 提升MyEclipse速度
- (1)WPF基础学习
- Firefox 4加速开发步伐体现社区力量
- iphone推送消息 实例
- [Google Breakpad] crash_generation_app例子研究 -- 进程外和进程内dump的区别
- 在实战中成长
- 寻找选择的RadioButton
- iconv python
- 字符串与数字转换
- Microstation--VBA 项目管理器对话框 和 .net使用
- dwr配置文件dwr.xml祥解
- 注意WINFORM程式开发时控件的事件序,提高程序运行效率
- jsp不缓存