From 2bfab835e6cd3c68eb1e685a203e3358c222f608 Mon Sep 17 00:00:00 2001 From: brian khuu Date: Thu, 16 May 2024 09:23:42 +1000 Subject: [PATCH] debug-test.sh: fix gdb --- scripts/debug-test.sh | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/scripts/debug-test.sh b/scripts/debug-test.sh index febeb7dba..7b2b601a9 100755 --- a/scripts/debug-test.sh +++ b/scripts/debug-test.sh @@ -110,7 +110,7 @@ rm -rf "$build_dir" && mkdir "$build_dir" || abort "Failed to make $build_dir" ########################################################### # Note: test-eval-callback requires -DLLAMA_CURL -cmake -B "./$build_dir" -DCMAKE_BUILD_TYPE=Debug -DLLAMA_CUDA=1 -DLLAMA_FATAL_WARNINGS=ON -DLLAMA_CURL=1 || abort "Failed to build enviroment" +cmake -B "./$build_dir" -DCMAKE_BUILD_TYPE=Debug -DLLAMA_CUDA=1 -DLLAMA_CURL=1 || abort "Failed to build enviroment" pushd "$build_dir" make -j || abort "Failed to compile" popd > /dev/null || exit 1 @@ -176,20 +176,9 @@ printf "${magenta}Running Test #${test_number}: ${single_test_name}${normal}\n" printf "${cyan}single_test_command: ${single_test_command}${normal}\n" if [ "$gdb_mode" = "true" ]; then - printf "${blue}Replacing single test command string that may have /../ in them with the relative path, i.e. path/../path -> ../path.${normal}\n" - gdb_args=() - for piece in $(echo ${single_test_command} | sed -e 's/"\/\"//') - do - transformed_piece=($(echo $piece | sed -e 's/.*\/..\//..\//')) - printf "${blue} - '${piece}' --> '${transformed_piece}' ${normal}\n" - gdb_args+="$transformed_piece" - done - - printf "${yellow}gdb_args[@]: ${gdb_args[@]}${normal}\n" - # Execute debugger pushd "$repo_root" || exit 1 - gdb --args ${gdb_args[@]} + eval "gdb --args ${single_test_command}" popd > /dev/null || exit 1 else