Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose dlv's --backend arg in config #137

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lib/delve-connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class DelveConnection {
cwd,
env: variables.env
}
})
}).catch(reject)
}

const spawn = ({ dlvArgs, cwd, env }) => {
Expand Down Expand Up @@ -173,7 +173,7 @@ function hostAndPort (config) {
}

function getDlvArgs (config, variables) {
const { mode, program, showLog = false, buildFlags, init: dlvInit, args } = config
const { mode, program, showLog = false, buildFlags, backend = 'default', init: dlvInit, args } = config
const { host, port } = hostAndPort(config)
const dlvArgs = [mode || 'debug']

Expand All @@ -184,15 +184,22 @@ function getDlvArgs (config, variables) {
})
}

let possibleBackendValues = ['default', 'native', 'lldb', 'rr']
if (!possibleBackendValues.includes(backend)) {
return Promise.reject(new Error(`--backend must be one of these values ${possibleBackendValues.join(', ')}`));
}

return prom.then(() => {
if (mode === 'exec') {
// debug a pre compiled executable
dlvArgs.push(replaceVariable(program, variables))
}

dlvArgs.push(
'--headless=true',
`--listen=${host}:${port}`,
'--api-version=2'
'--api-version=2',
`--backend=${backend}`
)
if (showLog) {
// turn additional delve logging on or off
Expand Down