Skip to content

Commit

Permalink
embedded-linux: fix paths in VS code files
Browse files Browse the repository at this point in the history
- Using ${env:HOME} to refer to the home directory
- Making the difference between the normal and -bbb variants
  of the labs

Note that this is probably temporary. Instructions will
be more generic when we detail how to create these files.

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
  • Loading branch information
michaelopdenacker committed Nov 29, 2022
1 parent 94f36bb commit 440cc0c
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 4 deletions.
1 change: 0 additions & 1 deletion lab-data/embedded-linux-bbb/appdev

This file was deleted.

16 changes: 16 additions & 0 deletions lab-data/embedded-linux-bbb/appdev/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${env:HOME}/embedded-linux-bbb-labs/integration/buildroot/output/staging/**"
],
"defines": [],
"compilerPath": "${env:HOME}/embedded-linux-bbb-labs/integration/buildroot/output/host/bin/arm-linux-gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-arm"
}
],
"version": 4
}
26 changes: 26 additions & 0 deletions lab-data/embedded-linux-bbb/appdev/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/nunchuk-mpd-client",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"miDebuggerPath": "${env:HOME}/embedded-linux-bbb-labs/integration/buildroot/output/host/bin/arm-linux-gdb",
"miDebuggerServerAddress": "192.168.0.100:2345"
}
]
}
1 change: 1 addition & 0 deletions lab-data/embedded-linux-bbb/appdev/.vscode/tasks.json
1 change: 1 addition & 0 deletions lab-data/embedded-linux-bbb/appdev/nunchuk-mpd-client.c
19 changes: 19 additions & 0 deletions lab-data/embedded-linux-bbb/appdev/prep-debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

# Definitions
TARGETIP=192.168.0.100
PATH=$HOME/embedded-linux-bbb-labs/integration/buildroot/output/host/bin:$PATH
EXEC=nunchuk-mpd-client
CROSS_COMPILE=arm-linux-

# Rebuild executable
${CROSS_COMPILE}gcc -g -o $EXEC $EXEC.c $(pkg-config --libs --cflags libmpdclient)

# Kill gdbserver on the target
ssh root@$TARGETIP killall gdbserver

# Copy over new executable
scp $EXEC root@$TARGETIP:/root/

# Start gdbserver on the target
ssh -n -f root@$TARGETIP "sh -c 'nohup gdbserver localhost:2345 /root/nunchuk-mpd-client > /dev/null 2>&1 &'"
4 changes: 2 additions & 2 deletions lab-data/embedded-linux/appdev/.vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
{
"name": "Linux",
"includePath": [
"/home/mike/embedded-linux-labs/integration/buildroot/output/staging/**"
"${env:HOME}/embedded-linux-labs/integration/buildroot/output/staging/**"
],
"defines": [],
"compilerPath": "/home/mike/embedded-linux-labs/integration/buildroot/output/host/bin/arm-linux-gcc",
"compilerPath": "${env:HOME}/embedded-linux-labs/integration/buildroot/output/host/bin/arm-linux-gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-arm"
Expand Down
2 changes: 1 addition & 1 deletion lab-data/embedded-linux/appdev/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ignoreFailures": true
}
],
"miDebuggerPath": "/home/mike/embedded-linux-labs/integration/buildroot/output/host/bin/arm-linux-gdb",
"miDebuggerPath": "${env:HOME}/embedded-linux-labs/integration/buildroot/output/host/bin/arm-linux-gdb",
"miDebuggerServerAddress": "192.168.0.100:2345"
}
]
Expand Down

0 comments on commit 440cc0c

Please sign in to comment.