Refactor json macro (#12391)

* closes #12316
* make tjsonmacro work at js target
* closes #12289
* closes #11988
* also fixed gdb related stuff
This commit is contained in:
Arne Döring
2019-10-17 09:55:41 +02:00
committed by Andreas Rumpf
parent 5ba932e43c
commit 21cbfd72ec
9 changed files with 387 additions and 663 deletions

View File

@@ -30,7 +30,7 @@ def getNimRti(type_name):
m = type_hash_regex.match(type_name)
if m:
try:
return gdb.parse_and_eval("NTI_" + m.group(1) + "_")
return gdb.parse_and_eval("NTI__" + m.group(1) + "_")
except:
return None
@@ -340,13 +340,13 @@ def reprEnum(e, typ):
return str(e) + " (invalid data!)"
class NimEnumPrinter:
pattern = re.compile(r'^tyEnum_(\w*)_([A-Za-z0-9]*)$')
pattern = re.compile(r'^tyEnum_(\w*)__([A-Za-z0-9]*)$')
def __init__(self, val):
self.val = val
match = self.pattern.match(self.val.type.name)
self.typeNimName = match.group(1)
typeInfoName = "NTI_" + match.group(2) + "_"
typeInfoName = "NTI__" + match.group(2) + "_"
self.nti = gdb.lookup_global_symbol(typeInfoName)
if self.nti is None:
@@ -373,7 +373,7 @@ class NimSetPrinter:
match = self.pattern.match(self.val.type.name)
self.typeNimName = match.group(1)
typeInfoName = "NTI_" + match.group(2) + "_"
typeInfoName = "NTI__" + match.group(2) + "_"
self.nti = gdb.lookup_global_symbol(typeInfoName)
if self.nti is None: