Skip to content

Commit

Permalink
Update vscode configs (#1451)
Browse files Browse the repository at this point in the history
Co-authored-by: Pierre Wielders <[email protected]>
  • Loading branch information
bramoosterhuis and pwielders authored Nov 17, 2023
1 parent 8ae0f44 commit 1b16edc
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 17 deletions.
90 changes: 73 additions & 17 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
},
"externalConsole": false,
"linux": {
"name": "Local Debug WPEFramework on Linux",
"program": "${config:thunder.installPath}/usr/bin/WPEFramework",
"type":"cppdbg",
"request": "launch",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
Expand All @@ -34,11 +31,16 @@
"ignoreFailures": true
}
],
"sourceFileMap": {
},
"sourceFileMap": {},
"environment": [
{ "name": "LD_LIBRARY_PATH", "value": "${config:thunder.installPath}/usr/lib" },
{ "name": "PATH", "value": "${config:thunder.installPath}/usr/bin"},
{
"name": "LD_LIBRARY_PATH",
"value": "${config:thunder.installPath}/usr/lib"
},
{
"name": "PATH",
"value": "${config:thunder.installPath}/usr/bin"
},
],
"additionalSOLibSearchPath": "${config:thunder.installPath}/usr/lib;/usr/local/lib;/usr/lib;/lib",
},
Expand All @@ -55,21 +57,17 @@
"trace": false,
"traceResponse": false,
"engineLogging": false,
},
},
"linux": {
"name": "Remote Debug WPEFramework on Linux",
"program": "${config:thunder.installPath}/usr/bin/WPEFramework",
"type":"cppdbg",
"request": "launch",
"MIMode": "gdb",
"miDebuggerServerAddress": "${config:thunder.remoteTargetHost}:${config:thunder.remoteTargetDebugPort}",
"miDebuggerPath": "${config:thunder.crossToolsPath}/${config:thunder.crossToolsPrefix}gdb",
"miDebuggerArgs": "",
"setupCommands": [
{"text": "-enable-pretty-printing"},
// commands if gdbserver is started with --multi
// {"text": "target extended-remote ${config:thunder.remoteTargetHost}:${config:thunder.remoteTargetDebugPort}"},
// {"text": "set remote exec-file WPEFramework"}
{
"text": "-enable-pretty-printing"
},
],
"sourceFileMap": {
// "remote": "local"
Expand All @@ -80,6 +78,64 @@
"preLaunchTask": "Prepare WPEFramework for remote gdb debugging",
"postDebugTask": "Clean debugging run"
}
}
},
// Start GBD on target with:
// sshpass -v -p <password> ssh -t <user>:<address> "killall -9 gdbserver; gdbserver --multi :55550"
// or with a certificate:
// ssh -i <path/to/private/key> -t <user>:<address> "killall -9 gdbserver; gdbserver --multi :55550"
{
"name": "Remote GDB (multi) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${config:thunder.installPath}/usr/bin/WPEFramework-1.0.0",
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"stopAtEntry": false,
"targetArchitecture": "arm",
"MIMode": "gdb",
"miDebuggerPath": "${config:thunder.crossToolsPath}/${config:thunder.crossToolsPrefix}gdb",
"miDebuggerServerAddress": "${config:thunder.remoteTargetHost}:${config:thunder.remoteTargetDebugPort}",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
],
"customLaunchSetupCommands": [
{
"text": "file ${config:thunder.installPath}/usr/bin/WPEFramework-1.0.0",
"description": "Load symbols",
"ignoreFailures": false
},
{
"text": "target extended-remote ${config:thunder.remoteTargetHost}:${config:thunder.remoteTargetDebugPort}",
"description": "Connect to gdbserver",
"ignoreFailures": false
},
{
"text": "remote put ${config:thunder.installPath}/usr/bin/WPEFramework-1.0.0 /usr/bin/WPEFramework-1.0.0",
"description": "Copy the locally cross-compiled executable to the target",
"ignoreFailures": false
},
{
"text": "set remote exec-file /usr/bin/WPEFramework-1.0.0",
"description": "Set the executable to be debugged",
"ignoreFailures": false
},
{
"text": "set args -c/etc/WPEFramework/config.json",
"description": "Set Arguments for the executable",
"ignoreFailures": false
},
{
"text": "tbreak main",
"description": "Set temporary breakpoint @main()",
"ignoreFailures": false
}
],
"launchCompleteCommand": "exec-run"
},
]
}
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"PORT":"55555",
"BINDING":"127.0.0.1",
"IDLE_TIME":"180",
"BUILD_SHARED_LIBS" : "ON"
}
}
32 changes: 32 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,38 @@
"focus": true,
"close": true
}
},
{
"label": "Start multi gdbserver",
"type": "process",
"command": "ssh",
"args": [
"-i",
"${config:thunder.remoteTargetID}",
"${config:thunder.remoteTargetUser}@${config:thunder.remoteTargetHost}",
"killall -9 gdbserver; gdbserver --multi :55550"
],
"isBackground": true,
"problemMatcher": {
"pattern": {
"regexp": ".*",
"file": 1,
"line": 1,
"message": 1
},
"background": {
"activeOnStart": true,
"beginsPattern": "^.*Listening on port*",
"endsPattern": "^.*"
}
},
"presentation": {
"reveal": "always",
"panel": "dedicated",
"clear": true,
"focus": true,
"close": true
}
}
],
}

0 comments on commit 1b16edc

Please sign in to comment.