From be478020584829ac759372f63c482e35b3e11823 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 14 Jun 2012 12:58:24 +0000 Subject: [PATCH] update kakoune gdb printers --- gdb/kakoune.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gdb/kakoune.py b/gdb/kakoune.py index fb2848644..7891bd8e7 100644 --- a/gdb/kakoune.py +++ b/gdb/kakoune.py @@ -55,6 +55,24 @@ class BufferIterator: else: return "buffer@(%d, %d)" % (self.val['m_coord']['line'], self.val['m_coord']['column']) +class String: + """ Print a String""" + + def __init__(self, val): + self.val = val + + def to_string(self): + return self.val["m_content"] + +class Option: + """ Print a Option""" + + def __init__(self, val): + self.val = val + + def to_string(self): + return self.val["m_value"] + def build_pretty_printer(): pp = gdb.printing.RegexpCollectionPrettyPrinter("kakoune") pp.add_printer('memoryview', '^Kakoune::memoryview<.*>$', MemoryView) @@ -62,5 +80,7 @@ def build_pretty_printer(): pp.add_printer('BufferCoord', '^Kakoune::BufferCoord$', LineAndColumn) pp.add_printer('DisplayCoord', '^Kakoune::DisplayCoord$', LineAndColumn) pp.add_printer('BufferIterator', '^Kakoune::BufferIterator$', BufferIterator) + pp.add_printer('String', '^Kakoune::String$', String) + pp.add_printer('Option', '^Kakoune::Option$', Option) return pp