diff options
| author | Felix Morgner <felix.morgner@ost.ch> | 2026-05-01 20:46:21 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@ost.ch> | 2026-05-01 20:46:21 +0200 |
| commit | 61949538ad6d114c1c2a788928a0b9706b4efc76 (patch) | |
| tree | a1cf47e160d040ea4b199b6ca089e4580a810a7f /scripts/gdb/kstd/__init__.py | |
| parent | b1405c44434fbfa535348d310aa3243203aefb06 (diff) | |
| download | kernel-61949538ad6d114c1c2a788928a0b9706b4efc76.tar.xz kernel-61949538ad6d114c1c2a788928a0b9706b4efc76.zip | |
debug: add support for kstd pretty printing
Diffstat (limited to 'scripts/gdb/kstd/__init__.py')
| -rw-r--r-- | scripts/gdb/kstd/__init__.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/gdb/kstd/__init__.py b/scripts/gdb/kstd/__init__.py new file mode 100644 index 0000000..7dc1596 --- /dev/null +++ b/scripts/gdb/kstd/__init__.py @@ -0,0 +1,17 @@ +import gdb.printing + +from .vector import KstdVectorPrinter +from .string import KstdStringPrinter +from .std_types import StdBytePrinter + + +def build_pretty_printers(): + pp = gdb.printing.RegexpCollectionPrettyPrinter("kstd") + pp.add_printer("vector", "^kstd::vector<.*>$", KstdVectorPrinter) + pp.add_printer("string", "^kstd::string$", KstdStringPrinter) + pp.add_printer("std_byte", "^std::byte$", StdBytePrinter) + return pp + + +def register_printers(objfile): + gdb.printing.register_pretty_printer(objfile, build_pretty_printers(), replace=True) |
