This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
AW: debug flags
- From: "MICHALECZ Martin" <michalecz at scigames dot at>
- To: <gcc-help at gcc dot gnu dot org>
- Cc: "MICHALECZ Martin" <michalecz at scigames dot at>
- Date: Tue, 30 Sep 2008 09:21:37 +0200
- Subject: AW: debug flags
- References: <357685340809291425r5635a50bk8db60b76ae95a5dc@mail.gmail.com> <357685340809291430j2d32f28drd4b372994fe7f42f@mail.gmail.com>
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