mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
[PR] dev: enable tracing of functions return trap (#3281)
- via environment variable ARMBIAN_ENABLE_CALL_TRACING=yes Signed-off-by: Ricardo Pardini <ricardo@pardini.net>
This commit is contained in:
@@ -20,6 +20,13 @@ grep -q "[[:space:]]" <<<"${SRC}" && { echo "\"${SRC}\" contains whitespace. Not
|
||||
|
||||
cd "${SRC}" || exit
|
||||
|
||||
if [[ "${ARMBIAN_ENABLE_CALL_TRACING}" == "yes" ]]; then
|
||||
set -T # inherit return/debug traps
|
||||
mkdir -p "${SRC}"/output/debug
|
||||
echo -n "" > "${SRC}"/output/debug/calls.txt
|
||||
trap 'echo "${BASH_LINENO[@]}|${BASH_SOURCE[@]}|${FUNCNAME[@]}" >> ${SRC}/output/debug/calls.txt ;' RETURN
|
||||
fi
|
||||
|
||||
if [[ -f "${SRC}"/lib/general.sh ]]; then
|
||||
|
||||
# shellcheck source=lib/general.sh
|
||||
|
||||
Reference in New Issue
Block a user