godot/misc
Mitten Orvan 829c33aed1
Create a GDB pretty printing file for String, StringName, and Vector
GDB supports custom pretty-printers implemented in Python.
When debugging Godot, checking the values of Strings and StringNames
in the debugger was very inconvenient as the data is fairly deep
in the structure. This makes the values immediately visible.

The custom pretty printer can be taken into use manually by calling
`source misc/scripts/godot_gdb_pretty_print.py` in the GDB console.
In VS code, it can be activated by default by adding the source
command to the `setupCommands` of the configuration in launch.json.

Like this:
```json
// launch.json
{
    "configurations": [
        {
            "name": "C/C++: debug,
            "type": "cppdbg",
	    ...
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Load custom pretty-printers for Godot types.",
                    "text": "source ${workspaceRoot}/misc/scripts/godot_gdb_pretty_print.py"
                }
            ],
            "miDebuggerPath": "gdb"
        }
    ],
    "version": "2.0.0"
}
```

Extended the pretty-printer python script to support Vectors.
The printer needs to be uncomfortably aware of CowData
implementation details, but I don't think there is any
way around that.
2024-05-11 12:33:35 +02:00
..
dist Style: Trim trailing whitespace and ensure newline at EOF 2024-05-08 10:12:46 +02:00
error_suppressions Style: Trim trailing whitespace and ensure newline at EOF 2024-05-08 10:12:46 +02:00
extension_api_validation Style: Trim trailing whitespace and ensure newline at EOF 2024-05-08 10:12:46 +02:00
msvs Ensure all Visual Studio files are generated with CRLF 2024-04-10 17:26:36 +02:00
scripts Create a GDB pretty printing file for String, StringName, and Vector 2024-05-11 12:33:35 +02:00