Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 4, 2025

This PR implements support for attaching TTD (Time Travel Debugging) recording to running processes, addressing a key limitation mentioned in the documentation.

Changes Made

UI Enhancements

  • Added radio button selection between "Launch new process" and "Attach to running process" modes
  • Organized settings into grouped sections that enable/disable based on selected mode
  • Integrated process selection using the existing AttachProcessDialog for consistent UX
  • Added validation to ensure proper configuration before starting recording

Command Generation

The TTD command line generation now supports both modes:

  • Launch mode: TTD.exe -accepteula -out "dir" [-tracingOff -recordMode Manual] -launch "exe" args
  • Attach mode: TTD.exe -accepteula -out "dir" -attach PID

Process Selection

  • Reuses the existing attach process dialog for familiar interface
  • Displays selected process as "PID: XXXX" in a read-only field
  • Validates that a process is selected before allowing recording to start

Validation & Error Handling

  • Pre-validates all inputs before executing TTD.exe
  • Mode-specific validation (executable path for launch, process selection for attach)
  • Clear error messages for invalid configurations
  • Proper handling of edge cases like paths with spaces

Documentation Updates

  • Updated docs/guide/dbgeng-ttd.md to reflect new attach capability
  • Removed the limitation statement about not supporting attach to running processes
  • Added comprehensive documentation for both recording modes

UI Layout

The new dialog presents a clean interface with mode selection at the top, followed by grouped settings that are contextually enabled:

┌─────────────────── TTD Record ───────────────────┐
│ ◉ Launch new process                             │
│ ○ Attach to running process                      │
│                                                  │
│ ┌─── Launch Settings ─────────────────────────┐  │
│ │ [Executable path, working dir, arguments]   │  │
│ └─────────────────────────────────────────────┘  │
│                                                  │
│ ┌─── Attach Settings ─────────────────────────┐  │
│ │ [Process selection interface]               │  │
│ └─────────────────────────────────────────────┘  │
└──────────────────────────────────────────────────┘

This implementation maintains full backward compatibility while significantly expanding TTD recording capabilities for users who need to trace already running processes.

Fixes #600.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Copilot Copilot AI changed the title [WIP] TTD tracing should support attaching to a running process and start tracing Add TTD attach to running process support in record dialog Sep 4, 2025
@Copilot Copilot AI requested a review from xusheng6 September 4, 2025 02:54
Copilot finished work on behalf of xusheng6 September 4, 2025 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TTD tracing should support attaching to a running process and start tracing
3 participants