From 97cdacecba9c99be830b9c5a0311133c181923d9 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Sat, 30 Aug 2025 20:37:32 +0200 Subject: [PATCH] kodev: fix `run -g` (#14257) Close #14256. --- kodev | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/kodev b/kodev index bf6856fcb..be5b17cf1 100755 --- a/kodev +++ b/kodev @@ -475,18 +475,17 @@ ANDROID TARGET: if [[ -n "${VALUE}" ]]; then declare -a "wrap=(${VALUE})" else - if is_system macOS; then - if ! wrap=("$(command -v lldb | head -n1)"); then - die 1 "Couldn't find LLDB." - fi - else + local -a candidates + case "${OSTYPE}" in + darwin*) candidates=(lldb) ;; # Try to use friendly defaults for GDB: # - DDD is a slightly less nice GUI # - cgdb is a nice curses-based GDB front # - GDB standard CLI has a fallback - if ! wrap=("$(command -v ddd cgdb gdb | head -n1)"); then - die 1 "Couldn't find GDB." - fi + *) candidates=(ddd cgdb gdb) ;; + esac + if ! wrap=("$(command -v "${candidates[@]}" | head -n1)"); then + die 1 "Couldn't find a supported debugger (${candidates[*]})." fi fi if [[ ${#wrap[@]} -eq 1 ]]; then