Initial commit (template)
This commit is contained in:
6
.vscode/extensions.json
vendored
Normal file
6
.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"ms-vscode.cpptools",
|
||||
"augustocdias.tasks-shell-input"
|
||||
],
|
||||
}
|
||||
76
.vscode/launch.json
vendored
Normal file
76
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Debug on ARM",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/build/${input:project_name}",
|
||||
"preLaunchTask": "Deploy and Start GDB Server",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"MIMode": "gdb",
|
||||
"externalConsole": false,
|
||||
"logging": {
|
||||
"engineLogging": false
|
||||
},
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
],
|
||||
"stopAtEntry": true,
|
||||
"miDebuggerServerAddress": "${input:target_ip}:2345",
|
||||
"miDebuggerPath": "${input:buildroot_path}/output/host/bin/arm-linux-gdb",
|
||||
"targetArchitecture": "arm"
|
||||
}
|
||||
],
|
||||
"inputs": [
|
||||
{
|
||||
"id": "target_ip",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": ". ${workspaceFolder}/.env && echo $TARGET_IP",
|
||||
"useFirstResult": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "target_user",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": ". ${workspaceFolder}/.env && echo $TARGET_USER",
|
||||
"useFirstResult": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "target_dir",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": ". ${workspaceFolder}/.env && echo $TARGET_DIR",
|
||||
"useFirstResult": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "buildroot_path",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": ". ${workspaceFolder}/.env && echo $BUILDROOT_PATH",
|
||||
"useFirstResult": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "project_name",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": ". ${workspaceFolder}/.env && echo $PROJECT_NAME",
|
||||
"useFirstResult": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
165
.vscode/tasks.json
vendored
Normal file
165
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,165 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"inputs": [
|
||||
{
|
||||
"id": "target_ip",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": ". ${workspaceFolder}/.env && echo $TARGET_IP",
|
||||
"useFirstResult": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "target_user",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": ". ${workspaceFolder}/.env && echo $TARGET_USER",
|
||||
"useFirstResult": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "target_dir",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": ". ${workspaceFolder}/.env && echo $TARGET_DIR",
|
||||
"useFirstResult": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "buildroot_path",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": ". ${workspaceFolder}/.env && echo $BUILDROOT_PATH",
|
||||
"useFirstResult": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "project_name",
|
||||
"type": "command",
|
||||
"command": "shellCommand.execute",
|
||||
"args": {
|
||||
"command": ". ${workspaceFolder}/.env && echo $PROJECT_NAME",
|
||||
"useFirstResult": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"tasks": [
|
||||
{
|
||||
"label": "CMake: Configure",
|
||||
"type": "shell",
|
||||
"command": "cmake",
|
||||
"args": [
|
||||
"-S", "${workspaceFolder}",
|
||||
"-B", "${workspaceFolder}/build",
|
||||
"-DCMAKE_TOOLCHAIN_FILE=${workspaceFolder}/rpi1-toolchain.cmake",
|
||||
"-DCMAKE_BUILD_TYPE=Debug",
|
||||
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON",
|
||||
"-DBUILDROOT_PATH=${input:buildroot_path}",
|
||||
"-DPROJECT_NAME_OVERRIDE=${input:project_name}"
|
||||
],
|
||||
"problemMatcher": [],
|
||||
"detail": "Configure CMake for cross-compilation"
|
||||
},
|
||||
{
|
||||
"label": "CMake: Build",
|
||||
"type": "shell",
|
||||
"command": "cmake",
|
||||
"args": [
|
||||
"--build", "${workspaceFolder}/build",
|
||||
"--config", "Debug",
|
||||
"-j", "4"
|
||||
],
|
||||
"dependsOn": "CMake: Configure",
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"detail": "Build the project with CMake"
|
||||
},
|
||||
{
|
||||
"label": "CMake: Clean",
|
||||
"type": "shell",
|
||||
"command": "cmake",
|
||||
"args": [
|
||||
"--build", "${workspaceFolder}/build",
|
||||
"--target", "clean"
|
||||
],
|
||||
"problemMatcher": [],
|
||||
"detail": "Clean build artifacts"
|
||||
},
|
||||
{
|
||||
"label": "CMake: Rebuild",
|
||||
"type": "shell",
|
||||
"dependsOn": ["CMake: Clean", "CMake: Build"],
|
||||
"dependsOrder": "sequence",
|
||||
"problemMatcher": [],
|
||||
"detail": "Clean and rebuild the project"
|
||||
},
|
||||
{
|
||||
"label": "Deploy",
|
||||
"type": "shell",
|
||||
"dependsOn": "CMake: Build",
|
||||
"command": "scp",
|
||||
"args": [
|
||||
"-O",
|
||||
"${workspaceFolder}/build/${input:project_name}",
|
||||
"${input:target_user}@${input:target_ip}:${input:target_dir}/${input:project_name}"
|
||||
],
|
||||
"problemMatcher": [],
|
||||
"group": {
|
||||
"kind": "build"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Start GDB Server",
|
||||
"type": "shell",
|
||||
"command": "ssh",
|
||||
"args": [
|
||||
"-t",
|
||||
"${input:target_user}@${input:target_ip}",
|
||||
"gdbserver :2345 ${input:target_dir}/${input:project_name}"
|
||||
],
|
||||
"isBackground": true,
|
||||
"presentation": {
|
||||
"reveal": "always",
|
||||
"panel": "dedicated",
|
||||
"focus": false,
|
||||
"clear": true
|
||||
},
|
||||
"problemMatcher": {
|
||||
"pattern": {
|
||||
"regexp": "^Listening on port (\\d+)$",
|
||||
"line": 1
|
||||
},
|
||||
"background": {
|
||||
"activeOnStart": true,
|
||||
"beginsPattern": ".",
|
||||
"endsPattern": "^Listening on port \\d+$"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Deploy and Start GDB Server",
|
||||
"dependsOn": ["Deploy", "Start GDB Server"],
|
||||
"dependsOrder": "sequence",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "Stop GDB Server",
|
||||
"type": "shell",
|
||||
"command": "ssh",
|
||||
"args": [
|
||||
"${input:target_user}@${input:target_ip}",
|
||||
"pkill -9 gdbserver"
|
||||
],
|
||||
"problemMatcher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user