Files
WSL/tools/test
Ben Hillis 8496b4051c Add /attachdebugger option to automatically launch WinDbgX for test debugging (#40116)
* Add /attachdebugger option to automatically launch WinDbgX for test debugging

When /attachdebugger is passed to test.bat, run-tests.ps1 now:
- Starts te.exe with /waitfordebugger in the background
- Polls for the TE.ProcessHost.exe child process via WMI
- Launches WinDbgX attached directly to the test host PID
- With /inproc, attaches to TE.exe itself instead

This replaces the manual workflow of running /waitfordebugger, reading
the PID from the output, and launching WinDbgX separately.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* run-tests: use /inproc with /attachdebugger, simplify exit

Per review feedback from @OneBlue:
- Add /inproc when /attachdebugger is set so WinDbgX attaches
  directly to TE.exe instead of polling for TE.ProcessHost.exe
- Simplify exit to pass through TE.exe exit code directly

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* docs: update /attachdebugger to reflect /inproc behavior

The script now always adds /inproc, so update the README to match:
WinDbgX attaches directly to TE.exe, no ProcessHost polling.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-07 18:45:37 -07:00
..
2025-07-23 15:19:00 -07:00