Skip to content

Commit

Permalink
fixes for debugging on macOS, cleanup, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
obiltschnig committed Jun 7, 2020
1 parent 6a51a05 commit 7f5a10e
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 17 deletions.
32 changes: 20 additions & 12 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,47 @@
"configurations": [
{
"name": "macOS LLDB (x86_64)",
"type": "cppdbg",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/macchina.io/server/bin/Darwin/x86_64/macchina",
"program": "${workspaceFolder}/macchina.io/server/bin/Darwin/x86_64/macchinad",
"args": ["--config=${workspaceFolder}/etc/macchina.properties"],
"stopAtEntry": false,
"stopOnEntry": false,
"cwd": "${workspaceFolder}",
"environment": [{ "name": "POCO_ENABLE_DEBUGGER", "value": "1" }],
"externalConsole": false,
"MIMode": "lldb"
"env": {
"POCO_ENABLE_DEBUGGER": "1",
"DYLD_LIBRARY_PATH": "${workspaceFolder}/macchina.io/platform/lib/Darwin/x86_64"
},
"terminal": "external"
},
{
"name": "Linux GDB (x86_64)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/macchina.io/server/bin/Linux/x86_64/macchina",
"program": "${workspaceFolder}/macchina.io/server/bin/Linux/x86_64/macchinad",
"args": ["--config=${workspaceFolder}/etc/macchina.properties"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [{ "name": "POCO_ENABLE_DEBUGGER", "value": "1" }],
"environment": [
{ "name": "POCO_ENABLE_DEBUGGER", "value": "1" },
{ "name": "LD_LIBRARY_PATH", "value": "${workspaceFolder}/macchina.io/platform/lib/Linux/x86_64:${workspaceFolder}/var/cache/bundles" }
],
"externalConsole": false,
"MIMode": "lldb"
"MIMode": "gdb"
},
{
"name": "Linux GDB (armv7l)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/macchina.io/server/bin/Linux/armv7l/macchina",
"program": "${workspaceFolder}/macchina.io/server/bin/Linux/armv7l/macchinad",
"args": ["--config=${workspaceFolder}/etc/macchina.properties"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [{ "name": "POCO_ENABLE_DEBUGGER", "value": "1" }],
"environment": [
{ "name": "POCO_ENABLE_DEBUGGER", "value": "1" },
{ "name": "LD_LIBRARY_PATH", "value": "${workspaceFolder}/macchina.io/platform/lib/Linux/armv7l:${workspaceFolder}/var/cache/bundles" }
],
"externalConsole": false,
"MIMode": "lldb"
"MIMode": "gdb"
}
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
"editor.tabSize": 4,
"files.associations": {
"*.bndlspec": "xml"
},
"files.exclude": {
"**/.dep": true,
"**/bin": true,
"**/obj": true
}
}
8 changes: 4 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"tasks": [
{
"type": "shell",
"label": "Build workspace",
"label": "Build all",
"command": "make",
"args": [
"-s"
Expand All @@ -25,7 +25,7 @@
},
{
"type": "shell",
"label": "Clean workspace",
"label": "Clean all",
"command": "make",
"args": [
"-s",
Expand All @@ -45,7 +45,7 @@
},
{
"type": "shell",
"label": "Build project",
"label": "Build single project",
"command": "make",
"args": [
"-s"
Expand All @@ -65,7 +65,7 @@
},
{
"type": "shell",
"label": "Clean project",
"label": "Clean single project",
"command": "make",
"args": [
"-s",
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# sample-workspace

A sample workspace for a project based on macchina.io IoT Edge Device SDK.
Configuration file for Visual Studio code are included.
This can be used as a template for your own projects.
The workspace includes the macchina.io IoT Edge SDK sources via a Git submodule.
The workspace includes one sample project, a simple implementation of a
temperature sensor based on the Linux Thermal subsystem (`/sys/class/thermal`).

## Visual Studio Code

Configuration files for Visual Studio Code are included in the workspace.
The following Visual Studio Code extensions should be installed:
- C/C++ (required)
- C++ Intellisense (highly recommended)
- CodeLLDB (required on macOS for debugging)

The following tasks have been defined in [tasks.json](.vscode/tasks.json):
- Build all: Builds the entire workspace using the global Makefile.
- Clean all: Cleans the entire workspace.
- Build single project: Builds a single project. The project's Makefile must be selected.
- Clean single project: Cleans a single project. The project's Makefile must be selected.
- RemoteGen: Runs the Remoting code generator. A RemoteGen.xml configuration file must be selected.

Launch configurations for debugging via gdb (on Linux) and lldb (on macOS) are also included.

0 comments on commit 7f5a10e

Please sign in to comment.