aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/kstd/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gdb/kstd/__init__.py')
-rw-r--r--scripts/gdb/kstd/__init__.py17
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)