For those interested in how one can use Python scriptlets for adding tools and utilities to GDB, I posted
an example about a decade ago.
The
tree approach can be useful, if you have a finite state machine or a menu system defined using data structures, as it shows how one can examine the data structures visually, even piping the description to an external program. The
tree example itself uses GraphViz to draw a graph of any binary tree using pointers, directly from GDB: you only need to name the pointer fields and the possible label field for each node. (
pretty() currently only implements strings, but you can easily add support for any other label field type.)
Such Python scriptlets can be identified by the
import gdb near the beginning of the script. (The
.py files are plain text files you can open in any text editor, like WordPad in Windows.)
I suspect the Python files implement a graphical user interface instead. Looking at the
import lines near the beginning of the scripts would tell;
PyQt,
PySide,
tkinter,
gi (with
from gi.repository import Gtk), and
wx are the most common UI toolkits used I believe. The
tkinter (Tcl/Tk) one is standard in Python, too, and the rest only need some support libraries.