This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AW: debug flags


 
I think the option -D should do what you want. 

Using -D at the commandline you can define any preprocessorsymbol which can
be tested during compilating using #ifdef or #if statements.

McM

-----Ursprüngliche Nachricht-----
Von: John C. Arrakis [mailto:hephaestus.division@gmail.com] 
Gesendet: Montag, 29. September 2008 23:31
An: gcc-help@gcc.gnu.org
Betreff: debug flags

Hello,

I would like to have some code for debugging reasons in a big project that I'm working on, but not via commenting and uncommenting source code lines, as this will be too time-consuming. So, I wonder if there is some way to make gcc create some kind of a global variable or a definition or something like that, that will allow me to inject in my source files pieces of code like this:

# if SOME_DEBUG_FLAG
    do_some_debugging_stuff ();
# endif

I searched in the man pages, but I wasn't able to find anything related to this subject. Any help will be much appreciated!

Cheers,
John.

--
John Coube Arrakis


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]