From: Jan Kiszka <jan.kiszka@siemens.com>
To: gdb@sourceware.org
Subject: container_of equivalent in gdb-python script
Date: Wed, 10 Jun 2009 16:56:00 -0000 [thread overview]
Message-ID: <4A2FE5AB.4060707@siemens.com> (raw)
Hi,
I'm currently getting my feet wet with gdb's great python extension. My
first exercise is to walk a linked list of objects in a C inferior
(namely 'modules' of the Linux kernel) and evaluate the elements. I'm at
the point where I would apply a standard container_of() macro in C:
convert the list entry into a gdb.Value that describes the containing
object.
Of course, I can implement container_of as a gdb expression, print the
result and drag it in via gdb.history(). Done that already, basically
works. But it is fairly ugly as the print output will flood the screen.
I'm probably overseeing some obvious path in the python extension, any
pointers welcome!
Thanks,
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
next reply other threads:[~2009-06-10 16:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-10 16:56 Jan Kiszka [this message]
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
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=4A2FE5AB.4060707@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=gdb@sourceware.org \
/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