Dump offsets of members in a structure type.
Definition at line 11 of file offsets.py.
◆ __init__()
| python.offsets.Offsets.__init__ |
( |
| self | ) |
|
Definition at line 14 of file offsets.py.
14 def __init__(self):
15 super (Offsets, self).__init__ ('offsets-of', gdb.COMMAND_DATA, gdb.COMPLETE_SYMBOL)
16
◆ invoke()
| python.offsets.Offsets.invoke |
( |
| self, |
|
|
| arg, |
|
|
| from_tty ) |
Definition at line 17 of file offsets.py.
17 def invoke(self, arg, from_tty):
18 argv = gdb.string_to_argv(arg)
19 if len(argv) != 1:
20 raise gdb.GdbError('offsets-of takes exactly 1 argument.')
21
22 stype = gdb.lookup_type(argv[0])
23
24 print (argv[0], '{')
25 for field in stype.fields():
26 print (' %s => %d' % (field.name, field.bitpos//8))
27 print ('}')
28
The documentation for this class was generated from the following file: