Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > parse c c++ header to map binary block for display

Reply
Thread Tools

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

 
 
Pilotmi80
Guest
Posts: n/a
 
      07-13-2005
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 ?

 
Reply With Quote
 
 
 
 
Bob Smith
Guest
Posts: n/a
 
      07-14-2005
Pilotmi80 wrote:

> 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

--
http://www.kolumbus.fi/bob.smith
 
Reply With Quote
 
 
 
 
Pilotmi80
Guest
Posts: n/a
 
      07-14-2005

> 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.

 
Reply With Quote
 
Bob Smith
Guest
Posts: n/a
 
      07-14-2005
Pilotmi80 wrote:

>
>> 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.

would this be something for you?
http://search.cpan.org/~amichauer/C-....40/Include.pm
G
--
http://www.kolumbus.fi/bob.smith
 
Reply With Quote
 
Pilotmi80
Guest
Posts: n/a
 
      07-15-2005
> would this be something for you?
> http://search.cpan.org/~amichauer/C-....40/Include.pm
> G


Thanks a lot, it seems to be the very answer to my problem.

Sincerely,
Pilot

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Header files with "header.h" or <header.h> ?? mlt C++ 2 01-31-2009 02:54 PM
Want to build a binary header block Bob Greschke Python 3 05-02-2007 09:30 AM
Fo:Block can you check to see if a block contains any text by using the block id? morrell XML 1 10-10-2006 07:18 PM
How to parse a string like C program parse the command line string? linzhenhua1205@163.com C Programming 19 03-15-2005 07:41 PM



Advertisments