Style: Relocate godot_gdb_pretty_print.py

This commit is contained in:
Thaddeus Crews 2024-06-23 09:37:06 -05:00
parent 04bf7d4cad
commit 47babe860e
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84

View file

@ -1,28 +1,30 @@
#!/usr/bin/env python3 """
# Load this file to your GDB session to enable pretty-printing Load this file to your GDB session to enable pretty-printing of some Godot C++ types.
# of some Godot C++ types.
# GDB command: source misc/scripts/godot_gdb_pretty_print.py GDB command: `source misc/utility/godot_gdb_pretty_print.py`.
#
# To load these automatically in Visual Studio Code, To load these automatically in Visual Studio Code, add the source command to
# add the source command to the setupCommands of your configuration the `setupCommands` of your configuration in `launch.json`:
# in launch.json. ```json
# "setupCommands": [ "setupCommands": [
# ... ...
# { {
# "description": "Load custom pretty-printers for Godot types.", "description": "Load custom pretty-printers for Godot types.",
# "text": "source ${workspaceRoot}/misc/scripts/godot_gdb_pretty_print.py" "text": "source ${workspaceFolder}/misc/utility/godot_gdb_pretty_print.py"
# } }
# ] ]
# Other UI:s that use GDB under the hood are likely to have their own ways to achieve this. ```
# Other UIs that use GDB under the hood are likely to have their own ways to achieve this.
# To debug this script it's easiest to use the interactive python from a command-line
# GDB session. Stop at a breakpoint, then use To debug this script it's easiest to use the interactive python from a command-line
# python-interactive to enter the python shell and GDB session. Stop at a breakpoint, then use python-interactive to enter the python shell
# acquire a Value object using gdb.selected_frame().read_var("variable name"). and acquire a `Value` object using `gdb.selected_frame().read_var("variable name")`.
# From there you can figure out how to print it nicely. From there you can figure out how to print it nicely.
"""
import re import re
import gdb import gdb # type: ignore
# Printer for Godot StringName variables. # Printer for Godot StringName variables.