LSSTApplications  17.0+103,17.0+11,17.0+61,18.0.0+13,18.0.0+25,18.0.0+5,18.0.0+52,18.0.0-4-g68ffd23,18.1.0-1-g0001055+8,18.1.0-1-g03d53ef+1,18.1.0-1-g1349e88+28,18.1.0-1-g2505f39+22,18.1.0-1-g380d4d4+27,18.1.0-1-g5315e5e+1,18.1.0-1-g5e4b7ea+10,18.1.0-1-g7e8fceb+1,18.1.0-1-g85f8cd4+23,18.1.0-1-g9a6769a+13,18.1.0-1-ga1a4c1a+22,18.1.0-1-gd55f500+17,18.1.0-12-g42eabe8e+10,18.1.0-14-gd04256d+15,18.1.0-16-g430f6a53+1,18.1.0-17-gd2166b6e4,18.1.0-18-gb5d19ff+1,18.1.0-2-gfbf3545+7,18.1.0-2-gfefb8b5+16,18.1.0-3-g52aa583+13,18.1.0-3-g62b5e86+14,18.1.0-3-g8f4a2b1+17,18.1.0-3-g9bc06b8+7,18.1.0-3-gb69f684+9,18.1.0-4-g1ee41a7+1,18.1.0-5-g6dbcb01+13,18.1.0-5-gc286bb7+3,18.1.0-6-g48bdcd3+2,18.1.0-6-gd05e160+9,18.1.0-7-gc4d902b+2,18.1.0-7-gebc0338+8,18.1.0-9-gae7190a+10,w.2019.38
LSSTDataManagementBasePackage
printers.py
Go to the documentation of this file.
1 
2 import gdb
3 import sys
4 
5 try:
6  import gdb.printing
7 
8  # example from meas_alg
10  "Print a CRPixel"
11 
12  def __init__(self, val):
13  self.val = val
14 
15  def to_string(self):
16  return "{id=%d (%d, %d)}" % (self.val["id"], self.val["col"], self.val["row"])
17 
18  printers = []
19 
20  def register(obj):
21  "Register my pretty-printers with objfile Obj."
22 
23  if obj is None:
24  obj = gdb
25 
26  for p in printers:
27  gdb.printing.register_pretty_printer(obj, p)
28 
30  printer = gdb.printing.RegexpCollectionPrettyPrinter("ip_diffim")
31 
32  # example from meas_alg
33  # printer.add_printer('lsst::meas::algorithms::CRPixel',
34  # '^lsst::meas::algorithms::CRPixel', CRPixelPrinter)
35 
36  return printer
37 
38  printers.append(build_ip_diffim_dictionary())
39 
40 except ImportError:
41  def register(*args, **kwargs):
42  print("Your version of gdb is too old to load the ip.diffim python pretty printers", file=sys.stderr)
43  pass
44 
45  pass