diff options
author | Nicholas Zolnierz <nicholas.zolnierz@mongodb.com> | 2022-07-08 13:12:33 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-08 13:46:16 +0000 |
commit | c0d6689428304e6c954eb44f7723049c14aafae8 (patch) | |
tree | 1b98d8e42fdda94eb0408f66374432178c0ddcf0 /buildscripts | |
parent | 25d5ef6d0a45db78ac685f01967add8721f827c8 (diff) | |
download | mongo-c0d6689428304e6c954eb44f7723049c14aafae8.tar.gz |
SERVER-66567 Add GDB pretty printer for ABT::Reference type
Diffstat (limited to 'buildscripts')
-rw-r--r-- | buildscripts/gdb/mongo_printers.py | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/buildscripts/gdb/mongo_printers.py b/buildscripts/gdb/mongo_printers.py index 551809314ec..4c394fbc32f 100644 --- a/buildscripts/gdb/mongo_printers.py +++ b/buildscripts/gdb/mongo_printers.py @@ -639,15 +639,15 @@ class MongoPrettyPrinterCollection(gdb.printing.PrettyPrinter): index = find_match_brackets(lookup_tag) - # Ignore subtypes of classes - # We do not want HashTable<T>::iterator as an example, just HashTable<T> - if index == -1 or index + 1 == len(lookup_tag): - for printer in self.subprinters: - if not printer.enabled: - continue - if ((not printer.is_template or lookup_tag.find(printer.prefix) != 0) - and (printer.is_template or lookup_tag != printer.prefix)): - continue + for printer in self.subprinters: + if not printer.enabled: + continue + # Ignore subtypes of templated classes. + # We do not want HashTable<T>::iterator as an example, just HashTable<T> + if printer.is_template: + if (index + 1 == len(lookup_tag) and lookup_tag.find(printer.prefix) == 0): + return printer.printer(val) + elif lookup_tag == printer.prefix: return printer.printer(val) return None @@ -925,7 +925,11 @@ def register_abt_printers(pp): try: # ABT printer. abt_type = gdb.lookup_type("mongo::optimizer::ABT").strip_typedefs() - pp.add('ABT', abt_type.name, True, ABTPrinter) + pp.add('ABT', abt_type.name, False, ABTPrinter) + + abt_ref_type = gdb.lookup_type(abt_type.name + "::Reference").strip_typedefs() + # We can re-use the same printer since an ABT is contructable from an ABT::Reference. + pp.add('ABT::Reference', abt_ref_type.name, False, ABTPrinter) # IntervalRequirement printer. pp.add("Interval", "mongo::optimizer::IntervalRequirement", False, IntervalPrinter) |