Index: utils/gdb/libcxx/printers.py =================================================================== --- utils/gdb/libcxx/printers.py +++ utils/gdb/libcxx/printers.py @@ -946,12 +946,20 @@ def __call__(self, val): """Return the pretty printer for a val, if the type is supported.""" + # Get a non-qualfied, non-reference version of the type, with typedefs + # stripped. + val_type = val.type + while val_type.code in [gdb.TYPE_CODE_REF, gdb.TYPE_CODE_RVALUE_REF]: + val_type = val_type.target() + val_type = val_type.unqualified() + val_type = val_type.strip_typedefs() + # Do not handle any type that is not a struct/class. - if val.type.strip_typedefs().code != gdb.TYPE_CODE_STRUCT: + if val_type.code != gdb.TYPE_CODE_STRUCT: return None # Don't attempt types known to be inside libstdcxx. - typename = val.type.name or val.type.tag or str(val.type) + typename = val_type.name or val_type.tag or str(val_type) match = re.match("^std::(__.*?)::", typename) if match is None or match.group(1) in ["__cxx1998", "__debug", @@ -960,7 +968,7 @@ return None # Handle any using declarations or other typedefs. - typename = _prettify_typename(val.type) + typename = _prettify_typename(val_type) if not typename: return None without_generics = _remove_generics(typename)