bug 517097 - make enabling debug symbols more sane r=ted.mielczarek

--HG--
extra : rebase_source : 3b9b43f06fbbd1bcceb5763061ee97378602cac5
This commit is contained in:
Mitchell Field 2010-02-11 08:21:00 -05:00
Родитель 03b1de4b95
Коммит 38fb505f32
6 изменённых файлов: 71 добавлений и 177 удалений

Просмотреть файл

@ -94,12 +94,11 @@ MOZ_CORETEXT = @MOZ_CORETEXT@
MOZ_JS_LIBS = @MOZ_JS_LIBS@
MOZ_DEBUG = @MOZ_DEBUG@
MOZ_DEBUG_MODULES = @MOZ_DEBUG_MODULES@
MOZ_DEBUG_SYMBOLS = @MOZ_DEBUG_SYMBOLS@
MOZ_DEBUG_ENABLE_DEFS = @MOZ_DEBUG_ENABLE_DEFS@
MOZ_DEBUG_DISABLE_DEFS = @MOZ_DEBUG_DISABLE_DEFS@
MOZ_DEBUG_FLAGS = @MOZ_DEBUG_FLAGS@
MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
MOZ_DBGRINFO_MODULES = @MOZ_DBGRINFO_MODULES@
MOZ_EXTENSIONS = @MOZ_EXTENSIONS@
MOZ_IMG_DECODERS= @MOZ_IMG_DECODERS@
MOZ_IMG_ENCODERS= @MOZ_IMG_ENCODERS@
@ -594,7 +593,6 @@ MOZILLA_OFFICIAL = @MOZILLA_OFFICIAL@
# Win32 options
MOZ_BROWSE_INFO = @MOZ_BROWSE_INFO@
MOZ_TOOLS_DIR = @MOZ_TOOLS_DIR@
MOZ_DEBUG_SYMBOLS = @MOZ_DEBUG_SYMBOLS@
MOZ_QUANTIFY = @MOZ_QUANTIFY@
MSMANIFEST_TOOL = @MSMANIFEST_TOOL@
WIN32_REDIST_DIR = @WIN32_REDIST_DIR@

Просмотреть файл

@ -162,72 +162,19 @@ endif
_DEBUG_CFLAGS :=
_DEBUG_LDFLAGS :=
ifndef MOZ_DEBUG
# global debugging is disabled
# check if it was explicitly enabled for this module
ifneq (, $(findstring $(MODULE), $(MOZ_DEBUG_MODULES)))
MOZ_DEBUG:=1
endif
else
# global debugging is enabled
# check if it was explicitly disabled for this module
ifneq (, $(findstring ^$(MODULE), $(MOZ_DEBUG_MODULES)))
MOZ_DEBUG:=
endif
endif
ifdef MOZ_DEBUG
_DEBUG_CFLAGS += $(MOZ_DEBUG_ENABLE_DEFS)
_DEBUG_CFLAGS += $(MOZ_DEBUG_ENABLE_DEFS) $(MOZ_DEBUG_FLAGS)
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
XULPPFLAGS += $(MOZ_DEBUG_ENABLE_DEFS)
else
_DEBUG_CFLAGS += $(MOZ_DEBUG_DISABLE_DEFS)
XULPPFLAGS += $(MOZ_DEBUG_DISABLE_DEFS)
endif
# determine if -g should be passed to the compiler, based on
# the current module, and the value of MOZ_DBGRINFO_MODULES
ifdef MOZ_DEBUG
MOZ_DBGRINFO_MODULES += ALL_MODULES
pattern := ALL_MODULES ^ALL_MODULES
else
MOZ_DBGRINFO_MODULES += ^ALL_MODULES
pattern := ALL_MODULES ^ALL_MODULES
endif
ifdef MODULE
# our current Makefile specifies a module name - add it to our pattern
pattern += $(MODULE) ^$(MODULE)
endif
# start by finding the first relevant module name
# (remember that the order of the module names in MOZ_DBGRINFO_MODULES
# is reversed from the order the user specified to configure -
# this allows the user to put general names at the beginning
# of the list, and to override them with explicit module names later
# in the list)
first_match:=$(firstword $(filter $(pattern), $(MOZ_DBGRINFO_MODULES)))
ifeq ($(first_match), $(MODULE))
# the user specified explicitly that
# this module should be compiled with -g
_DEBUG_CFLAGS += $(MOZ_DEBUG_FLAGS)
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
else
ifneq ($(first_match), ^$(MODULE))
ifeq ($(first_match), ALL_MODULES)
# the user didn't mention this module explicitly,
# but wanted all modules to be compiled with -g
_DEBUG_CFLAGS += $(MOZ_DEBUG_FLAGS)
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
endif
ifdef MOZ_DEBUG_SYMBOLS
_DEBUG_CFLAGS += $(MOZ_DEBUG_FLAGS)
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
endif
endif
# append debug flags
# (these might have been above when processing MOZ_DBGRINFO_MODULES)
OS_CFLAGS += $(_DEBUG_CFLAGS)
OS_CXXFLAGS += $(_DEBUG_CFLAGS)
OS_LDFLAGS += $(_DEBUG_LDFLAGS)

Просмотреть файл

@ -4604,7 +4604,6 @@ ENABLE_TESTS=1
MOZ_ACTIVEX_SCRIPTING_SUPPORT=
MOZ_BRANDING_DIRECTORY=
MOZ_OFFICIAL_BRANDING=
MOZ_DBGRINFO_MODULES=
MOZ_FEEDS=1
MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp icon"
MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
@ -6535,11 +6534,12 @@ fi
MOZ_ARG_ENABLE_STRING(debug,
[ --enable-debug[=DBG] Enable building with developer debug info
(Using compiler flags DBG)],
(using compiler flags DBG)],
[ if test "$enableval" != "no"; then
MOZ_DEBUG=1
if test -n "$enableval" && test "$enableval" != "yes"; then
if test -n "$enableval" -a "$enableval" != "yes"; then
MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
_MOZ_DEBUG_FLAGS_SET=1
fi
else
MOZ_DEBUG=
@ -6633,33 +6633,37 @@ AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
dnl ========================================================
dnl = Enable/disable debug for specific modules only
dnl = module names beginning with ^ will be disabled
dnl ========================================================
MOZ_ARG_ENABLE_STRING(debug-modules,
[ --enable-debug-modules Enable/disable debug info for specific modules],
[ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
dnl ========================================================
dnl = Enable/disable generation of debugger info for specific modules only
dnl = the special module name ALL_MODULES can be used to denote all modules
dnl = module names beginning with ^ will be disabled
dnl = (Deprecated) generation of debugger info for specific modules
dnl ========================================================
MOZ_ARG_ENABLE_STRING(debugger-info-modules,
[ --enable-debugger-info-modules
Enable/disable debugger info for specific modules],
[ for i in `echo $enableval | sed 's/,/ /g'`; do
dnl note that the list of module names is reversed as it is copied
dnl this is important, as it will allow config.mk to interpret stuff like
dnl "^ALL_MODULES xpcom" properly
if test "$i" = "no"; then
i="^ALL_MODULES"
[ if test "$enableval" != "no"; then
AC_MSG_WARN([--enable-debugger-info-modules is deprecated, use --enable-debug-symbols instead])
MOZ_DEBUG_SYMBOLS=1
fi ])
dnl ========================================================
dnl = Enable generation of debug symbols
dnl ========================================================
MOZ_ARG_ENABLE_STRING(debug-symbols,
[ --enable-debug-symbols[=DBG] Enable debugging symbols
(using compiler flags DBG)],
[ if test "$enableval" != "no"; then
MOZ_DEBUG_SYMBOLS=1
if test -n "$enableval" -a "$enableval" != "yes"; then
if test -z "$_MOZ_DEBUG_FLAGS_SET"; then
MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
else
AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
fi
fi
if test "$i" = "yes"; then
i="ALL_MODULES"
fi
MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
done ])
fi ])
if test -n "$MOZ_DEBUG" -o -n "$MOZ_DEBUG_SYMBOLS"; then
AC_DEFINE(MOZ_DEBUG_SYMBOLS)
export MOZ_DEBUG_SYMBOLS
fi
dnl ========================================================
dnl Disable runtime logging checks
@ -8063,13 +8067,12 @@ AC_SUBST(MOZ_XSLT_STANDALONE)
AC_SUBST(MOZ_JS_LIBS)
AC_SUBST(MOZ_PSM)
AC_SUBST(MOZ_DEBUG)
AC_SUBST(MOZ_DEBUG_MODULES)
AC_SUBST(MOZ_DEBUG_SYMBOLS)
AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
AC_SUBST(MOZ_DEBUG_FLAGS)
AC_SUBST(MOZ_DEBUG_LDFLAGS)
AC_SUBST(WARNINGS_AS_ERRORS)
AC_SUBST(MOZ_DBGRINFO_MODULES)
AC_SUBST(MOZ_EXTENSIONS)
AC_SUBST(MOZ_IMG_DECODERS)
AC_SUBST(MOZ_IMG_ENCODERS)
@ -8157,7 +8160,6 @@ AC_SUBST(MOZ_PKG_SPECIAL)
AC_SUBST(MOZILLA_OFFICIAL)
dnl win32 options
AC_SUBST(MOZ_DEBUG_SYMBOLS)
AC_SUBST(MOZ_MAPINFO)
AC_SUBST(MOZ_BROWSE_INFO)
AC_SUBST(MOZ_TOOLS_DIR)

Просмотреть файл

@ -76,13 +76,12 @@ MOZ_JS_LIBS = @MOZ_JS_LIBS@
MOZ_SYNC_BUILD_FILES = @MOZ_SYNC_BUILD_FILES@
MOZ_DEBUG = @MOZ_DEBUG@
MOZ_DEBUG_MODULES = @MOZ_DEBUG_MODULES@
MOZ_DEBUG_SYMBOLS = @MOZ_DEBUG_SYMBOLS@
MOZ_PROFILE_MODULES = @MOZ_PROFILE_MODULES@
MOZ_DEBUG_ENABLE_DEFS = @MOZ_DEBUG_ENABLE_DEFS@
MOZ_DEBUG_DISABLE_DEFS = @MOZ_DEBUG_DISABLE_DEFS@
MOZ_DEBUG_FLAGS = @MOZ_DEBUG_FLAGS@
MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
MOZ_DBGRINFO_MODULES = @MOZ_DBGRINFO_MODULES@
MOZ_EXTENSIONS = @MOZ_EXTENSIONS@
MOZ_IMG_DECODERS= @MOZ_IMG_DECODERS@
MOZ_IMG_ENCODERS= @MOZ_IMG_ENCODERS@
@ -318,7 +317,6 @@ MOZILLA_OFFICIAL = @MOZILLA_OFFICIAL@
# Win32 options
MOZ_BROWSE_INFO = @MOZ_BROWSE_INFO@
MOZ_TOOLS_DIR = @MOZ_TOOLS_DIR@
MOZ_DEBUG_SYMBOLS = @MOZ_DEBUG_SYMBOLS@
MOZ_QUANTIFY = @MOZ_QUANTIFY@
MSMANIFEST_TOOL = @MSMANIFEST_TOOL@
WIN32_REDIST_DIR = @WIN32_REDIST_DIR@

Просмотреть файл

@ -162,72 +162,19 @@ endif
_DEBUG_CFLAGS :=
_DEBUG_LDFLAGS :=
ifndef MOZ_DEBUG
# global debugging is disabled
# check if it was explicitly enabled for this module
ifneq (, $(findstring $(MODULE), $(MOZ_DEBUG_MODULES)))
MOZ_DEBUG:=1
endif
else
# global debugging is enabled
# check if it was explicitly disabled for this module
ifneq (, $(findstring ^$(MODULE), $(MOZ_DEBUG_MODULES)))
MOZ_DEBUG:=
endif
endif
ifdef MOZ_DEBUG
_DEBUG_CFLAGS += $(MOZ_DEBUG_ENABLE_DEFS)
_DEBUG_CFLAGS += $(MOZ_DEBUG_ENABLE_DEFS) $(MOZ_DEBUG_FLAGS)
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
XULPPFLAGS += $(MOZ_DEBUG_ENABLE_DEFS)
else
_DEBUG_CFLAGS += $(MOZ_DEBUG_DISABLE_DEFS)
XULPPFLAGS += $(MOZ_DEBUG_DISABLE_DEFS)
endif
# determine if -g should be passed to the compiler, based on
# the current module, and the value of MOZ_DBGRINFO_MODULES
ifdef MOZ_DEBUG
MOZ_DBGRINFO_MODULES += ALL_MODULES
pattern := ALL_MODULES ^ALL_MODULES
else
MOZ_DBGRINFO_MODULES += ^ALL_MODULES
pattern := ALL_MODULES ^ALL_MODULES
endif
ifdef MODULE
# our current Makefile specifies a module name - add it to our pattern
pattern += $(MODULE) ^$(MODULE)
endif
# start by finding the first relevant module name
# (remember that the order of the module names in MOZ_DBGRINFO_MODULES
# is reversed from the order the user specified to configure -
# this allows the user to put general names at the beginning
# of the list, and to override them with explicit module names later
# in the list)
first_match:=$(firstword $(filter $(pattern), $(MOZ_DBGRINFO_MODULES)))
ifeq ($(first_match), $(MODULE))
# the user specified explicitly that
# this module should be compiled with -g
_DEBUG_CFLAGS += $(MOZ_DEBUG_FLAGS)
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
else
ifneq ($(first_match), ^$(MODULE))
ifeq ($(first_match), ALL_MODULES)
# the user didn't mention this module explicitly,
# but wanted all modules to be compiled with -g
_DEBUG_CFLAGS += $(MOZ_DEBUG_FLAGS)
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
endif
ifdef MOZ_DEBUG_SYMBOLS
_DEBUG_CFLAGS += $(MOZ_DEBUG_FLAGS)
_DEBUG_LDFLAGS += $(MOZ_DEBUG_LDFLAGS)
endif
endif
# append debug flags
# (these might have been above when processing MOZ_DBGRINFO_MODULES)
OS_CFLAGS += $(_DEBUG_CFLAGS)
OS_CXXFLAGS += $(_DEBUG_CFLAGS)
OS_LDFLAGS += $(_DEBUG_LDFLAGS)

Просмотреть файл

@ -3919,7 +3919,6 @@ MOZ_ARG_HEADER(Application)
BUILD_STATIC_LIBS=
ENABLE_TESTS=1
MOZ_DBGRINFO_MODULES=
dnl ========================================================
dnl =
@ -3992,8 +3991,9 @@ MOZ_ARG_ENABLE_STRING(debug,
(Using compiler flags DBG)],
[ if test "$enableval" != "no"; then
MOZ_DEBUG=1
if test -n "$enableval" && test "$enableval" != "yes"; then
if test -n "$enableval" -a "$enableval" != "yes"; then
MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
_MOZ_DEBUG_FLAGS_SET=1
fi
else
MOZ_DEBUG=
@ -4074,33 +4074,37 @@ AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
dnl ========================================================
dnl = Enable/disable debug for specific modules only
dnl = module names beginning with ^ will be disabled
dnl ========================================================
MOZ_ARG_ENABLE_STRING(debug-modules,
[ --enable-debug-modules Enable/disable debug info for specific modules],
[ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
dnl ========================================================
dnl = Enable/disable generation of debugger info for specific modules only
dnl = the special module name ALL_MODULES can be used to denote all modules
dnl = module names beginning with ^ will be disabled
dnl = (Deprecated) generation of debugger info for specific modules
dnl ========================================================
MOZ_ARG_ENABLE_STRING(debugger-info-modules,
[ --enable-debugger-info-modules
Enable/disable debugger info for specific modules],
[ for i in `echo $enableval | sed 's/,/ /g'`; do
dnl note that the list of module names is reversed as it is copied
dnl this is important, as it will allow config.mk to interpret stuff like
dnl "^ALL_MODULES xpcom" properly
if test "$i" = "no"; then
i="^ALL_MODULES"
[ if test "$enableval" != "no"; then
AC_MSG_WARN([--enable-debugger-info-modules is deprecated, use --enable-debug-symbols instead])
MOZ_DEBUG_SYMBOLS=1
fi ])
dnl ========================================================
dnl = Enable generation of debug symbols
dnl ========================================================
MOZ_ARG_ENABLE_STRING(debug-symbols,
[ --enable-debug-symbols[=DBG] Enable debugging symbols
(using compiler flags DBG)],
[ if test "$enableval" != "no"; then
MOZ_DEBUG_SYMBOLS=1
if test -n "$enableval" -a "$enableval" != "yes"; then
if test -z "$_MOZ_DEBUG_FLAGS_SET"; then
MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
else
AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
fi
fi
if test "$i" = "yes"; then
i="ALL_MODULES"
fi
MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
done ])
fi ])
if test -n "$MOZ_DEBUG" -o -n "$MOZ_DEBUG_SYMBOLS"; then
AC_DEFINE(MOZ_DEBUG_SYMBOLS)
export MOZ_DEBUG_SYMBOLS
fi
dnl ========================================================
dnl Enable Narcissus
@ -4885,13 +4889,12 @@ AC_SUBST(NS_USE_NATIVE)
AC_SUBST(MOZ_JS_LIBS)
AC_SUBST(MOZ_PSM)
AC_SUBST(MOZ_DEBUG)
AC_SUBST(MOZ_DEBUG_MODULES)
AC_SUBST(MOZ_DEBUG_SYMBOLS)
AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
AC_SUBST(MOZ_DEBUG_FLAGS)
AC_SUBST(MOZ_DEBUG_LDFLAGS)
AC_SUBST(WARNINGS_AS_ERRORS)
AC_SUBST(MOZ_DBGRINFO_MODULES)
AC_SUBST(MOZ_LEAKY)
AC_SUBST(MOZ_JPROF)
AC_SUBST(MOZ_SHARK)
@ -4938,7 +4941,6 @@ AC_SUBST(MOZ_PKG_SPECIAL)
AC_SUBST(MOZILLA_OFFICIAL)
dnl win32 options
AC_SUBST(MOZ_DEBUG_SYMBOLS)
AC_SUBST(MOZ_MAPINFO)
AC_SUBST(MOZ_BROWSE_INFO)
AC_SUBST(MOZ_TOOLS_DIR)