container_of equivalent in gdb-python script

Jan Kiszka jan.kiszka@web.de
Thu Jun 11 09:51:00 GMT 2009


Tom Tromey wrote:
>>>>>> "Jan" == Jan Kiszka <jan.kiszka@web.de> writes:
> 
> Jan> Yeah, seen this (in the testsuite). But such objects neither have
> Jan> addresses, nor do they help with non-constant objects I'm interested in.
> 
> Yeah.  You can use this for "offsetof" but it sounds like you wanted
> more.

Yep, essentially instantiate a gdb.Value object of arbitrary type at an
arbitrary address.

> 
> Tom> Whoops, this seems to be undocumented.
> 
> Jan> Not the only piece... :)
> 
> Please report anything you think is missing.  We try very hard to
> document the entirety of the Python API; anything missing is due to an
> oversight.  I will write doc patches for anything you "don't" find ;)
> 

I have to correct myself: Actually looking at the right documentation, I
find all the latest features described (I was probably still starring at
6.8 docs...).

Jan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 257 bytes
Desc: OpenPGP digital signature
URL: <http://sourceware.org/pipermail/gdb/attachments/20090611/d6066686/attachment.sig>


More information about the Gdb mailing list