Skip to content

Commit 6d01d9a

Browse files
show an error message if no program is provided for waitFor
1 parent 55e0c95 commit 6d01d9a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,23 @@ export class LLDBDapConfigurationProvider
4848
// Remove the property even if the user explicitly requested it.
4949
if (debugConfiguration.waitFor === true) {
5050
delete debugConfiguration.pid;
51+
if (!("program" in debugConfiguration)) {
52+
return vscode.window
53+
.showErrorMessage(
54+
"Failed to attach to process: 'waitFor' requires that a 'program' be provided . Please update your launch configuration.",
55+
{ modal: true },
56+
"Configure",
57+
)
58+
.then((userChoice) => {
59+
switch (userChoice) {
60+
case "Configure":
61+
// returning null from resolveDebugConfiguration() causes VS Code to open the launch configuration
62+
return null;
63+
default:
64+
return undefined;
65+
}
66+
});
67+
}
5168
}
5269
}
5370
return debugConfiguration;

0 commit comments

Comments
 (0)