AW: debug flags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 
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@xxxxxxxxx] 
Gesendet: Montag, 29. September 2008 23:31
An: gcc-help@xxxxxxxxxxx
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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux