From 018ae05de81c6414402cd460356c4af07f95ca6e Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Fri, 17 Jan 2020 17:50:54 +0000 Subject: [PATCH] Add 'example' allowing simple command-line attachment --- support/test/example/attach.vim | 13 +++++++++++++ support/test/example/cpp.json | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 support/test/example/attach.vim create mode 100644 support/test/example/cpp.json diff --git a/support/test/example/attach.vim b/support/test/example/attach.vim new file mode 100644 index 0000000..dda00a9 --- /dev/null +++ b/support/test/example/attach.vim @@ -0,0 +1,13 @@ +if argc() < 2 + echom 'Usage:' v:argv[ 0 ] 'processName binary' + cquit! +endif + +setfiletype cpp +call vimspector#LaunchWithSettings( #{ + \ configuration: "C++ - Attach Local Process", + \ processName: argv( 0 ), + \ binary: argv( 1 ), + \ } ) + +1,2argd diff --git a/support/test/example/cpp.json b/support/test/example/cpp.json new file mode 100644 index 0000000..ba52fcd --- /dev/null +++ b/support/test/example/cpp.json @@ -0,0 +1,24 @@ +{ + "configurations": { + "C++ - Attach Local Process": { + "adapter": "vscode-cpptools", + "variables": { + "PID": { + "shell": [ "GetPIDForProcess", "${processName}" ] + } + }, + "configuration": { + "name": "test", + "request": "attach", + "program": "${binary}", + "processId": "${PID}", + + "type": "cppdbg", + "stopAtEntry": true, + "setupCommands": [ + { "text": "source ${initFile}", "ignoreFailures": true } + ] + } + } + } +}