parsing a c project
carrierphasejitter at yahoo.com
Wed Aug 4 13:33:58 CEST 2010
I need to know the memory locations of all variables in a C project including
variables allocated inside structs.
What I want to do in to expand the structs into its basic elements (floats,
int16 and int8).
In a header file (example.h) I have the following definitions.
I have been able to extract from the project the name of every struct, the type of the struct and the beginning address of each struct.
I need an output like this.
house1_struct_house_area float 000082d0
house1_struct_house_rooms int8 000082d4
house1_struct_house_visits int16 000082d5
house2_struct_house_area float 00003000
house2_struct_house_rooms int8 00003004
house2_struct_house_visits int16 00003005
car1_struct_car_price float 00004000
car1_struct_car_color int8 00004004
How can I efficiently do this in Python ?
I do not have very clear which element of Python should I use
to store the struct list or class
I would be very grateful if someone could give me some pointers.
More information about the Python-list