Book a Demo

Author Topic: Conditional Compilation in C++ Reverse Eng.  (Read 3787 times)

Martin Wawro

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Conditional Compilation in C++ Reverse Eng.
« on: August 20, 2012, 07:07:22 pm »
Hi,

I am working at a multi-platform project and I basically want to generate models from C++ sources for a special platform. The platform-specific stuff is usually put in conditionals (#ifdef). It seems that EA ignores them (seems they always evaluate to true).

Is there any way to teach EA not to consider code in #ifdefs ?


Wyatt

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Conditional Compilation in C++ Reverse Eng.
« Reply #1 on: August 21, 2012, 07:56:29 am »
A workaround that MAY get you over the line..

Use your C++ compiler to output pre-processed source code.  You should then be able to reverse engineer the resulting source code using the standard mechanism and (hopefully!) get the results you're after.

See:
http://stackoverflow.com/questions/277258/c-c-source-file-after-preprocessing

HTH

Martin Wawro

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Conditional Compilation in C++ Reverse Eng.
« Reply #2 on: August 21, 2012, 06:45:08 pm »
Yes, this is the workaround I also had in mind. It would have been nice though if EA would support this out of the box. Pity.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Conditional Compilation in C++ Reverse Eng.
« Reply #3 on: August 22, 2012, 09:00:11 am »
It can be done, but it's not trivial enough to explain here. Contact sparx support and they'll be able to help you.

olli_s

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Conditional Compilation in C++ Reverse Eng.
« Reply #4 on: August 22, 2012, 04:08:54 pm »
I wonder if the explanation could be placed into a white paper if it is too complex. I suggest that many users have the same problem. :-?