On 19.06.2012 10:27, graham wrote: > I have tried many things including this > def children(self): > data2 = self.val.dereference() > ptype2 = gdb.lookup_type("QTextDocument").pointer() > yield > "isEmpty",callClassMethod(data2.cast(ptype2).dereference(),"isEmpty","") > > but this results in an infinite loop > > My implementation of the callClassMethod function is > > def callClassMethod (value,func,args): > > type = value.type > #type = type.unqualified ().strip_typedefs () > #print "type %s" % type > exp = "((class %s*)%s)->%s()" % (type, value.address, func) "%s" % value.address is the source of your infinite loop as it triggers the pretty printer for the pointer to value. Try "%i" % long(value.address) or "0x%x" % long(value.address) - Joachim