feat: Support program parameter in attach configurations (#14046)#14108
feat: Support program parameter in attach configurations (#14046)#14108Subham-KRLX wants to merge 13 commits intomicrosoft:mainfrom
Conversation
|
@Subham-KRLX It looks like there are compile errors: src/Debugger/configurationProvider.ts(361,40): error TS2339: Property 'findProcessByProgramName' does not exist on type 'DebugConfigurationProvider'. |
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
|
@sean-mcmanus We've resolved both compilation errors by moving the findProcessByProgramName method to the correct location inside the DebugConfigurationProvider class. The fix has been committed and pushed to the feature/attach-by-program-name branch. The TypeScript compilation errors are now resolved. |
|
@sean-mcmanus I just want to add that I am also really interested in this feature. It seems to have been sitting for over a month waiting for a review, so I'm bumping this in case people forgot. |
sean-mcmanus
left a comment
There was a problem hiding this comment.
Why are there Code Sample changes? Can you remove those? Aren't those changes in a separate PR already?
Why is there an MIEngine_Debug subproject added? Can that be removed?
|
@sean-mcmanus I have cleaned up the PR by reverting the unrelated Code Samples changes and removing the MIEngine_Debug subproject. The PR now only contains the relevant changes for supporting the program parameter in attach configurations. |
@Subham-KRLX I still see the Code Sample changes, not reverted. |
|
@sean-mcmanus I have thoroughly reverted all unrelated Code Samples changes by syncing with upstream/main and removed the MIEngine_Debug subproject. |
|
@Subham-KRLX I've started reviewing this. I think I can finish tomorrow. |
- 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
|
Sorry, I've been busy with other stuff. I'll try to get to this tomorrow. |
sean-mcmanus
left a comment
There was a problem hiding this comment.
Also, there are some linter errors: Trailing spaces not allowed
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
left a comment
There was a problem hiding this comment.
I think the "program" field is required for gdb/lldb attach debugging. Are you able to debug without the "program" field?
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 You are correct - restored |
|
@Subham-KRLX It seems good to me, but I'm not sure if anyone else on our team wanted to review it. I might be able to get into 1.31.0 for next Thursday. |
Fixes #14046
Add support for program parameter in attach configurations to attach to processes by executable name, similar to LLDB extension.
Example:
json
{
"type": "cppvsdbg",
"request": "attach",
"program": "myprogram.exe"
}
Automatically finds matching process, prompts if multiple matches. Backward compatible with existing processId configurations.