当前位置:网站首页>google_ Breakpad crash detection
google_ Breakpad crash detection
2022-06-25 15:07:00 【Knowledge first】
1 breakpad Introduce
google_breakpad It's a by google Leading open source projects , The official introduction is :An open-source multi-platform crash reporting system, namely Open source multi platform crash reporting system .
This is from google Employees in the work 20% The freedom to create works created by time , People who really love technology will change the world in free time , A man who only finishes his work can always make a gun that is thrown after being used up .
Introduction to official documents :https://github.com/google/breakpad/blob/main/docs/getting_started_with_breakpad.md
2 Support
google breakpad Support iOS linux windows, But notice , I won't support it mingw64.
3 Source code
1 download
Download address :https://code.google.com/p/google-breakpad/ If you can't access it, please hang up VPN
github Address :https://github.com/google/breakpad
2 Project source structure ( Mainly in the src Under the directory of )
- build: Compile the script
- client: It mainly includes capture and dump Code
- common: General support code
- google_breakpad: breakpad Public support code used
- processor: Crash handling core code
- testing: Test code
- third_party: Third party support library
- tools: Some gadgets , Used for processing dump Document and symbol table
4 compile
4.1、window Compiling method
Reference link : https://blog.csdn.net/a844651990/article/details/85316627
4.2、linuxu(buntu desktop )
After downloading the source code , Execute the following command :
./configure
qmake -j4
4.3、linux( The embedded arm)
./configure --host=[arm-linux-gnueabihf]
qmake -j4
notes : --host The parameters carried are modified according to the cross compilation used by the platform
5 Use
5.1 Join the project
Use dynamic library to add projects , With qt For example , You need to add the compiled dynamic libraries and header files to the project folder , And then in the project pro Add code to file , As shown in the figure below :
5.2 Function call
// Add header file
#include "client/linux/handler/exception_handler.h"
//crash Callback function
static bool dumpCallback(const google_breakpad::MinidumpDescriptor &descriptor,
void *context,
bool succeeded)
{
Q_UNUSED(context)
printf("Dump path: %s\n", descriptor.path());
return succeeded;
}
int main(int argc, char *argv[])
{
// Load crash information capture
QString curDateTime = QDateTime::currentDateTime().toString("yyyyMMddhhmmss");
QDir dir(DMP_ROOT + curDateTime);
if(!dir.exists())
{
dir.mkpath(DMP_ROOT + curDateTime);
}
google_breakpad::MinidumpDescriptor descriptor(QString(DMP_ROOT + curDateTime).toStdString());
google_breakpad::ExceptionHandler eh(descriptor,
NULL,
dumpCallback,
NULL,
true,
-1);
// Your other code
return a.exec();
}
5.3 dmp File to readable file
The following is only about linux Next operation .
1、 Use dump_syms Generate symbol table :
dump_syms project > project.sym
notes : project by Run the program
2、 Create a hierarchical debug symbols folder
- View file hierarchy
head -n1 project.sym
- Create folder
mkdir -p ./symbols/project/ 5F5A4C932BFF6581E5AB30B67D9AA5180/
- take project.sym Copy to the folder in the previous step
cp project.sym symbols/project/ 5F5A4C932BFF6581E5AB30B67D9AA5180/
3、 utilize minidump_stackwalk analysis dump file
minidump_stackwalk f35daf9d-25a4-4706-d3f62d89-72d1b3c7.dmp ./symbols > result_f35daf9d.log
Finally generated result_f35daf9d.log Is a readable file .
边栏推荐
- dev/mapper的解释
- 1090.Phone List
- One code per day - day one
- RDB and AOF persistence of redis
- SPARQL learning notes of query, an rrdf query language
- Iterator failure condition
- About%*s and%* s
- Gif动图如何裁剪?收下这个图片在线裁剪工具
- Customization and encapsulation of go language zap library logger
- Is it normal to dig for money? Is it safe to open a stock account?
猜你喜欢
Power automatic test system nsat-8000, accurate, high-speed and reliable power test equipment
Using Sphinx to automatically generate API documents from py source files
In 2022, the score line of Guangdong college entrance examination was released, and several families were happy and several worried
Open a restaurant
Add the resources directory under test in idea
【中国海洋大学】考研初试复试资料分享
定位position(5种方式)
System Verilog — interface
[Ocean University of China] Data Sharing for retest of initial Examination
Gif动图如何裁剪?收下这个图片在线裁剪工具
随机推荐
弹性布局(display:flex;)属性详解
Brain tree (I)
Usage of qlist
Mining procedure processing
Build a minimalist gb28181 gatekeeper and gateway server, establish AI reasoning and 3D service scenarios, and then open source code (I)
A deformation problem of Hanoi Tower
2. operator and expression multiple choice questions
Use Matplotlib to draw a line chart
【Try to Hack】vulnhub DC1
55 specific ways to improve program design (1)
Disable scrolling in the iPhone web app- Disable scrolling in an iPhone web application?
How to crop GIF dynamic graph? Take this picture online clipping tool
dmsetup命令
Real variable instance
Position (5 ways)
【中國海洋大學】考研初試複試資料分享
【Try to Hack】vulhub靶场搭建
买卖股票的最佳时机
System Verilog — interface
Remove interval (greedy)