LSSTApplications  18.0.0+53,19.0.0,19.0.0+1,19.0.0+15,19.0.0+16,19.0.0+18,19.0.0+23,19.0.0+3,19.0.0-1-g20d9b18+9,19.0.0-1-g425ff20,19.0.0-1-g5549ca4,19.0.0-1-g580fafe+9,19.0.0-1-g6fe20d0+2,19.0.0-1-g8c57eb9+9,19.0.0-1-gbfe0924,19.0.0-1-gdc0e4a7+14,19.0.0-1-ge272bc4+9,19.0.0-1-ge3aa853+1,19.0.0-14-gbb28fe44,19.0.0-16-g8258e2a,19.0.0-2-g0d9f9cd+16,19.0.0-2-g260436e,19.0.0-2-g9b11441+3,19.0.0-2-gd955cfd+22,19.0.0-3-g6513920,19.0.0-3-gc4f6e04,19.0.0-4-g41ffa1d+2,19.0.0-4-g725f80e+18,19.0.0-4-g75300c1e,19.0.0-4-ga8eba22,19.0.0-5-g0745e3f,19.0.0-6-g6637c4fb6,19.0.0-6-gb6b8b0a,19.0.0-7-gea0a0fe+5,w.2020.03
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