0

Does anyone know the command to use, if I want to look in an executable compiled with gcc to determine if there were any variables defined for use by #define.

Thank you,

evraz001
  • 31
  • 2
  • 6
  • Are you trying to find out what values were defined when it was built or what possible defines exist in the source that compiled it (whether a value was defined or not)? (Note I don't think either of those is possible but one is at least marginally conceivable as possible.) – Etan Reisner Jul 02 '15 at 21:22
  • #define macros are expanded by the preprocessor, no trace of them is left in the source by the time it is compiled, so no trace of it will be in the executable code. With recent versions of GCC you might get macros recorded in debug info, depending on how it was compiled. – Jonathan Wakely Jul 02 '15 at 22:02
  • I am looking for what values were defined when built. So basically the the values when a define is set in a make. e.g given Dmydefine in the make, I would like to examine the executalbe to determine if there was a mydefine set. – evraz001 Jul 02 '15 at 22:02
  • Are you looking for variables set by `#define` directives in the source, or by `-D` options passed to the preprocessor? – Beta Jul 04 '15 at 05:37
  • The -D option.Thanks – evraz001 Jul 06 '15 at 17:58

0 Answers0