From 4dc97cf44d909154e57b894e937e501b22bb0deb Mon Sep 17 00:00:00 2001 From: Gleb Khmyznikov Date: Mon, 23 Jun 2025 13:59:53 +0200 Subject: [PATCH] Add debug info --- doc/devdocs/development/debugging.md | 23 ++++++++++++++++++++++- doc/devdocs/modules/quickaccent.md | 19 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/doc/devdocs/development/debugging.md b/doc/devdocs/development/debugging.md index d9694cfd3c..e32e488982 100644 --- a/doc/devdocs/development/debugging.md +++ b/doc/devdocs/development/debugging.md @@ -2,6 +2,27 @@ This document covers techniques and tools for debugging PowerToys. +## Pre-Debugging Setup + +Before you can start debugging PowerToys, you need to set up your development environment: + +1. Fork the repository and clone it to your machine +2. Navigate to the repository root directory +3. Run `git submodule update --init --recursive` to initialize all submodules +4. Change directory to `.config` and run `winget configure .\configuration.vsEnterprise.winget` (pick the configuration file that matches your Visual Studio distribution) + +### Optional: Building Outside Visual Studio + +You can build the entire solution from the command line, which is sometimes faster than building within Visual Studio: + +1. Open Developer Command Prompt for VS 2022 +2. Navigate to the repository root directory +3. Run the following command(don't forget to set the correct platform): + ``` + msbuild -restore -p:RestorePackagesConfig=true -p:Platform=ARM64 -m PowerToys.sln + ``` +4. This process should complete in approximately 13-14 minutes for a full build + ## Debugging Techniques ### Visual Studio Debugging @@ -21,7 +42,7 @@ The Shell Process Debugging Tool is a Visual Studio extension that helps debug m #### Debugging Setup Process -1. Install "Debug Child Processes" Visual Studio extension +1. Install ["Debug Child Processes"](https://marketplace.visualstudio.com/items?itemName=vsdbgplat.MicrosoftChildProcessDebuggingPowerTool2022) Visual Studio extension 2. Configure which processes to debug and what debugger to use for each 3. Start PowerToys from Visual Studio 4. The extension will automatically attach to specified child processes when launched diff --git a/doc/devdocs/modules/quickaccent.md b/doc/devdocs/modules/quickaccent.md index 9b6602d3ce..e5d35abef4 100644 --- a/doc/devdocs/modules/quickaccent.md +++ b/doc/devdocs/modules/quickaccent.md @@ -83,3 +83,22 @@ The module includes multiple language-specific character sets and special charac - Potential refinements to the activation timing mechanism - Additional language and special character sets - Improved UI positioning in different application contexts + +## Debugging + +To debug the Quick Accent module, follow these steps: + +0. Get familiar with the overall [Debugging Process](../development/debugging.md) for PowerToys. +1. **Build** the entire PowerToys solution in Visual Studio +2. Navigate to the **PowerAccent** folder in Solution Explorer +3. Open the file you want to debug and set **breakpoints** at the relevant locations +4. Find the **runner** project in the root of the solution +5. Right-click on the **runner** project and select "*Set as Startup Project*" +6. Start debugging by pressing `F5` or clicking the "*Start*" button +7. When the PowerToys Runner launches, **enable** the Quick Accent module in the UI +8. Use the Visual Studio Debug menu or press `Ctrl+Alt+P` to open "*Reattach to Process*" +9. Find and select "**PowerToys.PowerAccent.exe**" in the process list +10. Trigger the action in Quick Accent that should hit your breakpoint +11. Verify that the debugger breaks at your breakpoint and you can inspect variables and step through code + +This process allows you to debug the Quick Accent module while it's running as part of the full PowerToys application.