From 929ce5e859858bf3db475fb4aaa49899b22f1d68 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 10 Jul 2022 22:00:10 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Add=20Sim?= =?UTF-8?q?=20debug=20with=20lldb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/PlatformIO/debugging/launch.json | 19 ++++++++--- ini/native.ini | 34 ++++++++++++++----- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/buildroot/share/PlatformIO/debugging/launch.json b/buildroot/share/PlatformIO/debugging/launch.json index 583d860eb36c..f9936ebcedf9 100644 --- a/buildroot/share/PlatformIO/debugging/launch.json +++ b/buildroot/share/PlatformIO/debugging/launch.json @@ -25,15 +25,26 @@ "svdFile": "${env:HOME}/.platformio/platforms/ststm32@12.1.1/misc/svd/STM32F40x.svd", }, { - "name": "Debug Sim", + "name": "Launch Sim (ggdb)", "request": "launch", "type": "cppdbg", "cwd": "${workspaceRoot}", - //"program": ".pio/build/simulator_linux_debug/MarlinSimulator", - //"program": ".pio/build/simulator_windows/MarlinSimulator", - "program": ".pio/build/simulator_macos_debug/MarlinSimulator", + "program": "${workspaceRoot}/.pio/build/simulator_macos_debug/debug/MarlinSimulator", + //"program": "${workspaceRoot}/.pio/build/simulator_linux_debug/MarlinSimulator", + //"program": "${workspaceRoot}/.pio/build/simulator_windows/MarlinSimulator", "miDebuggerPath": "/opt/local/bin/ggdb", "MIMode": "gdb" + }, + { + "name": "Launch Sim (lldb)", + "request": "launch", + "type": "cppdbg", + "cwd": "${workspaceRoot}", + "program": "${workspaceRoot}/.pio/build/simulator_macos_debug/debug/MarlinSimulator", + //"program": "${workspaceRoot}/.pio/build/simulator_linux_debug/MarlinSimulator", + //"program": "${workspaceRoot}/.pio/build/simulator_windows/MarlinSimulator", + //"targetArchitecture": "arm64", + "MIMode": "lldb" } ] } diff --git a/ini/native.ini b/ini/native.ini index 693a985d4e92..1905559fd060 100644 --- a/ini/native.ini +++ b/ini/native.ini @@ -63,20 +63,36 @@ build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags} # # Simulator for macOS (MacPorts) # -# sudo port install gcc11 gdb glm libsdl2 libsdl2_net freetype -# sudo port install ld64 @3_3 +ld64_xcode + +# +# MacPorts: +# sudo port install gcc11 glm libsdl2 libsdl2_net # # cd /opt/local/bin # sudo rm -f gcc g++ cc # sudo ln -s gcc-mp-11 gcc ; sudo ln -s g++-mp-11 g++ ; sudo ln -s g++ cc -# This step may be obsolete: -# sudo port uninstall ld64 ld64-latest -# -# cd - +# cd - +# rehash # # Use 'sudo port install mesa' to get a if no Xcode is installed. # If Xcode is installed be sure to run `xcode-select --install` first. # +#================================================================================== +# +# Homebrew: +# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +# +# brew install gcc@12 glm sdl2 sdl2_net +# +# cd /opt/homebrew/bin +# sudo rm -f gcc g++ cc +# sudo ln -s gcc-12 gcc ; sudo ln -s g++-12 g++ ; sudo ln -s g++ cc +# cd - +# +# Use 'brew install mesa' to get a if no Xcode is installed. +# If Xcode is installed be sure to run `xcode-select --install` first. +# + [simulator_macos] build_unflags = -lGL -fstack-protector-strong build_flags = @@ -110,7 +126,7 @@ custom_gcc = g++ # pacman -S --needed base-devel mingw-w64-x86_64-toolchain mingw64/mingw-w64-x86_64-glm mingw64/mingw-w64-x86_64-SDL2 mingw64/mingw-w64-x86_64-SDL2_net mingw-w64-x86_64-dlfcn # [env:simulator_windows] -extends = simulator_common +extends = simulator_common build_src_flags = ${simulator_common.build_src_flags} -fpermissive -build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags} -IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows -ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp -build_type = debug +build_flags = ${simulator_common.build_flags} ${simulator_common.debug_build_flags} -IC:\\msys64\\mingw64\\include\\SDL2 -fno-stack-protector -Wl,-subsystem,windows -ldl -lmingw32 -lSDL2main -lSDL2 -lSDL2_net -lopengl32 -lssp +build_type = debug