Add support to connect Arm Development Studio IDE to FVP on local runs.
This patch adds the environment variable "connect_debugger" to CI:
* When connect_debugger == 0 (default), CI will work as usual.
* When connect_debugger == 1, CI will
- Call FVP with the -S flag enabled, so it can connect
to ARM DS IDE for debugging sessions.
- Set test_run variable to 1, overriding any manual
setting for this variable.
- Build TF-A with SPIN_ON_BL1 flag enabled.
Change-Id: I300b9babc28c0d4752bf3352ca3599da14f34edb
Signed-off-by: Javier Almansa Sobrino <javier.almansasobrino@arm.com>
diff --git a/script/build_package.sh b/script/build_package.sh
index 6a5fe6e..9b8e000 100755
--- a/script/build_package.sh
+++ b/script/build_package.sh
@@ -489,10 +489,14 @@
EOF
+ if not_upon "$local_ci"; then
+ connect_debugger=0
+ fi
+
# Build TF. Since build output is being directed to the build log, have
# descriptor 3 point to the current terminal for build wrappers to vent.
$tf_build_wrapper make $make_j_opts $(cat "$config_file") \
- DEBUG="$DEBUG" V=1 \
+ DEBUG="$DEBUG" V=1 SPIN_ON_BL1_EXIT="$connect_debugger" \
$build_targets 3>&1 &>>"$build_log" || fail_build
)
}
@@ -795,6 +799,7 @@
gen_model_params() {
local model_param_file="$archive/model_params"
+ [ "$connect_debugger" ] && [ "$connect_debugger" -eq 1 ] && wait_debugger=1
set_default_bin_paths
echo "Generating model parameter for $model..."
diff --git a/script/run_local_ci.sh b/script/run_local_ci.sh
index 6404560..b8a8995 100755
--- a/script/run_local_ci.sh
+++ b/script/run_local_ci.sh
@@ -337,10 +337,12 @@
fi
# User preferences
-user_test_run="$test_run"
+[ "$connect_debugger" ] && [ "$connect_debugger" -eq 1 ] && user_connect_debugger=1
+user_test_run="${user_connect_debugger:-$test_run}"
user_dont_clean="$dont_clean"
user_keep_going="$keep_going"
user_primary_live="$primary_live"
+user_connect_debugger="${user_connect_debugger:-0}"
export ci_root
export dont_clean=0
@@ -350,6 +352,7 @@
export primary_live=0
export cc_path_spec
export import_cc
+export connect_debugger="$user_connect_debugger"
rm -rf "$workspace"
mkdir -p "$workspace"