feat: Support program parameter in attach configurations (#14046) by Subham-KRLX · Pull Request #14108 · microsoft/vscode-cpptools

and others added 3 commits

August 2, 2025 07:37

@Subham-KRLX

Move the findProcessByProgramName private method from ConfigurationSnippetProvider
class to DebugConfigurationProvider class where it belongs and is called.

This fixes:
- TS2339: Property 'findProcessByProgramName' does not exist on type 'DebugConfigurationProvider'
- TS6133: 'findProcessByProgramName' is declared but its value is never read

@Subham-KRLX

@Subham-KRLX

sean-mcmanus

@Subham-KRLX

@Subham-KRLX

sean-mcmanus

@Subham-KRLX

- Move remote attach check to beginning (silent fallback)
- Validate program path before processing
- Make case-sensitive matching OS-specific (Windows only)
- Remove startsWith matching (exact match only)
- Optimize targetName outside lambda with .exe suffix on Windows
- Remove all logging statements
- Fall back to process picker instead of showing errors
- Fix grammar in comments (add 'the' articles)
- Update descriptions in package.nls.json for clarity

sean-mcmanus

sean-mcmanus

@Subham-KRLX

@Subham-KRLX

Per Sean's feedback, check for remote attach scenarios before calling
findProcessByProgramName to avoid unnecessary function calls and
potential errors for remote attach users.

sean-mcmanus

@Subham-KRLX

MIEngine requires the program field for gdb/lldb debugging even in attach mode.
Without it, debugging fails after the debugger starts. The program field serves
dual purpose: finding the process by name (new feature) and providing symbol
information to the debugger (existing MIEngine requirement).

Updated documentation to clarify that program is required and explain why.

sean-mcmanus

@sean-mcmanus