Skip to content

Commit

Permalink
1 qBreakpad.pri: Add A typical configuration of adding debug informat…
Browse files Browse the repository at this point in the history
…ion in release build

2 README.md: Modify and add some tips on building and decoding dumps
  • Loading branch information
CharlesLiaoO committed Jun 4, 2022
1 parent bf87b6c commit b4133b5
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

qBreakpad is Qt library to use google-breakpad crash reporting facilities (and using it conviniently).
Supports
* Windows (but crash dump decoding will not work with MinGW compiler)
* Windows
* Linux
* MacOS X

Expand Down Expand Up @@ -41,4 +41,16 @@ Getting started with Google Breakpad
----------------
https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/getting_started_with_breakpad.md
Tips of building and dump's decoding
----------------
* MinGW:
You can try to use the tool **cv2pdb**(https://github.com/rainers/cv2pdb), to strip the debug information from the binary and generate the pdb file,
then use Visual Studio to decode the dump conveniently.
* Linux:
You can use the tool **minidump-2-core** of Google Breakpad, to convert the dump file to core file, then use QtCreator to decode the dump conveniently.
* Mac:
Refer to qBreakpad's Wiki
Wiki
----------------
Detail description about integration `qBreakpad` into your system and platform you could find in **[Wiki](https://github.com/buzzySmile/qBreakpad/wiki)**.
41 changes: 41 additions & 0 deletions qBreakpad.pri
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,44 @@ HEADERS += \

LIBS += \
-L$$PWD/handler -lqBreakpad

# ---- A typical configuration of adding debug information in release build ----
# Test environment:
# Windows: qt5.6.2 mingw4.9.2-32bit and qt5.6.2 msvc2015-32bit
# Linux: qt5.6.2 gcc5.3.1
# Mac: do not test

*-g++ {
#message($$QMAKE_CXXFLAGS_DEBUG) # => -g
#message($$QMAKE_CXXFLAGS_RELEASE) # => -O2
#message($$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO) # => -O2 -g
#message($$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO) # => linux: -O2 -g; mingw: nothing
#message($$QMAKE_LFLAGS_DEBUG) # => nothing
#message($$QMAKE_LFLAGS_RELEASE) # => linux: -Wl,-O1; mingw: -Wl,-s

# Add debug information, delete compilation optimization
QMAKE_CFLAGS_RELEASE += -g # QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO is '-O2 -g', but don't add '-O2'
QMAKE_CFLAGS_RELEASE -= -O2
QMAKE_CXXFLAGS_RELEASE += -g # QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_CXXFLAGS_RELEASE -= -O2

QMAKE_LFLAGS_RELEASE -= -Wl,-s # Delete the default parameter '-Wl,-s'(delete debug information in linking£©
#QMAKE_LFLAGS_RELEASE -= -Wl,-O1 # In linking's -O1, only -fmerge-constants valid, but it don't affect debug info. So don't delete -O1
}
else {
#message($$QMAKE_CXXFLAGS_DEBUG) # => -Zi -MDd
#message($$QMAKE_CXXFLAGS_RELEASE) # => -O2 -MD
#message($$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO) # => -O2 -Zi -MD
#message($$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO) # => -O2 -Zi -MD
#message($$QMAKE_LFLAGS_DEBUG) # => nothing
#message($$QMAKE_LFLAGS_RELEASE) # => /INCREMENTAL:NO

# Add debug information, delete compilation optimization
QMAKE_CFLAGS_RELEASE += -Zi /Od
QMAKE_CFLAGS_RELEASE -= -O2
QMAKE_CXXFLAGS_RELEASE += -Zi /Od
QMAKE_CXXFLAGS_RELEASE -= -O2

QMAKE_LFLAGS_RELEASE += /DEBUG # This disable /INCREMENTAL:NO implicitly
}
# ---- A typical configuration of adding debug information in release build ----

0 comments on commit b4133b5

Please sign in to comment.