diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-07-10 17:47:02 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-07-10 17:49:21 +0200 |
commit | 53f9b54f73f313814b7f1217a4e37f5dc6bd5a45 (patch) | |
tree | 6ba75f31bbf6d0bd2c64e845a2d204d9abfa6ee7 /solenv/gdb | |
parent | f2c09d47407ec8bdd55f789fdba7ff02e14783e8 (diff) |
gdb: add pretty-printer for tools Point
nA is X, nB is Y, but finally it's now pointless to remember that
Change-Id: I9fb1f6518e33862663a5bd5e28876979f0f1e05f
Diffstat (limited to 'solenv/gdb')
-rw-r--r-- | solenv/gdb/libreoffice/tl.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/solenv/gdb/libreoffice/tl.py b/solenv/gdb/libreoffice/tl.py index 9571573fd221..b8007108dc47 100644 --- a/solenv/gdb/libreoffice/tl.py +++ b/solenv/gdb/libreoffice/tl.py @@ -338,6 +338,22 @@ class TablePrinter(ContainerHelper): def display_hint(self): return 'map' +class PointPrinter(object): + '''Prints a Point.''' + + def __init__(self, typename, value): + self.typename = typename + self.value = value + + def to_string(self): + return "%s" % (self.typename) + + def children(self): + x = self.value['nA'] + y = self.value['nB'] + children = [('x', x), ('y', y)] + return children.__iter__() + printer = None def build_pretty_printers(): @@ -362,6 +378,7 @@ def build_pretty_printers(): printer.add('DateTime', DateTimePrinter) printer.add('Date', DatePrinter) printer.add('Time', TimePrinter) + printer.add('Point', PointPrinter) def register_pretty_printers(obj): printing.register_pretty_printer(printer, obj) |