Skip to content

Launch Debug Instance

This is a launch.json for VS Code on Windows to launch a debug instance of Chatterino with appropriate logging, source-maps, and debug info for Qt.

Qt is expected to be installed at G:\QT in version 6.8.0. The builds are expected to be the official ones. Cache files for debug info are placed in D:\VSSymbolCache. A cloned qtbase (from the appropriate branch) is expected at G:\Dev\qt-source.

qt6.natvis can be obtained by running the following command in PowerShell inside the cloned repo:

(iwr "https://github.com/qt-labs/vstools/raw/dev/QtVsTools.Package/qt6.natvis.xml").Content.Replace('##NAMESPACE##::', '') | Out-File qt6.natvis

For VS Code, you'll need to merge the JSON NatVis manually (some day, I'll automate that).

chatterino/launch-debug.json
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch CMake Target",
      "type": "cppvsdbg",
      "request": "launch",
      "program": "${command:cmake.launchTargetPath}",
      "args": [],
      "stopAtEntry": false,
      "cwd": "${command:cmake.getLaunchTargetDirectory}",
      "visualizerFile": "${workspaceFolder}/qt6.natvis",
      "environment": [
        {
          "name": "QT_LOGGING_RULES",
          "value": "chatterino.*.debug=true;qt.widgets.gestures.debug=false;qt.qpa.fonts.debug=false;qt.qpa.window.debug=false;qt.qpa.uiautomation.debug=false;qt.text.*.debug=false;qt.pointer.velocity.debug=false;chatterino.http.debug=false;chatterino.hotkeys.debug=false"
        },
        {
          "name": "QT_SCALE_FACTOR",
          "value": "1"
        }
      ],
      "symbolOptions": {
        "searchPaths": [
          "G:\\QT\\6.8.0\\msvc2022_64\\bin",
          "G:\\QT\\6.8.0\\msvc2022_64\\plugins\\platforms"
        ],
        "searchMicrosoftSymbolServer": false,
        "cachePath": "D:\\VSSymbolCache"
      },
      "sourceFileMap": {
        "C:\\Users\\qt\\work\\qt\\qtbase": "G:\\Dev\\qt-source"
      }
    }
  ]
}

Source