Skip to content

Commit e9b4e6a

Browse files
use the process picker even if program is set
1 parent 2492e1e commit e9b4e6a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,16 @@ export class LLDBDapConfigurationProvider
3939
debugConfiguration: vscode.DebugConfiguration,
4040
_token?: vscode.CancellationToken,
4141
): vscode.ProviderResult<vscode.DebugConfiguration> {
42-
// Default "pid" to ${command:pickProcess} if neither "pid" nor "program" are specified
43-
// in an "attach" request.
44-
if (
45-
debugConfiguration.request === "attach" &&
46-
!("pid" in debugConfiguration) &&
47-
!("program" in debugConfiguration)
48-
) {
49-
debugConfiguration.pid = "${command:pickProcess}";
42+
if (debugConfiguration.request === "attach") {
43+
// Use the process picker by default in attach mode to select the pid.
44+
if (!("pid" in debugConfiguration)) {
45+
debugConfiguration.pid = "${command:pickProcess}";
46+
}
47+
// The process picker cannot be used in "waitFor" mode.
48+
// Remove the property even if the user explicitly requested it.
49+
if (debugConfiguration.waitFor === true) {
50+
delete debugConfiguration.pid;
51+
}
5052
}
5153
return debugConfiguration;
5254
}

0 commit comments

Comments
 (0)