Skip to content

Commit 1f55079

Browse files
albymassariMongoDB Bot
authored and
MongoDB Bot
committed
SERVER-101998 Add gdb pretty printers for new ABT nodes (#34923)
GitOrigin-RevId: ebd00d20414f5973511f7c42a5462c3fd3e8e537
1 parent 090fac1 commit 1f55079

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

buildscripts/gdb/optimizer_printers.py

+30
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,17 @@ def to_string(self):
235235
return "BinaryOp[{}]".format(strip_namespace(self.val["_op"]))
236236

237237

238+
class NaryOpPrinter(DynamicArityNodePrinter):
239+
"""Pretty-printer for NaryOp."""
240+
241+
def __init__(self, val):
242+
"""Initialize NaryOpPrinter."""
243+
super().__init__(val, 0, "NaryOp")
244+
245+
def to_string(self):
246+
return "NaryOp[{}]".format(strip_namespace(self.val["_op"]))
247+
248+
238249
class BlackholePrinter(FixedArityNodePrinter):
239250
"""Pretty-printer for Blackhole."""
240251

@@ -259,6 +270,14 @@ def __init__(self, val):
259270
super().__init__(val, 2, "Let")
260271

261272

273+
class MultiLetPrinter(DynamicArityNodePrinter):
274+
"""Pretty-printer for MultiLet."""
275+
276+
def __init__(self, val):
277+
"""Initialize MultiLetPrinter."""
278+
super().__init__(val, 0, "MultiLet")
279+
280+
262281
class LambdaAbstractionPrinter(FixedArityNodePrinter):
263282
"""Pretty-printer for LambdaAbstraction."""
264283

@@ -286,6 +305,14 @@ def __init__(self, val):
286305
super().__init__(val, 0, "Source")
287306

288307

308+
class SwitchPrinter(DynamicArityNodePrinter):
309+
"""Pretty-printer for Switch."""
310+
311+
def __init__(self, val):
312+
"""Initialize SwitchPrinter."""
313+
super().__init__(val, 0, "Switch")
314+
315+
289316
class ReferencesPrinter(DynamicArityNodePrinter):
290317
"""Pretty-printer for References."""
291318

@@ -376,12 +403,15 @@ def register_optimizer_printers(pp):
376403
"Variable",
377404
"UnaryOp",
378405
"BinaryOp",
406+
"NaryOp",
379407
"If",
380408
"Let",
409+
"MultiLet",
381410
"LambdaAbstraction",
382411
"LambdaApplication",
383412
"FunctionCall",
384413
"Source",
414+
"Switch",
385415
"References",
386416
"ExpressionBinder",
387417
]

0 commit comments

Comments
 (0)