public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Joachim Protze <joachim.protze@tu-dresden.de>
To: graham <graham.labdon@avalonsciences.com>
Cc: gdb@sources.redhat.com
Subject: Re: pretty printer for pointers
Date: Thu, 21 Jun 2012 13:57:00 -0000	[thread overview]
Message-ID: <4FE32827.6030402@tu-dresden.de> (raw)
In-Reply-To: <loom.20120619T094622-441@post.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 831 bytes --]

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 #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5306 bytes --]

      reply	other threads:[~2012-06-21 13:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-19  9:15 graham
2012-06-21 13:57 ` Joachim Protze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4FE32827.6030402@tu-dresden.de \
    --to=joachim.protze@tu-dresden.de \
    --cc=gdb@sources.redhat.com \
    --cc=graham.labdon@avalonsciences.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).