🔨 Help for GDB remote debugging

This commit is contained in:
Scott Lahteine
2021-10-30 23:43:19 -05:00
committed by Scott Lahteine
parent 5a0166489e
commit 5cbb820e29
6 changed files with 60 additions and 25 deletions

View File

@ -29,10 +29,7 @@ src_filter = ${common.default_src_filter} +<src/HAL/LINUX>
#
# Tested with Linux (Mint 20) : gcc [9.3.0, 10.2.0]: libsdl2-dev[2.0.10], libsdl2-net-dev[2.0.1], libglm-dev[0.9.9.7, 0.9.9.8]
#
# Debugging with gdb in vscode is as easy as adding the launch task as usual, but platformio
# will randomly remove your task when it recreates its tasks from a template. Add your gdb
# launch task to '~/.platformio/penv/lib/python{PYTHON_VERSION}/site-packages/platformio/ide/tpls/vscode/.vscode'
# to avoid this until platformio updates.
# For VSCode debugging see buildroot/share/PlatformIO/debugging/launch.json
#
[simulator_common]
platform = native
@ -43,7 +40,6 @@ release_flags = -g0 -O3 -flto
debug_build_flags = -fstack-protector-strong -g -g3 -ggdb
lib_compat_mode = off
src_filter = ${common.default_src_filter} +<src/HAL/NATIVE_SIM>
lib_deps = ${common.lib_deps}
MarlinSimUI=https://github.com/p3p/MarlinSimUI/archive/master.zip
Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/marlin_sim_native.zip
@ -51,7 +47,6 @@ lib_deps = ${common.lib_deps}
extra_scripts = ${common.extra_scripts}
pre:buildroot/share/PlatformIO/scripts/simulator.py
[simulator_linux]
extends = simulator_common
build_flags = ${simulator_common.build_flags} -ldl -lpthread -lSDL2 -lSDL2_net -lGL
@ -84,17 +79,6 @@ build_flags = ${simulator_linux.build_flags} ${simulator_linux.release_flags}
# Use 'sudo port install mesa' to get a <GL/gl.h> if no Xcode is installed.
# If Xcode is installed be sure to run `xcode-select --install` first.
#
# For VSCode debugging paste the block below near the top of launch.json.
# NOTE: The PlatformIO VSCode extension will remove it when regenerating launch.json.
#
# { "name": "Debug Sim",
# "type": "cppdbg",
# "request": "launch",
# "program": "${workspaceFolder}/.pio/build/simulator_macos/MarlinSimulator",
# "miDebuggerPath": "/opt/local/bin/ggdb",
# "MIMode": "gdb",
# "cwd": "${workspaceFolder}/.pio/build/simulator_macos" },
#
[simulator_macos]
build_unflags = -lGL
custom_verbose = 0

View File

@ -410,7 +410,7 @@ extends = common_stm32f1
board = genericSTM32F103VE
build_flags = ${common_stm32f1.build_flags}
-ffunction-sections -fdata-sections -nostdlib -MMD
-DMCU_STM32F103VE -DARDUINO_GENERIC_STM32F103V -DARDUINO_ARCH_STM32F1 -O0
-DMCU_STM32F103VE -DARDUINO_GENERIC_STM32F103V -DARDUINO_ARCH_STM32F1
-DDEBUG_LEVEL=DEBUG_NONE -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1
-DSS_TIMER=4
board_build.variant = MARLIN_F103Vx

View File

@ -220,6 +220,7 @@ build_flags = ${stm_flash_drive.build_flags}
-DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6
-DHSE_VALUE=8000000U -DHAL_SD_MODULE_ENABLED
-DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8
upload_protocol = stlink
#
# BigTreeTech SKR V2.0 (STM32F407VGT6 ARM Cortex-M4) with USB Media Share Support
@ -230,6 +231,12 @@ extends = env:BIGTREE_SKR_2
build_flags = ${env:BIGTREE_SKR_2.build_flags} -DUSBD_USE_CDC_MSC
build_unflags = ${env:BIGTREE_SKR_2.build_unflags} -DUSBD_USE_CDC
[env:BIGTREE_SKR_2_USB_debug]
platform = ${common_stm32.platform}
extends = env:BIGTREE_SKR_2_USB
build_flags = ${env:BIGTREE_SKR_2_USB.build_flags} -O0
build_unflags = ${env:BIGTREE_SKR_2_USB.build_unflags} -Os -NDEBUG
#
# BigTreeTech Octopus V1.0/1.1 / Octopus Pro V1.0 (STM32F446ZET6 ARM Cortex-M4)
#