Skip to content

How to debug

Crend King edited this page Apr 25, 2022 · 1 revision

This wiki explains a step-by-step procedure to gather information for problematic commit by debugging. Reader is required of zero prior knowledge about code writing and zero prior tools installed.

Prepare AviSynth Filter

There will be two parts from AVSF needed to debug: source code and binary files, both can be obtains from the repository.

  1. Go to the GitHub action run page of the problematic commit. The binary files can be downloaded from the "Artifacts" section. You must use the the ones with "Debug" in the name.

  2. To obtain the source code of that particular commit, look carefully above the graph. There is a table with the first column named "Triggered via push X ago". Below is the committer's name followed by the commit hash. Click the hash, then "Browse files".

  3. You should now see the homepage of AVSF. Click the green "Code" button, then "Download ZIP". Extract.

  4. Extract the binary files, rename the folder to "debug", then move it to the root of the extracted source file folder. For example, you should see "baseclasses", "filter_common" and the new "debug" folders all in the same level.

Install Visual Studio Code

Visual Studio Code (VSCode) is the tool we recommend to use for debugging in this wiki. It offers a good out-of-the-box user experience.

  1. VSCode can be downloaded at https://code.visualstudio.com/. Follow the installer to install.

  2. Once finished and VSCode is launched, go to main menu View -> Extensions. Search "C++", and install the "C/C++" (from Microsoft) extension.

  3. Go to main menu File -> Open Folder..., browse to the extracted source code folder. In the "trust" popup, click Yes. Now the sidebar should show all source files from AVSF.

Now you are ready to debug.

Gather information

Go to main menu Run -> Start Debugging. VSCode will attempt to register the filter. If failed, the two most important sections to look at are CALL STACK at the bottom of the sidebar, and DEBUG CONSOLE at bottom of the editor.

For CALL STACK, expand Main Thread, right click on any item, click "Copy Call Stack". Paste the content to the issue ticket.

For DEBUG CONSOLE, right click then "Copy All". Paste the content to the issue ticket.