parse c c++ header to map binary block for display

P

Pilotmi80

Currently I have a c++ project : I include the header containing
structure.
The program open the binary file, it casts it to the structure and it
displays the fields in a dialog.

I'd like your advice how to make it a bit more automatically : say,
whenever the structure changes, i don't have to manually change my
application.

I thought of a parser for the C/C++ header to collect the available
fields.
I won't make my own as it is a huge job : maintaining preprocessor
defines, and macros and recurse in the included files.

Do you have any pointer ?
 
B

Bob Smith

Pilotmi80 said:
Currently I have a c++ project : I include the header containing
structure.
The program open the binary file, it casts it to the structure and it
displays the fields in a dialog.

I'd like your advice how to make it a bit more automatically : say,
whenever the structure changes, i don't have to manually change my
application.

I thought of a parser for the C/C++ header to collect the available
fields.
I won't make my own as it is a huge job : maintaining preprocessor
defines, and macros and recurse in the included files.

Do you have any pointer ?
hmmm, ,,,
binary file? object file?
what are you trying to do, please be more specific,,
G
 
P

Pilotmi80

hmmm, ,,,
binary file? object file?
what are you trying to do, please be more specific,,

Ok sorry i will try to be a bit clearer :

Application domain is embedded systems : i need to update the firmware
/ configuration of devices.

The tool i made is used to set the settings, then it compiles (check
bounds and other constraints, compatibilies), pack them into a binary
block that is then sent / uploaded towards the target device.

The binary block is actually a C structure and a part of the
compilation just aims at filling the structure to be sent. When done,
it also can be saved into a binary file.

For debug reasons, I need something to spy into the binary block. As
previously said, I could have a C++ program to allocate a structure,
fill it up with the binary block read from file and display its field
contents.
But the structure is changing rather frequently so i cannot keep the
pace.

So i need advice or pointers to have this automatic mapping/displaying.
In fact, i would like to have the spy feature we have in visual studio
when we're looking at an object.

Hope it's simpler that way, thanks for reading.
 
B

Bob Smith

Pilotmi80 said:
Ok sorry i will try to be a bit clearer :

Application domain is embedded systems : i need to update the firmware
/ configuration of devices.

The tool i made is used to set the settings, then it compiles (check
bounds and other constraints, compatibilies), pack them into a binary
block that is then sent / uploaded towards the target device.

The binary block is actually a C structure and a part of the
compilation just aims at filling the structure to be sent. When done,
it also can be saved into a binary file.

For debug reasons, I need something to spy into the binary block. As
previously said, I could have a C++ program to allocate a structure,
fill it up with the binary block read from file and display its field
contents.
But the structure is changing rather frequently so i cannot keep the
pace.

So i need advice or pointers to have this automatic mapping/displaying.
In fact, i would like to have the spy feature we have in visual studio
when we're looking at an object.

Hope it's simpler that way, thanks for reading.
would this be something for you?
http://search.cpan.org/~amichauer/C-Include-1.40/Include.pm
G
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,905
Latest member
Kristy_Poole

Latest Threads

Top