diff --git a/tools/gdb_pretty_printer/nlohmann-json.py b/tools/gdb_pretty_printer/nlohmann-json.py index 774756de79..0099f9c0ae 100644 --- a/tools/gdb_pretty_printer/nlohmann-json.py +++ b/tools/gdb_pretty_printer/nlohmann-json.py @@ -1,7 +1,7 @@ import gdb import re -ns_pattern = re.compile(r'nlohmann::json_v(?P\d+)_(?P\d+)_(?P\d+)(?P\w*)::(?P.+)') +ns_pattern = re.compile(r'nlohmann(::json_abi(?P\w*)(_v(?P\d+)_(?P\d+)_(?P\d+))?)?::(?P.+)') class JsonValuePrinter: "Print a json-value" @@ -26,7 +26,7 @@ def json_lookup_function(val): return gdb.default_visualizer(union_val.dereference()) else: return JsonValuePrinter(union_val) - except: + except Exception: return JsonValuePrinter(val['m_type']) gdb.pretty_printers.append(json_lookup_function)