Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* container_of equivalent in gdb-python script
@ 2009-06-10 16:56 Jan Kiszka
  2009-06-10 18:57 ` Tom Tromey
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Kiszka @ 2009-06-10 16:56 UTC (permalink / raw)
  To: gdb

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-06-11  9:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-10 16:56 container_of equivalent in gdb-python script 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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox