This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pretty printer for pointers


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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]