项目作者: rodlie

项目描述 :
A library (and tools) for parsing crash dumps
高级语言: C++
项目地址: git://github.com/rodlie/breakdown.git
创建时间: 2020-04-02T05:51:24Z
项目社区:https://github.com/rodlie/breakdown

开源协议:Other

下载


Breakdown

Various applications and libraries for dumping symbols from binaries files and parsing crash dumps on Windows (MinGW-only), macOS (untested) and Linux.

Breakdown uses a fork of Google Breakpad.

Build and install

Requires pkg-config, CMake (3.0+), a c++11 compatible compiler (only GCC tested) and libzip.

  1. git clone https://github.com/rodlie/breakdown
  2. cd breakdown
  3. git submodule update -i --recursive
  4. mkdir build && cd build
  5. cmake -DCMAKE_INSTALL_PREFIX=/usr .. && make
  6. make DESTDIR=<PACKAGE_LOCATION> install
  1. <PACKAGE_LOCATION>
  2. └── usr
  3. ├── bin
  4. │ ├── breakdown-dumper
  5. │ └── breakdown-parser
  6. ├── include
  7. │ └── Breakdown
  8. │ └── breakdown.h
  9. ├── lib64
  10. │ ├── libBreakdown.so -> libBreakdown.so.2
  11. │ ├── libBreakdown.so.2 -> libBreakdown.so.2.0.0
  12. │ ├── libBreakdown.so.2.0.0
  13. │ └── pkgconfig
  14. │ └── breakdown.pc
  15. └── share
  16. └── doc
  17. └── Breakdown-2.0.0
  18. ├── LICENSE
  19. ├── LICENSE.breakpad
  20. └── README.md

Symbols Storage

Symbols are stored using the following directory structure:

  • <SYMBOLS_FOLDER>
    • <FILENAME_FOLDER> (example: Natron-bin)
      • <SYMBOL_ID_FOLDER> (example: 69CDA01A0F236F7C71CD19E5A20A21AC0)
        • <ZIP_FILE> (example: Natron-bin.sym.zip)

<FILENAME_FOLDER> and <SYMBOL_ID_FOLDER> must match line 1 in the symbol file.

Example : MODULE Linux x86_64 69CDA01A0F236F7C71CD19E5A20A21AC0 Natron-bin

Note that Breakdown only supports zipped symbols (filename.sym.zip)

Creating Symbols

Example:

  1. breakdown-dumper Natron-bin > Natron-bin.sym
  2. export SYMBOL_BIN=`head -1 Natron-bin.sym | awk '{print $5}'`
  3. export SYMBOL_ID=`head -1 Natron-bin.sym | awk '{print $4}'`
  4. mkdir -p symbols/$SYMBOL_BIN/$SYMBOL_ID
  5. zip -9 Natron-bin.sym.zip Natron-bin.sym
  6. mv Natron-bin.sym.zip symbols/$SYMBOL_BIN/$SYMBOL_ID/
  1. symbols
  2. └── Natron-bin
  3. └── 69CDA01A0F236F7C71CD19E5A20A21AC0
  4. └── Natron-bin.sym.zip
  5. 2 directories, 1 file

Usage Example (library)

  1. #include <breakdown.h>
  2. std::string filename = "crash.dmp";
  3. std::vector<std::string> storage;
  4. storage.push_back("symbols");
  5. std::string result = Breakdown::generateCrashResultPlainText(filename, storage);

Usage Example (application)

  1. breakdown-parser symbols crash.dmp > result.txt
  1. OS : Linux (0.0.0 Linux 4.4.172 #2 SMP Wed Jan 30 17:11:07 CST 2019 x86_64)
  2. TYPE : SIGSEGV /0x00000000
  3. MODULE : Natron-bin
  4. FUNCTION : Natron::crash_application()
  5. SOURCE : Settings.cpp:2228
  6. ...