Skip to content

Commit cf5428e

Browse files
author
Xianting Lu
committed
update dt command
1 parent 323b53d commit cf5428e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

commands/dt.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ def invoke(self, arg, from_tty):
2222
tp = args.tp
2323
tp = gdb.lookup_type(tp)
2424
for field in tp.fields():
25-
print('+{} {}'.format(field.bitpos/8, field.name))
25+
res = '+{} {}: {} size={}'.format(field.bitpos/8, field.name, field.type, field.type.sizeof)
26+
if field.is_base_class:
27+
res += ' (base)'
28+
print(res)
2629

2730

2831
DTCommand()

0 commit comments

Comments
 (0)