Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: tromey@redhat.com
Cc: gdb@sourceware.org
Subject: Re: container_of equivalent in gdb-python script
Date: Wed, 10 Jun 2009 21:06:00 -0000	[thread overview]
Message-ID: <4A302033.90501@web.de> (raw)
In-Reply-To: <m3d49bg71a.fsf@fleche.redhat.com>

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

Tom Tromey wrote:
>>>>>> "Jan" == Jan Kiszka <jan.kiszka@web.de> writes:
> 
> Jan> I meanwhile discovered (reading testcases and python-*.c)
> Jan> gdb.lookup_type() and Value.cast() to make this real. But you see, I
> Jan> still need an ugly synthetic Value object which must have a non-'None'
> Jan> address to do this calculation. Is there a cleaner, more generic way?
> 
> Yeah, I think the missing piece is "gdb.parse_and_eval", which is on
> the archer python branch, but which we haven't pushed upstream into
> gdb CVS yet.  This takes an expression (a string), parses it,
> evaluates it, and returns a Value.  It is very convenient when
> implementing your own gdb commands.

Perfect, that solves the problem! Just checked out and tried successfully.

> 
> I don't think there's any particular problem with submitting this,
> just somebody finding the time.
> 

Hopefully before the next release. I would try to help, but I don't have
an FSF assignment.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

  reply	other threads:[~2009-06-10 21:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-10 16:56 Jan Kiszka
2009-06-10 18:57 ` Tom Tromey
2009-06-10 20:10   ` Jan Kiszka
2009-06-10 20:37     ` Tom Tromey
2009-06-10 21:06       ` Jan Kiszka [this message]
2009-06-10 20:42     ` Daniel Jacobowitz
2009-06-10 21:33       ` Jan Kiszka
2009-06-10 21:42         ` Tom Tromey
2009-06-10 22:13           ` Jan Kiszka
2009-06-10 22:17             ` Tom Tromey
2009-06-11  9:51               ` Jan Kiszka

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=4A302033.90501@web.de \
    --to=jan.kiszka@web.de \
    --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