Hi,
I'm using gdb and libbfd to retrieve global variables information from an elf file and show it. I can get the following data from libbfd: Global Variable name, address and size. I retrieve the type of the variables and its children using gdb and gdb\MI (ptype, whatis, -var-create & -var-list-children).
How can I get the address\size\offset from parent of all the children?
e.g
type = struct {\n"
unsigned char count;\n"
unsigned char time;\n
}\n
If a variable A of this type is in address 0x000100, I want to show that A.count is in 0x000100 with size 0x1 and A.time is in 0x000101 with size 0x1.
EDIT: I've read that gdb can read the DWARF info, but I can't figure out how can I get this information from gdb.