diff options
author | Nicholas Zolnierz <nicholas.zolnierz@mongodb.com> | 2022-06-03 18:14:34 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-06-03 19:12:16 +0000 |
commit | 5ff95e345aad15c5bfdb4986b42051233617c555 (patch) | |
tree | 613918faf8a801bc150c0732aa1ca4aca4daf056 /buildscripts | |
parent | ac3fb9e385775830b9f104c4cb0b7aff5554875d (diff) | |
download | mongo-5ff95e345aad15c5bfdb4986b42051233617c555.tar.gz |
SERVER-62043 Gracefully handle missing ABT types in gdb
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/gdb/mongo_printers.py | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/buildscripts/gdb/mongo_printers.py b/buildscripts/gdb/mongo_printers.py index 29844d2a98b..551809314ec 100644 --- a/buildscripts/gdb/mongo_printers.py +++ b/buildscripts/gdb/mongo_printers.py @@ -922,20 +922,23 @@ class MemoPrinter(OptimizerTypePrinter): def register_abt_printers(pp): """Registers a number of pretty printers related to the CQF optimizer.""" - # ABT printer. - abt_type = gdb.lookup_type("mongo::optimizer::ABT").strip_typedefs() - pp.add('ABT', abt_type.name, True, ABTPrinter) - - # IntervalRequirement printer. - pp.add("Interval", "mongo::optimizer::IntervalRequirement", False, IntervalPrinter) - - # PartialSchemaRequirements printer. - schema_req_type = gdb.lookup_type( - "mongo::optimizer::PartialSchemaRequirements").strip_typedefs() - pp.add("PartialSchemaRequirements", schema_req_type.name, False, PartialSchemaReqMapPrinter) - - # Memo printer. - pp.add("Memo", "mongo::optimizer::cascades::Memo", False, MemoPrinter) + try: + # ABT printer. + abt_type = gdb.lookup_type("mongo::optimizer::ABT").strip_typedefs() + pp.add('ABT', abt_type.name, True, ABTPrinter) + + # IntervalRequirement printer. + pp.add("Interval", "mongo::optimizer::IntervalRequirement", False, IntervalPrinter) + + # PartialSchemaRequirements printer. + schema_req_type = gdb.lookup_type( + "mongo::optimizer::PartialSchemaRequirements").strip_typedefs() + pp.add("PartialSchemaRequirements", schema_req_type.name, False, PartialSchemaReqMapPrinter) + + # Memo printer. + pp.add("Memo", "mongo::optimizer::cascades::Memo", False, MemoPrinter) + except gdb.error as gdberr: + print("Failed to add one or more ABT pretty printers, skipping: " + str(gdberr)) def build_pretty_printer(): |