Make sourcing gdb/kakoune.py automatically add the pretty printers

If pretty printers are not enabled, we can now just `source
gdb/kakoune.py` from gdb.
This commit is contained in:
Maxime Coste 2024-07-19 13:07:31 +10:00
parent c971c42002
commit 011283e4d2

View file

@ -1,6 +1,5 @@
import gdb.printing
class ArrayIterator:
def __init__(self, data, count):
self.data = data
@ -226,3 +225,7 @@ def build_pretty_printer():
pp.add_printer('Color', '^Kakoune::Color$', Color)
pp.add_printer('Regex', '^Kakoune::Regex$', Regex)
return pp
if __name__ == "__main__":
print("Adding kakoune pretty printers")
gdb.printing.register_pretty_printer(gdb.current_objfile(), build_pretty_printer())