Unverified Commit abd829e6 authored by Niels Lohmann's avatar Niels Lohmann Committed by GitHub

Merge pull request #2950 from senyai/patch-2

🚨 fix gdb_pretty_printer failure on basic types
parents 5cf5ccd1 355fa6c3
import gdb import gdb
import re
class JsonValuePrinter: class JsonValuePrinter:
"Print a json-value" "Print a json-value"
...@@ -13,7 +12,8 @@ class JsonValuePrinter: ...@@ -13,7 +12,8 @@ class JsonValuePrinter:
return self.val return self.val
def json_lookup_function(val): def json_lookup_function(val):
if re.search("^nlohmann::basic_json<.*>$", val.type.strip_typedefs().name): name = val.type.strip_typedefs().name
if name and name.startswith("nlohmann::basic_json<") and name.endswith(">"):
t = str(val['m_type']) t = str(val['m_type'])
if t.startswith("nlohmann::detail::value_t::"): if t.startswith("nlohmann::detail::value_t::"):
try: try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment