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 6c799c019aea198c46da220b8a58c857abe32c13..f01f9eb0c6e910de98ee65c8c654de3f8d091325 100644 (file)
@@ -58,11 +58,11 @@ def parse_eval(expr):
 
 class DonorStructLayout():
     def __init__(l, typename):
 
 class DonorStructLayout():
     def __init__(l, typename):
-        x = parse_eval('(%s){ }' % typename)
+        x = gdb.lookup_type(typename)
         l._typename = typename
         l._template = [ ]
         l._posns = { }
         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'
             l._posns[f.name] = len(l._template)
             try: f.type.fields();  blank = '{ }'
             except TypeError:      blank = '0'