public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* debug flags
       [not found] <357685340809291425r5635a50bk8db60b76ae95a5dc@mail.gmail.com>
@ 2008-09-29 21:31 ` John C. Arrakis
  2008-09-30  7:22   ` AW: " MICHALECZ Martin
  0 siblings, 1 reply; 2+ messages in thread
From: John C. Arrakis @ 2008-09-29 21:31 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* AW: debug flags
  2008-09-29 21:31 ` debug flags John C. Arrakis
@ 2008-09-30  7:22   ` MICHALECZ Martin
  0 siblings, 0 replies; 2+ messages in thread
From: MICHALECZ Martin @ 2008-09-30  7:22 UTC (permalink / raw)
  To: gcc-help; +Cc: MICHALECZ Martin

 
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-30  7:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <357685340809291425r5635a50bk8db60b76ae95a5dc@mail.gmail.com>
2008-09-29 21:31 ` debug flags John C. Arrakis
2008-09-30  7:22   ` AW: " MICHALECZ Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).