Visit Mozilla.org

Building Firefox with Debug Symbols

From MDC


By default, a release build of Firefox will not generate debug symbols suitable for debugging or post-processing into the breakpad symbol format. Use the following mozconfig settings to do a build with symbols:

Contents

[edit] On Windows

export MOZ_DEBUG_SYMBOLS=1
ac_add_options --enable-debugger-info-modules=yes

Note that a typical release build will have additional options. See tools/tinderbox-configs/firefox/win32/mozconfig for the configuration used for nightly builds.

[edit] On Mac

 export CFLAGS="-g -gfull"
 export CXXFLAGS="-g -gfull"

You should use CFLAGS/CXXFLAGS instead of passing compiler flags in --enable-optimize, because --enable-optimize=flags overrides module-specific optimization settings, which you really don't want to do. See bug 407794 for more info.

See tools/tinderbox-configs/firefox/macosx/mozconfig for the configuration used for nightly builds.

[edit] On Linux

Unfortunately the default debugger flags produce output that cannot be used with crash reporter, so you have to force compatible debugger output like this:

 export CFLAGS="-gstabs+"
 export CXXFLAGS="-gstabs+"

See tools/tinderbox-configs/firefox/linux/mozconfig for the configuration used for nightly builds.

[edit] Breakpad symbol files

After the build is complete, run the following command to generate an archive of Breakpad symbol files:

make -C objdir buildsymbols

The tinderbox uses an additional uploadsymbols target to upload symbols to a socorro server. See toolkit/crashreporter/tools/upload_symbols.sh for more information about the environment variables used by this target.