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

Discussion in 'Perl Misc' started by Pilotmi80, Jul 13, 2005.

  1. Pilotmi80

    Pilotmi80 Guest

    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 ?
    Pilotmi80, Jul 13, 2005
    #1
    1. Advertising

  2. Pilotmi80

    Bob Smith Guest

    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
    Bob Smith, Jul 14, 2005
    #2
    1. Advertising

  3. Pilotmi80

    Pilotmi80 Guest


    > 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.
    Pilotmi80, Jul 14, 2005
    #3
  4. Pilotmi80

    Bob Smith Guest

    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-Include-1.40/Include.pm
    G
    --
    http://www.kolumbus.fi/bob.smith
    Bob Smith, Jul 14, 2005
    #4
  5. Pilotmi80

    Pilotmi80 Guest

    Pilotmi80, Jul 15, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. morrell
    Replies:
    1
    Views:
    948
    roy axenov
    Oct 10, 2006
  2. Replies:
    19
    Views:
    1,120
    Daniel Vallstrom
    Mar 15, 2005
  3. Bob Greschke

    Want to build a binary header block

    Bob Greschke, May 1, 2007, in forum: Python
    Replies:
    3
    Views:
    303
    Nick Craig-Wood
    May 2, 2007
  4. mlt
    Replies:
    2
    Views:
    832
    Jean-Marc Bourguet
    Jan 31, 2009
  5. 7stud --

    optparse: parse v. parse! ??

    7stud --, Feb 20, 2008, in forum: Ruby
    Replies:
    3
    Views:
    184
    7stud --
    Feb 20, 2008
Loading...

Share This Page