vscode update targets and gdb debugging

This commit is contained in:
Daniel Agar 2018-12-05 10:54:28 -05:00
parent 311c0941c9
commit fd8fe29ef3
7 changed files with 111 additions and 54 deletions

View File

@ -1,10 +1,6 @@
[
{
"name": "arm-none-eabi-gcc",
"toolchainFile": "cmake/toolchains/Toolchain-arm-none-eabi.cmake"
},
{
"name": "native",
"toolchainFile": "cmake/toolchains/Toolchain-native.cmake"
"name": "PX4 default",
"preferredGenerator": "Ninja"
}
]

View File

@ -1,33 +1,68 @@
CONFIG:
default: posix_sitl_default
default: px4_sitl_default
choices:
posix_sitl_default:
short: sitl
px4_sitl_default:
short: px4_sitl
buildType: RelWithDebInfo
settings:
CONFIG: posix_sitl_default
nuttx_px4fmu-v2_default:
short: px4fmu-v2
CONFIG: px4_sitl_default
px4_sitl_default_Debug:
short: px4_sitl (Debug)
buildType: Debug
settings:
CONFIG: px4_sitl_default
px4_sitl_rtps:
short: px4_sitl_rtps
buildType: RelWithDebInfo
settings:
CONFIG: px4_sitl_rtps
px4_fmu-v2_default:
short: px4_fmu-v2
buildType: MinRelSize
settings:
CONFIG: nuttx_px4fmu-v2_default
nuttx_px4fmu-v3_default:
short: px4fmu-v3
CONFIG: px4_fmu-v2_default
px4_fmu-v3_default:
short: px4_fmu-v3
buildType: MinRelSize
settings:
CONFIG: nuttx_px4fmu-v3_default
nuttx_px4fmu-v4_default:
short: px4fmu-v4
CONFIG: px4_fmu-v3_default
px4_fmu-v4_default:
short: px4_fmu-v4
buildType: MinRelSize
settings:
CONFIG: nuttx_px4fmu-v4_default
nuttx_px4fmu-v4pro_default:
short: px4fmu-v4pro
CONFIG: px4_fmu-v4_default
px4_fmu-v4pro_default:
short: px4_fmu-v4pro
buildType: MinRelSize
settings:
CONFIG: nuttx_px4fmu-v4pro_default
nuttx_px4fmu-v5_default:
short: px4fmu-v5
CONFIG: px4_fmu-v4pro_default
px4_fmu-v5_default:
short: px4_fmu-v5
buildType: MinRelSize
settings:
CONFIG: nuttx_px4fmu-v5_default
CONFIG: px4_fmu-v5_default
px4_fmu-v5_rtps:
short: px4_fmu-v5_rtps
buildType: MinRelSize
settings:
CONFIG: px4_fmu-v5_rtps
airmind_mindpx-v2_default:
short: airmind_mindpx-v2
buildType: MinRelSize
settings:
CONFIG: airmind_mindpx-v2_default
av_x-v1_default:
short: av-x
buildType: MinRelSize
settings:
CONFIG: av_x-v1_default
intel_aerofc-v1_default:
short: intel_aerofc-v1
buildType: MinRelSize
settings:
CONFIG: intel_aerofc-v1_default
nxp_fmuk66-v3_default:
short: nxp_fmuk66-v3
buildType: MinRelSize
settings:
CONFIG: nxp_fmuk66-v3_default

View File

@ -6,6 +6,7 @@
"github.vscode-pull-request-github",
"chiehyu.vscode-astyle",
"marus25.cortex-debug",
"ms-python.python",
"vector-of-bool.cmake-tools"
]
}

63
.vscode/launch.json vendored
View File

@ -2,43 +2,58 @@
"version": "0.2.0",
"configurations": [
{
"name": "(lldb) Launch",
"name": "(gdb) Launch (shell)",
"type": "cppdbg",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [],
"args": [
"${workspaceFolder}/ROMFS/px4fmu_common",
"-s", "etc/init.d-posix/rcS",
"-t", "${workspaceFolder}/test_data"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "lldb",
},
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
// Resolved by CMake Tools:
"program": "${command:cmake.launchTargetPath}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"externalConsole": true,
"cwd": "${workspaceFolder}/build/px4_sitl_default/tmp",
"environment": [{"name": "PX4_SIM_MODEL", "value": "shell"}],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
"ignoreFailures": true,
"text": "handle SIGCONT nostop noprint nopass",
}
]
}
},
{
"cwd": "${workspaceRoot}",
"executable": "${command:cmake.launchTargetPath}",
"name": "Debug Microcontroller",
"name": "(gdb) Launch (jmavsim iris)",
"type": "cppdbg",
"request": "launch",
"type": "cortex-debug",
"servertype": "jlink"
"program": "${command:cmake.launchTargetPath}",
"args": [
"${workspaceFolder}/ROMFS/px4fmu_common",
"-s", "etc/init.d-posix/rcS",
"-t", "${workspaceFolder}/test_data"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/build/px4_sitl_default/tmp",
"environment": [{"name": "PX4_SIM_MODEL", "value": "iris"}],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true,
"text": "handle SIGCONT nostop noprint nopass",
}
],
"preLaunchTask": "jmavsim"
},
]
}

View File

@ -5,4 +5,6 @@
"C_Cpp.default.cppStandard": "c++11",
"C_Cpp.default.cStandard": "c99",
"cmake.buildDirectory": "${workspaceRoot}/build/${variant:CONFIG}",
"cmake.autoRestartBuild": true,
"cmake.configureOnOpen": true,
}

15
.vscode/tasks.json vendored
View File

@ -6,11 +6,16 @@
{
"label": "jmavsim",
"type": "shell",
"command": "make posix_sitl_default jmavsim",
"group": {
"kind": "build",
"isDefault": true
"command": "Tools/jmavsim_run.sh",
"isBackground": true,
"args": ["-r", "500"],
"options": {
"cwd": "${workspaceRoot}"
},
"presentation": {
"reveal": "always",
"panel": "dedicated"
}
}
},
]
}

View File

@ -1,5 +1,6 @@
set(SITL_WORKING_DIR ${PX4_BINARY_DIR}/tmp)
file(MAKE_DIRECTORY ${SITL_WORKING_DIR})
file(MAKE_DIRECTORY ${SITL_WORKING_DIR}/rootfs)
# add a symlink to the logs dir to make it easier to find them
add_custom_command(OUTPUT ${PX4_BINARY_DIR}/logs
@ -7,6 +8,8 @@ add_custom_command(OUTPUT ${PX4_BINARY_DIR}/logs
WORKING_DIRECTORY ${PX4_BINARY_DIR})
add_custom_target(logs_symlink DEPENDS ${PX4_BINARY_DIR}/logs)
add_dependencies(px4 logs_symlink)
add_custom_target(run_config
COMMAND Tools/sitl_run.sh
$<TARGET_FILE:px4>