Skip to content

Commit

Permalink
Merge pull request #2950 from senyai/patch-2
Browse files Browse the repository at this point in the history
🚨 fix gdb_pretty_printer failure on basic types
  • Loading branch information
nlohmann authored Aug 18, 2021
2 parents 5cf5ccd + 355fa6c commit abd829e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions third_party/gdb_pretty_printer/nlohmann-json.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import gdb
import re

class JsonValuePrinter:
"Print a json-value"
Expand All @@ -13,7 +12,8 @@ def to_string(self):
return self.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'])
if t.startswith("nlohmann::detail::value_t::"):
try:
Expand Down

0 comments on commit abd829e

Please sign in to comment.