This is a modified version of a previous patch that was reverted: https://reviews.llvm.org/D119797 This version only waits for the process to stop when using "launchCommands" or "attachCommands"... ...and doesn't play with the async mode when doing normal launch/attach. We discovered that when using "launchCommands" or "attachCommands" that there was an issue where these commands were not being run synchronously. There were further problems in this case where we would get thread events for the process that was just launched or attached before the IDE was ready, which is after "configurationDone" was sent to lldb-vscode. This fix introduces the ability to wait for the process to stop after "launchCommands" or "attachCommands" are run to ensure that we have a stopped process point that is ready for the debug session to proceed. We spin up the thread that listens for process events before we start the launch or attach, but we don't want stop events being delivered through the DAP protocol until the "configurationDone" packet is received. We now always ignore the stop event with a stop ID of 1, which is the first stop. All normal launch and attach scenarios use the synchronous mode, and "launchCommands and "attachCommands" run an array of LLDB commands in async mode. This should make our launch with "launchCommands" and attach with "attachCommands" avoid a race condition when the process is being launched or attached. Differential Revision: https://reviews.llvm.org/D120755
352 lines
11 KiB
JSON
352 lines
11 KiB
JSON
{
|
|
"name": "lldb-vscode",
|
|
"displayName": "LLDB native Debug stub",
|
|
"version": "0.1.0",
|
|
"publisher": "llvm",
|
|
"repository": "llvm.org",
|
|
"description": "Debug adapter for LLDB which uses a C++ tool to interface directly with LLDB.",
|
|
"author": {
|
|
"name": "Greg Clayton",
|
|
"email": "clayborg@gmail.com"
|
|
},
|
|
"license": "LLVM",
|
|
"keywords": [
|
|
"multi-root ready"
|
|
],
|
|
"engines": {
|
|
"vscode": "^1.18.0",
|
|
"node": "^7.9.0"
|
|
},
|
|
"categories": [
|
|
"Debuggers"
|
|
],
|
|
"private": true,
|
|
"devDependencies": {
|
|
"@types/node": "7.0.43",
|
|
"@types/mocha": "2.2.45",
|
|
"typescript": "2.6.2",
|
|
"mocha": "4.0.1",
|
|
"vscode": "1.1.10",
|
|
"vscode-debugadapter-testsupport": "1.25.0",
|
|
"tslint": "5.8.0",
|
|
"vsce": "^1.36.3"
|
|
},
|
|
"contributes": {
|
|
"languages": [
|
|
{
|
|
"id": "lldb.disassembly",
|
|
"aliases": [
|
|
"Disassembly"
|
|
],
|
|
"extensions": [
|
|
".disasm"
|
|
]
|
|
}
|
|
],
|
|
"grammars": [
|
|
{
|
|
"language": "lldb.disassembly",
|
|
"scopeName": "source.disassembly",
|
|
"path": "./syntaxes/disassembly.json"
|
|
}
|
|
],
|
|
"breakpoints": [
|
|
{
|
|
"language": "ada"
|
|
},
|
|
{
|
|
"language": "arm"
|
|
},
|
|
{
|
|
"language": "asm"
|
|
},
|
|
{
|
|
"language": "c"
|
|
},
|
|
{
|
|
"language": "cpp"
|
|
},
|
|
{
|
|
"language": "crystal"
|
|
},
|
|
{
|
|
"language": "d"
|
|
},
|
|
{
|
|
"language": "fortan"
|
|
},
|
|
{
|
|
"language": "fortran-modern"
|
|
},
|
|
{
|
|
"language": "nim"
|
|
},
|
|
{
|
|
"language": "objective-c"
|
|
},
|
|
{
|
|
"language": "objectpascal"
|
|
},
|
|
{
|
|
"language": "pascal"
|
|
},
|
|
{
|
|
"language": "rust"
|
|
},
|
|
{
|
|
"language": "swift"
|
|
}
|
|
],
|
|
"debuggers": [
|
|
{
|
|
"type": "lldb-vscode",
|
|
"label": "Native LLDB Debugger",
|
|
"enableBreakpointsFor": {
|
|
"languageIds": [
|
|
"ada",
|
|
"arm",
|
|
"asm",
|
|
"c",
|
|
"cpp",
|
|
"crystal",
|
|
"d",
|
|
"fortan",
|
|
"fortran-modern",
|
|
"nim",
|
|
"objective-c",
|
|
"objectpascal",
|
|
"pascal",
|
|
"rust",
|
|
"swift"
|
|
]
|
|
},
|
|
"program": "./bin/lldb-vscode",
|
|
"windows": {
|
|
"program": "./bin/lldb-vscode.exe"
|
|
},
|
|
"configurationAttributes": {
|
|
"launch": {
|
|
"required": [
|
|
"program"
|
|
],
|
|
"properties": {
|
|
"program": {
|
|
"type": "string",
|
|
"description": "Path to the program to debug."
|
|
},
|
|
"args": {
|
|
"type": [
|
|
"array",
|
|
"string"
|
|
],
|
|
"description": "Program arguments.",
|
|
"default": []
|
|
},
|
|
"cwd": {
|
|
"type": "string",
|
|
"description": "Program working directory.",
|
|
"default": "${workspaceRoot}"
|
|
},
|
|
"env": {
|
|
"type": "array",
|
|
"description": "Additional environment variables to set when launching the program. This is an array of strings that contains the variable name followed by an optional '=' character and the environment variable's value. Example: [\"FOO=BAR\", \"BAZ\"]",
|
|
"default": []
|
|
},
|
|
"stopOnEntry": {
|
|
"type": "boolean",
|
|
"description": "Automatically stop after launch.",
|
|
"default": false
|
|
},
|
|
"disableASLR": {
|
|
"type": "boolean",
|
|
"description": "Enable or disable Address space layout randomization if the debugger supports it.",
|
|
"default": true
|
|
},
|
|
"disableSTDIO": {
|
|
"type": "boolean",
|
|
"description": "Don't retrieve STDIN, STDOUT and STDERR as the program is running.",
|
|
"default": false
|
|
},
|
|
"shellExpandArguments": {
|
|
"type": "boolean",
|
|
"description": "Expand program arguments as a shell would without actually launching the program in a shell.",
|
|
"default": false
|
|
},
|
|
"detachOnError": {
|
|
"type": "boolean",
|
|
"description": "Detach from the program.",
|
|
"default": false
|
|
},
|
|
"sourcePath": {
|
|
"type": "string",
|
|
"description": "Specify a source path to remap \"./\" to allow full paths to be used when setting breakpoints in binaries that have relative source paths."
|
|
},
|
|
"sourceMap": {
|
|
"type": "array",
|
|
"description": "Specify an array of path remappings; each element must itself be a two element array containing a source and destination pathname. Overrides sourcePath.",
|
|
"default": []
|
|
},
|
|
"debuggerRoot": {
|
|
"type": "string",
|
|
"description": "Specify a working directory to set the debug adaptor to so relative object files can be located."
|
|
},
|
|
"targetTriple": {
|
|
"type": "string",
|
|
"description": "Triplet of the target architecture to override value derived from the program file."
|
|
},
|
|
"platformName": {
|
|
"type": "string",
|
|
"description": "Name of the execution platform to override value derived from the program file."
|
|
},
|
|
"initCommands": {
|
|
"type": "array",
|
|
"description": "Initialization commands executed upon debugger startup.",
|
|
"default": []
|
|
},
|
|
"preRunCommands": {
|
|
"type": "array",
|
|
"description": "Commands executed just before the program is launched.",
|
|
"default": []
|
|
},
|
|
"postRunCommands": {
|
|
"type": "array",
|
|
"description": "Commands executed just as soon as the program is successfully launched when it's in a stopped state prior to any automatic continuation.",
|
|
"default": []
|
|
},
|
|
"launchCommands": {
|
|
"type": "array",
|
|
"description": "Custom commands that are executed instead of launching a process. A target will be created with the launch arguments prior to executing these commands. The commands may optionally create a new target and must perform a launch. A valid process must exist after these commands complete or the \"launch\" will fail. Launch the process with \"process launch -s\" to make the process to at the entry point since lldb-vscode will auto resume if necessary.",
|
|
"default": []
|
|
},
|
|
"stopCommands": {
|
|
"type": "array",
|
|
"description": "Commands executed each time the program stops.",
|
|
"default": []
|
|
},
|
|
"exitCommands": {
|
|
"type": "array",
|
|
"description": "Commands executed at the end of debugging session.",
|
|
"default": []
|
|
},
|
|
"runInTerminal": {
|
|
"type": "boolean",
|
|
"description": "Launch the program inside an integrated terminal in the IDE. Useful for debugging interactive command line programs",
|
|
"default": false
|
|
},
|
|
"timeout": {
|
|
"type": "string",
|
|
"description": "The time in seconds to wait for a program to stop at entry point when launching with \"launchCommands\". Defaults to 30 seconds."
|
|
}
|
|
}
|
|
},
|
|
"attach": {
|
|
"properties": {
|
|
"program": {
|
|
"type": "string",
|
|
"description": "Path to the program to attach to."
|
|
},
|
|
"pid": {
|
|
"type": [
|
|
"number",
|
|
"string"
|
|
],
|
|
"description": "System process ID to attach to."
|
|
},
|
|
"waitFor": {
|
|
"type": "boolean",
|
|
"description": "If set to true, then wait for the process to launch by looking for a process with a basename that matches `program`. No process ID needs to be specified when using this flag.",
|
|
"default": true
|
|
},
|
|
"sourcePath": {
|
|
"type": "string",
|
|
"description": "Specify a source path to remap \"./\" to allow full paths to be used when setting breakpoints in binaries that have relative source paths."
|
|
},
|
|
"sourceMap": {
|
|
"type": "array",
|
|
"description": "Specify an array of path remappings; each element must itself be a two element array containing a source and destination pathname. Overrides sourcePath.",
|
|
"default": []
|
|
},
|
|
"debuggerRoot": {
|
|
"type": "string",
|
|
"description": "Specify a working directory to set the debug adaptor to so relative object files can be located."
|
|
},
|
|
"targetTriple": {
|
|
"type": "string",
|
|
"description": "Triplet of the target architecture to override value derived from the program file."
|
|
},
|
|
"platformName": {
|
|
"type": "string",
|
|
"description": "Name of the execution platform to override value derived from the program file."
|
|
},
|
|
"attachCommands": {
|
|
"type": "array",
|
|
"description": "Custom commands that are executed instead of attaching to a process ID or to a process by name. These commands may optionally create a new target and must perform an attach. A valid process must exist after these commands complete or the \"attach\" will fail.",
|
|
"default": []
|
|
},
|
|
"initCommands": {
|
|
"type": "array",
|
|
"description": "Initialization commands executed upon debugger startup.",
|
|
"default": []
|
|
},
|
|
"preRunCommands": {
|
|
"type": "array",
|
|
"description": "Commands executed just before the program is attached to.",
|
|
"default": []
|
|
},
|
|
"postRunCommands": {
|
|
"type": "array",
|
|
"description": "Commands executed just as soon as the program is successfully attached when it's in a stopped state prior to any automatic continuation.",
|
|
"default": []
|
|
},
|
|
"stopCommands": {
|
|
"type": "array",
|
|
"description": "Commands executed each time the program stops.",
|
|
"default": []
|
|
},
|
|
"exitCommands": {
|
|
"type": "array",
|
|
"description": "Commands executed at the end of debugging session.",
|
|
"default": []
|
|
},
|
|
"coreFile": {
|
|
"type": "string",
|
|
"description": "Path to the core file to debug."
|
|
},
|
|
"timeout": {
|
|
"type": "string",
|
|
"description": "The time in seconds to wait for a program to stop when attaching using \"attachCommands\". Defaults to 30 seconds."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"initialConfigurations": [
|
|
{
|
|
"type": "lldb-vscode",
|
|
"request": "launch",
|
|
"name": "Debug",
|
|
"program": "${workspaceRoot}/<your program>",
|
|
"args": [],
|
|
"env": [],
|
|
"cwd": "${workspaceRoot}"
|
|
}
|
|
],
|
|
"configurationSnippets": [
|
|
{
|
|
"label": "LLDB: Launch",
|
|
"description": "",
|
|
"body": {
|
|
"type": "lldb-vscode",
|
|
"request": "launch",
|
|
"name": "${2:Launch}",
|
|
"program": "^\"\\${workspaceRoot}/${1:<your program>}\"",
|
|
"args": [],
|
|
"env": [],
|
|
"cwd": "^\"\\${workspaceRoot}\""
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|