chiark / gitweb /
fishdescriptor: use lookup_type for the field list
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 19 Oct 2017 00:52:56 +0000 (01:52 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 19 Oct 2017 00:52:56 +0000 (01:52 +0100)
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
fishdescriptor/py/fishdescriptor/indonor.py

index 6c799c0..f01f9eb 100644 (file)
@@ -58,11 +58,11 @@ def parse_eval(expr):
 
 class DonorStructLayout():
     def __init__(l, typename):
-        x = parse_eval('(%s){ }' % typename)
+        x = gdb.lookup_type(typename)
         l._typename = typename
         l._template = [ ]
         l._posns = { }
-        for f in x.type.fields():
+        for f in x.fields():
             l._posns[f.name] = len(l._template)
             try: f.type.fields();  blank = '{ }'
             except TypeError:      blank = '0'