comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Persson" <spam-away@nowhere.nil>
Subject: Re: Conditional compilation of debug traces without cpp
Date: Tue, 04 Jul 2006 21:39:33 GMT
Date: 2006-07-04T21:39:33+00:00	[thread overview]
Message-ID: <peBqg.7712$E02.2290@newsb.telia.net> (raw)
In-Reply-To: <44aabe0c$0$5715$626a54ce@news.free.fr>

guillaume.portail@grospied.enanglais.com skrev:
> Ludovic Brenta wrote:
>> You could place all calls to Debug.Put_Line inside a pragma Debug.
> 
> It helps, but it is GNAT specific. I would prefer a pure Ada solution.

Well, there is always the good old if statement:

with Ada.Text_IO; use Ada.Text_IO;
procedure Debug_Demo is
    Debug_Enabled: constant Boolean := false;
begin
    if Debug_Enabled then
       Put_Line("PC was here, A = " & Integer'Image(12));
    end if;
end Debug_Demo;

When Debug_Enabled is false, the compiler (at least Gnat) will remove 
the if statement completely.

-- 
Bj�rn Persson                              PGP key A88682FD
                    omb jor ers @sv ge.
                    r o.b n.p son eri nu



  reply	other threads:[~2006-07-04 21:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-04 18:06 Conditional compilation of debug traces without cpp guillaume.portail
2006-07-04 19:07 ` Ludovic Brenta
2006-07-04 19:14   ` guillaume.portail
2006-07-04 21:39     ` Björn Persson [this message]
2006-07-04 21:43       ` guillaume.portail
2006-07-04 22:01         ` Björn Persson
2006-07-05  3:10     ` Matthew Goulet
2006-07-04 20:24 ` Gautier
2006-07-04 20:54 ` Simon Wright
2006-07-05 13:03 ` Jean-Pierre Rosen
2006-07-05 19:39   ` guillaume.portail
2006-07-06  5:53     ` Martin Krischik
2006-07-07 10:32       ` Stephen Leake
2006-07-07 14:08         ` M E Leypold
2006-07-06  7:59     ` Jean-Pierre Rosen
2006-07-06 20:25       ` guillaume.portail
2006-07-07  5:00         ` Matthew Goulet
2006-07-07 13:57           ` Thierry Bernier
2006-07-07 21:08           ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox