mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8375241: Simplify --with-native-debug-symbols-level option implementation
Reviewed-by: erikj, shade
This commit is contained in:
parent
7f2aa59f82
commit
39f0e6d6f9
@ -69,22 +69,18 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
|||||||
# Debug prefix mapping if supported by compiler
|
# Debug prefix mapping if supported by compiler
|
||||||
DEBUG_PREFIX_CFLAGS=
|
DEBUG_PREFIX_CFLAGS=
|
||||||
|
|
||||||
UTIL_ARG_WITH(NAME: native-debug-symbols-level, TYPE: string,
|
UTIL_ARG_WITH(NAME: native-debug-symbols-level, TYPE: literal,
|
||||||
DEFAULT: "",
|
DEFAULT: [auto], VALID_VALUES: [auto 1 2 3],
|
||||||
RESULT: DEBUG_SYMBOLS_LEVEL,
|
CHECK_AVAILABLE: [
|
||||||
|
if test x$TOOLCHAIN_TYPE = xmicrosoft; then
|
||||||
|
AVAILABLE=false
|
||||||
|
fi
|
||||||
|
],
|
||||||
DESC: [set the native debug symbol level (GCC and Clang only)],
|
DESC: [set the native debug symbol level (GCC and Clang only)],
|
||||||
DEFAULT_DESC: [toolchain default])
|
DEFAULT_DESC: [toolchain default],
|
||||||
AC_SUBST(DEBUG_SYMBOLS_LEVEL)
|
IF_AUTO: [
|
||||||
|
RESULT=""
|
||||||
if test "x${TOOLCHAIN_TYPE}" = xgcc || \
|
])
|
||||||
test "x${TOOLCHAIN_TYPE}" = xclang; then
|
|
||||||
DEBUG_SYMBOLS_LEVEL_FLAGS="-g"
|
|
||||||
if test "x${DEBUG_SYMBOLS_LEVEL}" != "x"; then
|
|
||||||
DEBUG_SYMBOLS_LEVEL_FLAGS="-g${DEBUG_SYMBOLS_LEVEL}"
|
|
||||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${DEBUG_SYMBOLS_LEVEL_FLAGS}],
|
|
||||||
IF_FALSE: AC_MSG_ERROR("Debug info level ${DEBUG_SYMBOLS_LEVEL} is not supported"))
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Debug symbols
|
# Debug symbols
|
||||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||||
@ -111,8 +107,8 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Debug info level should follow the debug format to be effective.
|
# Debug info level should follow the debug format to be effective.
|
||||||
CFLAGS_DEBUG_SYMBOLS="-gdwarf-4 ${DEBUG_SYMBOLS_LEVEL_FLAGS}"
|
CFLAGS_DEBUG_SYMBOLS="-gdwarf-4 -g${NATIVE_DEBUG_SYMBOLS_LEVEL}"
|
||||||
ASFLAGS_DEBUG_SYMBOLS="${DEBUG_SYMBOLS_LEVEL_FLAGS}"
|
ASFLAGS_DEBUG_SYMBOLS="-g${NATIVE_DEBUG_SYMBOLS_LEVEL}"
|
||||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||||
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
|
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
|
||||||
# Check if compiler supports -fdebug-prefix-map. If so, use that to make
|
# Check if compiler supports -fdebug-prefix-map. If so, use that to make
|
||||||
@ -132,8 +128,8 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
|||||||
IF_FALSE: [GDWARF_FLAGS=""])
|
IF_FALSE: [GDWARF_FLAGS=""])
|
||||||
|
|
||||||
# Debug info level should follow the debug format to be effective.
|
# Debug info level should follow the debug format to be effective.
|
||||||
CFLAGS_DEBUG_SYMBOLS="${GDWARF_FLAGS} ${DEBUG_SYMBOLS_LEVEL_FLAGS}"
|
CFLAGS_DEBUG_SYMBOLS="${GDWARF_FLAGS} -g${NATIVE_DEBUG_SYMBOLS_LEVEL}"
|
||||||
ASFLAGS_DEBUG_SYMBOLS="${DEBUG_SYMBOLS_LEVEL_FLAGS}"
|
ASFLAGS_DEBUG_SYMBOLS="-g${NATIVE_DEBUG_SYMBOLS_LEVEL}"
|
||||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||||
CFLAGS_DEBUG_SYMBOLS="-Z7"
|
CFLAGS_DEBUG_SYMBOLS="-Z7"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user