cl: switch debug symbols with LLGO_DEBUG

This commit is contained in:
Li Jie
2024-09-21 21:09:16 +08:00
parent 88b980ac17
commit dad22b1686
11 changed files with 43 additions and 68 deletions

View File

@@ -11,7 +11,8 @@ find_lldb() {
for lldb_path in "${lldb_paths[@]}"; do
if command -v "$lldb_path" >/dev/null 2>&1; then
local version=$("$lldb_path" --version | grep -oE '[0-9]+' | head -1)
local version
version=$("$lldb_path" --version | grep -oE '[0-9]+' | head -1)
if [ "$version" -ge 18 ]; then
echo "$lldb_path"
return 0
@@ -25,12 +26,13 @@ find_lldb() {
# Find LLDB 18+
LLDB_PATH=$(find_lldb)
export LLDB_PATH
# Default package path
DEFAULT_PACKAGE_PATH="./cl/_testdata/debug"
export DEFAULT_PACKAGE_PATH="./cl/_testdata/debug"
# Function to build the project
build_project() {
local package_path="$1"
go run ./cmd/llgo build -o "${package_path}/out" -dbg "${package_path}"
}
LLGO_DEBUG=1 go run ./cmd/llgo build -o "${package_path}/out" "${package_path}"
}