Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Chris Johns <chris@contemporary.net.au>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: Python Pretty printing a struct
Date: Mon, 15 Mar 2010 22:52:00 -0000	[thread overview]
Message-ID: <4B9EBA17.6070806@contemporary.net.au> (raw)
In-Reply-To: <m3r5nl5yli.fsf@fleche.redhat.com>

On 16/03/2010 3:38 AM, Tom Tromey wrote:
>>>>>> "Chris" == Chris Johns<chris@contemporary.net.au>  writes:
>
> Chris>      def to_string(self):
> Chris>          return 'to_string'
>
> This seems like a strange definition for this method.

I am not sure I follow. The 'to_string' text was just to show where the 
output appeared.

> Try removing it.

Commenting out the function produced:

(gdb) p the_semaphore->Object.id
$4 = AttributeError: object_id_printer instance has no attribute 'to_string'
  = {
   id = 436273170,
   node = 1,
   api = classic,
   class = semaphores,
   index = 18
}

Trying:

     def to_string(self):
         return None

and

     def to_string(self):
         pass

gave:

(gdb) p the_semaphore->Object.id
$5 = TypeError: Could not convert Python object: None
  = {
   id = 436273170,
   node = 1,
   api = classic,
   class = semaphores,
   index = 18
}

>
> Chris>  Should I raise a bug report ?
>
> Sure.
>

Bug #11380.

>
> This is probably due to http://sourceware.org/bugzilla/show_bug.cgi?id=10660
>

Agreed.

Chris


  reply	other threads:[~2010-03-15 22:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-11 23:39 Chris Johns
2010-03-12 20:40 ` Tom Tromey
2010-03-14 23:40   ` Chris Johns
2010-03-15 16:39     ` Tom Tromey
2010-03-15 22:52       ` Chris Johns [this message]
2010-03-16  2:18         ` Tom Tromey
2010-03-16  5:10           ` Chris Johns

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=4B9EBA17.6070806@contemporary.net.au \
    --to=chris@contemporary.net.au \
    --cc=gdb@sourceware.org \
    --cc=tromey@redhat.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