debugging

This commit is contained in:
John Smith 2023-03-04 15:16:03 -05:00
parent ddadf61f06
commit f9d8d1688f
3 changed files with 38 additions and 0 deletions

21
.vscode/launch.json vendored
View File

@ -3,6 +3,13 @@
// Hover to view descriptions of existing attributes. // Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"inputs": [
{
"id": "pickPid",
"type": "promptString",
"description": "Enter process id"
}
],
"configurations": [ "configurations": [
{ {
"type": "lldb", "type": "lldb",
@ -14,6 +21,20 @@
"rust" "rust"
] ]
}, },
{
"type": "lldb",
"request": "launch",
"name": "Launch remote veilid-server",
"program": "${workspaceFolder}/target/debug/veilid-server",
"initCommands": [
"platform select remote-linux",
"platform connect connect://127.0.0.1:6969",
"settings set target.inherit-env false",
],
"sourceLanguages": [
"rust"
]
},
{ {
"type": "lldb", "type": "lldb",
"request": "attach", "request": "attach",

5
scripts/debug.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
killall lldb-server 2> /dev/null
echo Running lldb-server
lldb-server platform --server --listen 127.0.0.1:6969 --gdbserver-port 6970

12
scripts/debug_ssh.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SSHHOST=$1
if [[ "$SSHHOST" == "" ]]; then
SSHHOST="bootstrap-1.dev.veilid.net"
fi
echo Copying debug script
scp -q $SCRIPTDIR/debug.sh $SSHHOST:/tmp/debug.sh
echo Connecting to debug server
ssh -t $SSHHOST -L 6969:127.0.0.1:6969 -L 6970:127.0.0.1:6970 'bash /tmp/debug.sh'