-
-
Notifications
You must be signed in to change notification settings - Fork 72
Debugging the mods
Michael Maltsev edited this page Aug 27, 2024
·
35 revisions
- Install the CodeLLDB extension using the instructions below.
- Add
--optimize=0 --debug
to the mod's@compilerOptions
metadata entry. - Add a debugging configuration for launching a process in debug mode, or for attaching to a running process.
- Start debugging.
To be able to debug mods in Windhawk, first install the CodeLLDB debugging extension for Windhawk:
- Enter editing mode.
- Press Ctrl+P, type "ext install vadimcn.vscode-lldb" and press Enter.
- Restore the Windhawk sidebar by pressing the button on the bottom right or with Ctrl+B.
01-debugging-extension-installation.mp4
To be able to debug a mod properly, it has to be compiled for debugging. Add --optimize=0 --debug
to the mod's @compilerOptions
metadata entry.
02-compile-for-debugging.mp4
- Press Ctrl+Shift+D to switch to the Run and Debug view.
- Click on "create a launch.json file". If another configuration already exists, click on "Add configuration..." and choose "Attach to PID".
- Set "request" to "attach".
- Remove "args" and "cwd".
- Set the program path for "program", or, to pick from a list, replace "program" with
"pid": "${command:pickMyProcess}"
. - Make sure the right configuration is selected, and click on the green arrow to start debugging.
03-debug-attach.mp4
- Press Ctrl+Shift+D to switch to the Run and Debug view.
- Click on "create a launch.json file". If another configuration already exists, click on "Add configuration..." and choose "Launch".
- Set the program path for "program". Repeat each backslash twice.
- Make sure the right configuration is selected, and click on the green arrow to start debugging.