Skip to content

Instantly share code, notes, and snippets.

@iolalla
Last active June 17, 2020 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iolalla/445344cf7b0c374b9efb2785f816eac6 to your computer and use it in GitHub Desktop.
Save iolalla/445344cf7b0c374b9efb2785f816eac6 to your computer and use it in GitHub Desktop.

The objective of this doc is to share how to debug the game 0ad with VSCode

1st you have to compile it with debug objects, to do so you need to:

cd 0ad/build/workspaces ./update-workspaces.sh -j3
cd gcc
make config=debug

Then you can execute the debug version

binaries/system/pyrogenesis_dbg

and then you can configure your VSCode adding this, to your launch.json:

    {
        "name": "debug 0ad",
        "type": "cppdbg",
        "request": "launch",
        "program": "/opt/src/0ad/binaries/system/pyrogenesis_dbg",
        "args": [],
        "stopAtEntry": false,
        "cwd": "/opt/src/0ad/binaries/system/",
        "environment": [],
        "externalConsole": false,
        "MIMode": "gdb",
        "setupCommands": [
            {
                "description": "Add pretty impression to gdb",
                "text": "-enable-pretty-printing",
                "ignoreFailures": true
            }
        ],
        "miDebuggerPath": "/usr/bin/gdb"
    }

And there you go, now you can debug what's up with 0ad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment