summaryrefslogtreecommitdiff
path: root/tcwg_gnu-build.sh
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2020-05-15 17:02:55 +0100
committerDavid Spickett <david.spickett@linaro.org>2020-05-18 10:37:32 +0000
commita792a1d55fd28fab9b79ba8d1f8d336a4840e181 (patch)
tree905948d56395489e04a40533bf645cf26146406b /tcwg_gnu-build.sh
parentdcc16d9eaae5ba56f999e1dc2a101abf6ad92ca8 (diff)
tcwg_bmk-build/tcwg_gnu-build: Add traceback printing
The line number you get from the previous message is confusing. For example: ERROR at run_step:524 Means that something in the function run_step, which was called from line 524, called exit. Instead, add a Python style traceback that shows the call stack with file, line and the content of that line. (though unfortunatley we can't get the line no. of the exit itself) Example traceback: ERROR Traceback (most recent call last): File: /tmp/foo.sh, line 37 foo # hey! File: /tmp/foo.sh, line 32 bar # hi there File: /tmp/foo.sh, line 1 (trap handler, 'exit' call line is unknown) Change-Id: Id6a2734e2b5ef74d05cd51cdbde9a95e5d5a4b44
Diffstat (limited to 'tcwg_gnu-build.sh')
-rwxr-xr-xtcwg_gnu-build.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/tcwg_gnu-build.sh b/tcwg_gnu-build.sh
index f88c8e81..24c5c44c 100755
--- a/tcwg_gnu-build.sh
+++ b/tcwg_gnu-build.sh
@@ -64,7 +64,7 @@ verbose2="${verbose2-false}"
if $verbose2; then set -x; fi
-trap "eval \"echo ERROR at \${FUNCNAME[0]}:\${BASH_LINENO[0]}\"" EXIT
+trap print_traceback EXIT
# Set start and finish steps for different modes.
default_start_at=""