LSSTApplications  17.0+10,17.0+51,17.0+88,18.0.0+10,18.0.0+15,18.0.0+34,18.0.0+4,18.0.0+6,18.0.0-2-ge43143a+6,18.1.0-1-g0001055+2,18.1.0-1-g0896a44+10,18.1.0-1-g1349e88+9,18.1.0-1-g2505f39+7,18.1.0-1-g380d4d4+9,18.1.0-1-g5e4b7ea+2,18.1.0-1-g7e8fceb,18.1.0-1-g85f8cd4+7,18.1.0-1-g9a6769a+3,18.1.0-1-ga1a4c1a+6,18.1.0-1-gc037db8+2,18.1.0-1-gd55f500+3,18.1.0-1-ge10677a+7,18.1.0-10-g73b8679e+12,18.1.0-12-gf30922b,18.1.0-13-g451e75588,18.1.0-13-gbfe7f7f,18.1.0-2-g31c43f9+7,18.1.0-2-g9c63283+9,18.1.0-2-gdf0b915+9,18.1.0-2-gf03bb23+2,18.1.0-3-g52aa583+3,18.1.0-3-g8f4a2b1+1,18.1.0-3-g9cb968e+8,18.1.0-4-g7bbbad0,18.1.0-5-g510c42a+8,18.1.0-5-ga46117f,18.1.0-5-gaeab27e+9,18.1.0-6-gdda7f3e+11,18.1.0-8-g4084bf03+1,w.2019.34
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