Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Chris Johns <chris@contemporary.net.au>
To: tromey@redhat.com
Cc: gdb@sourceware.org
Subject: Re: Reading a static variable in Python
Date: Thu, 11 Mar 2010 01:49:00 -0000	[thread overview]
Message-ID: <4B984C19.80407@contemporary.net.au> (raw)
In-Reply-To: <m3eijsjef4.fsf@fleche.redhat.com>

On 11/03/2010 4:05 AM, Tom Tromey wrote:
>>>>>> "Chris" == Chris Johns<chris@contemporary.net.au>  writes:
>
> Chris>  I am adding pretty printers for RTEMS to gdb. In the RTEMS operating
> Chris>  system elements such as a semaphore are given an id. I would like to
> Chris>  print the actual semaphore data given a semaphore id. To do this I
> Chris>  need to read a kernel structure from a table indexed via a bit field
> Chris>  in the id. As an example the semaphore's table is declared in RTEMS
> Chris>  as:
>
> Chris>  RTEMS_SEM_EXTERN Objects_Information  _Semaphore_Information;
>
> This isn't really enough information for us to help you.
> What does Objects_Information look like?
>

Yes sorry about that. It is a C struct [1].

> Chris>  I am stuck on how to create a new gdb.Value variable in Python.
>
> Use gdb.parse_and_eval.

Nice. This is an excellent solution. I suppose being an expression it 
can do the pointer maths as well. I was looking at ways to construct a 
gdb.Value with a gdb.Symbol as an argument.

>  This wasn't added until after 7.0.

I am using a 7.1 snapshot as it has the 'source' command to load a 
Python file. This is also an excellent addition.

Chris

[1] 
http://www.rtems.org/onlinedocs/doxygen/cpukit/html/structObjects__Information.html


  reply	other threads:[~2010-03-11  1:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-10  3:38 Chris Johns
2010-03-10 17:05 ` Tom Tromey
2010-03-11  1:49   ` Chris Johns [this message]
2010-03-11 16:53     ` Tom Tromey
2010-03-11 17:15       ` Phil Muldoon
2010-03-11 17:58         ` Tom Tromey
2010-03-11 23:40       ` 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=4B984C19.80407@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