Meta: Support llvm-addr2line in serenity.sh

With this, the subcommands 'addr2line` and `kaddr2line` work as with the
GNU toolchain.
This commit is contained in:
Daniel Bertalan 2021-09-23 16:29:07 +02:00 committed by Linus Groh
parent 10c3cf9a47
commit 928665d3bc
Notes: sideshowbarker 2024-07-18 02:14:17 +09:00

View file

@ -372,7 +372,12 @@ if [[ "$CMD" =~ ^(build|install|image|copy-src|run|gdb|test|rebuild|recreate|kad
lagom_unsupported
build_target
[ $# -ge 1 ] || usage
"$TOOLCHAIN_DIR/binutils/binutils/addr2line" -e "$BUILD_DIR/Kernel/Kernel" "$@"
if [ "$TOOLCHAIN_TYPE" = "Clang" ]; then
ADDR2LINE="$TOOLCHAIN_DIR/bin/llvm-addr2line"
else
ADDR2LINE="$TOOLCHAIN_DIR/binutils/binutils/addr2line"
fi
"$ADDR2LINE" -e "$BUILD_DIR/Kernel/Kernel" "$@"
;;
addr2line)
build_target
@ -382,6 +387,8 @@ if [[ "$CMD" =~ ^(build|install|image|copy-src|run|gdb|test|rebuild|recreate|kad
if [ "$TARGET" = "lagom" ]; then
command -v addr2line >/dev/null 2>&1 || die "Please install addr2line!"
ADDR2LINE=addr2line
elif [ "$TOOLCHAIN_TYPE" = "Clang" ]; then
ADDR2LINE="$TOOLCHAIN_DIR/bin/llvm-addr2line"
else
ADDR2LINE="$TOOLCHAIN_DIR/binutils/binutils/addr2line"
fi