diff --git a/gdb/kakoune.py b/gdb/kakoune.py index 97c0e307e..f47be8fee 100644 --- a/gdb/kakoune.py +++ b/gdb/kakoune.py @@ -73,8 +73,8 @@ class StringView: def to_string(self): return "\"%s\"" % (self.val['m_data'].string("utf-8", "ignore", self.val['m_length']['m_value'])) -class StringStoragePtr: - """ Print a ref_ptr""" +class StringDataPtr: + """ Print a RefPtr""" def __init__(self, val): self.val = val @@ -85,6 +85,16 @@ class StringStoragePtr: content = (ptr + 1).cast(str_type).string("utf-8", "ignore", ptr.dereference()['length']) return "\"%s\" (ref:%d)" % (content.replace("\n", "\\n"), ptr.dereference()['refcount']) +class RefPtr: + """ Print a RefPtr""" + + def __init__(self, val): + self.val = val + + def to_string(self): + ptr = self.val['m_ptr'] + return "\"refptr %s\"" % (ptr) + class Option: """ Print a Option""" @@ -131,7 +141,8 @@ def build_pretty_printer(): pp.add_printer('String', '^Kakoune::String$', String) pp.add_printer('StringView', '^Kakoune::StringView$', StringView) pp.add_printer('SharedString', '^Kakoune::SharedString$', StringView) - pp.add_printer('StringStoragePtr', '^Kakoune::ref_ptr$', StringStoragePtr) + pp.add_printer('StringDataPtr', '^Kakoune::RefPtr$', StringDataPtr) + pp.add_printer('RefPtr', '^Kakoune::RefPtr<.*>$', RefPtr) pp.add_printer('Option', '^Kakoune::Option$', Option) pp.add_printer('LineCount', '^Kakoune::LineCount$', LineCount) pp.add_printer('CharCount', '^Kakoune::CharCount$', CharCount)