zoukankan      html  css  js  c++  java
  • Google breakpad for Linux step by step

    Google breakpad for Linux step by step
    ======================================
    
    $ ( cd google-breakpad; ./configure; make; )
    $ ( cd google-breakpad/src/tools/linux/dump_syms/; make; )
      # remove "-m32" in dump_syms/Makefile if on 64-bit OS
    $ ( cd google-breakpad/src/tools/linux/md2core/;
        g++ -I http://www.cnblogs.com/../ -o md2core minidump-2-core.cc; )
    
    $ cat test.cpp
    #include <iostream>
    #include "client/linux/handler/exception_handler.h"
    
    
    static bool dumpCallback(const char* dump_path,
                             const char* minidump_id,
                             void* context,
                             bool succeeded)
    {
        std::cerr << "Minidump file created: " << dump_path << "/" << minidump_id << ".dmp\n";
        return succeeded;
    }
    
    void hello()
    {
        int a = 2/0;
    }
    
    int main(int argc, char* argv[])
    {
        google_breakpad::ExceptionHandler eh(".", NULL, dumpCallback, NULL, true);
    
        hello();
    
        return 0;
    }
    
    $ g++ -g -I google-breakpad/src -o test test.cpp google-breakpad/src/client/linux/libbreakpad_client.a
    $ ./test
    
        $ google-breakpad/src/tools/linux/md2core/md2core ./test > core
        $ gdb ./test core
        (gdb) bt
    
        or
    
        $ google-breakpad/src/tools/linux/dump_syms/dump_syms ./test | head -1
        MODULE Linux x86_64 6EDC6ACDB282125843FD59DA9C81BD830 test
        $ mkdir -p ./symbols/test/6EDC6ACDB282125843FD59DA9C81BD830
        $ google-breakpad/src/tools/linux/dump_syms/dump_syms ./test > symbols/test/6EDC6ACDB282125843FD59DA9C81BD830/test.sym
        $ google-breakpad/src/processor/minidump_stackwalk ./328eaddc-c1d5-9eee-3ca1e6a4-0ce3f6a6.dmp symbols
    
        or (see http://groups.google.com/group/google-breakpad-discuss/browse_thread/thread/153ba641904d95ec )
    
        $ wget -O symbolstore.py http://mxr.mozilla.org/mozilla-central/source/toolkit/crashreporter/tools/symbolstore.py?raw=1
        $ python ./symbolstore.py google-breakpad/src/tools/linux/dump_syms/dump_syms ./symbols ./test
        $ google-breakpad/src/processor/minidump_stackwalk ./328eaddc-c1d5-9eee-3ca1e6a4-0ce3f6a6.dmp symbols
    
    
    Also reference:
    http://mxr.mozilla.org/mozilla-central/source/toolkit/crashreporter/
    
    
  • 相关阅读:
    python中的os
    文件系统的简单操作
    文件与目录管理
    用户与用户组管理
    基础命令的操作
    linux开机流程
    ansible源码安装、普通用户实现批量控制
    python3中得数据类型
    判断一个字符串中得大写字母,小写字母,数字出现得次数
    Elasticsearch 如何安全加固
  • 原文地址:https://www.cnblogs.com/runner42/p/2991015.html
Copyright © 2011-2022 走看看