From 61949538ad6d114c1c2a788928a0b9706b4efc76 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 1 May 2026 20:46:21 +0200 Subject: debug: add support for kstd pretty printing --- scripts/gdb/kstd/__init__.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/gdb/kstd/__init__.py (limited to 'scripts/gdb/kstd/__init__.py') 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) -- cgit v1.2.3