diff options
Diffstat (limited to 'libs/kstd/gdb/__init__.py')
| -rw-r--r-- | libs/kstd/gdb/__init__.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/kstd/gdb/__init__.py b/libs/kstd/gdb/__init__.py new file mode 100644 index 0000000..fc5e8fb --- /dev/null +++ b/libs/kstd/gdb/__init__.py @@ -0,0 +1,20 @@ +import gdb.printing + +from .vector import KstdVectorPrinter +from .string import KstdStringPrinter +from .std_types import StdBytePrinter +from .smart_pointers import KstdUniquePtrPrinter, KstdSharedPtrPrinter + + +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) + pp.add_printer("unique_ptr", "^kstd::unique_ptr<.*>$", KstdUniquePtrPrinter) + pp.add_printer("shared_ptr", "^kstd::shared_ptr<.*>$", KstdSharedPtrPrinter) + return pp + + +def register_printers(objfile): + gdb.printing.register_pretty_printer(objfile, build_pretty_printers(), replace=True) |
