#!/bin/bash -e # Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved. # For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md source config/common.sh BIN_DIR="build-rt1051-Debug" help() { cat< /dev/null || echo "no python")" ) done # check for GDB versions with python 3 for i in "${!PY_VER[@]}"; do if [[ "${PY_VER[$i]}" == "3."* ]]; then GDB_ARM=${ALL_GDB_VERSIONS[$i]} echo "GDB with python 3 found" break fi done if [ -z ${GDB_ARM+x} ]; then # if GDB_ARM still unset check for GDB versions with python 2 for i in "${!PY_VER[@]}"; do if [[ "${PY_VER[$i]}" == "2."* ]]; then GDB_ARM=${ALL_GDB_VERSIONS[$i]} echo "GDB with python 2 found. For the best debugging experience update your GDB binaries from the most recent toolchain release" break fi done fi if [ -z ${GDB_ARM+x} ]; then if command -v arm-none-eabi-gdb &> /dev/null; then echo "No GDB with python found. If you want to use debugging tools please install a GDB version that supports python." GDB_ARM="arm-none-eabi-gdb" else echo "looks like you don't have any compatible GDB versions installed. Use the bootstrap.sh script to download and configure the ARM toolchain." fi fi fi if [ -z "${PRODUCT_NAME}" ]; then echo "ERROR! Product param not provided" help exit 1 fi check_target_rt1051 "${BIN_DIR}" "${PRODUCT_NAME}" ${GDB_ARM} "${BIN_DIR}"/"${PRODUCT_NAME}".elf -x .gdbinit-1051