Browse Source

vscode add navio2 variant and native debug launch

release/1.12
Daniel Agar 4 years ago
parent
commit
38fbb452da
  1. 5
      .vscode/cmake-variants.yaml
  2. 10
      platforms/posix/CMakeLists.txt
  3. 33
      platforms/posix/Debug/launch_rpi.json.in
  4. 7
      platforms/posix/cmake/sitl_target.cmake

5
.vscode/cmake-variants.yaml vendored

@ -86,6 +86,11 @@ CONFIG: @@ -86,6 +86,11 @@ CONFIG:
buildType: MinSizeRel
settings:
CONFIG: cubepilot_cubeyellow_default
emlid_navio2_default:
short: emlid_navio2
buildType: MinSizeRel
settings:
CONFIG: emlid_navio2_default
holybro_durandal-v1_default:
short: holybro_durandal-v1
buildType: MinSizeRel

10
platforms/posix/CMakeLists.txt

@ -115,8 +115,18 @@ if("${PX4_BOARD}" MATCHES "beaglebone_blue") @@ -115,8 +115,18 @@ if("${PX4_BOARD}" MATCHES "beaglebone_blue")
elseif("${PX4_BOARD}" MATCHES "emlid_navio2")
target_link_libraries(px4 PRIVATE atomic)
# vscode launch.json
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/launch_rpi.json.in ${PX4_SOURCE_DIR}/.vscode/launch.json COPYONLY)
elseif("${PX4_BOARD}" MATCHES "sitl")
# vscode launch.json
if(${PX4_BOARD_LABEL} MATCHES "replay")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/launch_replay.json.in ${PX4_SOURCE_DIR}/.vscode/launch.json COPYONLY)
else()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/launch_sim.json.in ${PX4_SOURCE_DIR}/.vscode/launch.json COPYONLY)
endif()
include(sitl_target)
if(BUILD_TESTING)
include(sitl_tests)

33
platforms/posix/Debug/launch_rpi.json.in

@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "PX4 posix-configs/rpi/px4.config",
"type": "cppdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [
"-s", "../../posix-configs/rpi/px4.config"
],
"stopAtEntry": false,
"cwd": "${command:cmake.buildDirectory}",
"externalConsole": false,
"linux": {
"MIMode": "gdb",
"externalConsole": false,
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "PX4 ignore wq signals",
"text": "handle SIGCONT nostop noprint nopass",
"ignoreFailures": true
}
]
}
},
]
}

7
platforms/posix/cmake/sitl_target.cmake

@ -288,10 +288,3 @@ add_custom_target(list_vmd_make_targets @@ -288,10 +288,3 @@ add_custom_target(list_vmd_make_targets
COMMENT "List of acceptable '${PX4_BOARD}' <viewer_model_debugger> targets:"
VERBATIM
)
# vscode launch.json
if(${PX4_BOARD_LABEL} MATCHES "replay")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/launch_replay.json.in ${PX4_SOURCE_DIR}/.vscode/launch.json COPYONLY)
else()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Debug/launch_sim.json.in ${PX4_SOURCE_DIR}/.vscode/launch.json COPYONLY)
endif()

Loading…
Cancel
Save