Debugger Auto Attach by Name
VS Code extension that monitors running Windows processes and auto-attaches the cppvsdbg debugger to processes whose names match the configured list.
Actual Extension Identity
- Package name:
dbg-auto
- Display name:
Debugger Auto Attach by Name
- Command:
dbg-auto.toggle
- Configuration key:
dbg-auto.processNames
Requirements
- Node.js: 20.10.0 or newer
- VS Code: 1.75.0 or newer
- Microsoft C/C++ extension installed:
ms-vscode.cpptools
- Windows host (uses
tasklist and cppvsdbg)
Build and Package
Run commands in this folder:
npm install
npm run compile
To create a .vsix package:
npm install -g @vscode/vsce
vsce package --allow-missing-repository
Install
- Open VS Code.
- Open Extensions view.
- Select
... in the Extensions panel.
- Choose
Install from VSIX... and pick the generated .vsix file.
How to Use
This extension does not add a custom launch.json debugger type.
- Set process names in VS Code settings:
"dbg-auto.processNames": [
"slch.exe",
"ConverterSvr.exe"
]
- Start monitoring with command:
Debug: Toggle Auto-Attach Monitoring
- While monitoring is active, the extension polls process list every 1.5 seconds.
- For each matching process that is not attached yet, it starts a debug attach session using:
- debugger type:
cppvsdbg
- request:
attach
- process id: detected PID
- Use the same command again to stop monitoring.
UI and Logs
- Status bar button reflects monitoring state and toggles start/stop.
- Output channel:
Debug: Auto Attach Log.
Development Notes
After changing src/extension.ts:
- Run
npm run compile.
- Press F5 in the extension workspace to launch Extension Development Host.
- Use
Developer: Reload Window in that host to reload the extension.
| |