Add 'example' allowing simple command-line attachment
This commit is contained in:
parent
74eb94fe53
commit
018ae05de8
2 changed files with 37 additions and 0 deletions
13
support/test/example/attach.vim
Normal file
13
support/test/example/attach.vim
Normal file
|
|
@ -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
|
||||
24
support/test/example/cpp.json
Normal file
24
support/test/example/cpp.json
Normal file
|
|
@ -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 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue