diff --git a/tools/gdb_pretty_printer/nlohmann-json.py b/tools/gdb_pretty_printer/nlohmann-json.py index 774756de79..dcad41373c 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(::nlohmann_json(?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)