You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "TAKAHASHI Hideo(BSD-M1G)" <hi...@bisd.hitachi.co.jp> on 2002/04/10 04:24:24 UTC

I want to specify no -g flags to javac

Hi.

Based on the boolean "debug" attribute of the javac task, ant will
specifiy either "-g" or "-g:none" to javac. However -g:none is actually
not the same as not specifying "-g" at all to javac, as for javac.exe of
JDK1.3 and JDK1.4 AFAIK.  I happen to want to do a build with no -g
flags at all.

As of JDK1.3 and 1.4:
-g:none will produce no debugging information at all, and makes trouble
shooting very hard -- i.e. you won't be able to get an informative stack
dump.

No -g flags is an alias to -g:source,lines and is helpful for trouble
shooting, without revealing the variable information.  We want to use
this for production build.

-g is an alias to -g:source,lines,vars and is helpful for use with a
debugger.  This is OK for a development phase build.

My chances seems to be:

(1) Change the source to alter the behaviour of debug="false", but that
isn't very nice.   I don't want to make a branch.

(2) Make an enhancement request, however it seems that the javac task is
designed to define a common set of options that can be applied to all
supported compilers, so making compiler dependend flags specifiable
would probably be against the current design policy.

Maybe I will have to choose (1) for the present.

Are there any better way to address this?

--
Hideo Takahashi
Business Solutions Division, Hitachi Ltd.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: I want to specify no -g flags to javac

Posted by Adam Murdoch <ad...@apache.org>.
On Wed, 10 Apr 2002 12:24, TAKAHASHI Hideo(BSD-M1G) wrote:
> My chances seems to be:
>
> (1) Change the source to alter the behaviour of debug="false", but that
> isn't very nice.   I don't want to make a branch.
>
> (2) Make an enhancement request, however it seems that the javac task is
> designed to define a common set of options that can be applied to all
> supported compilers, so making compiler dependend flags specifiable
> would probably be against the current design policy.
>
> Maybe I will have to choose (1) for the present.
>
> Are there any better way to address this?

There is.  A 'debuglevel' attribute was added to the <javac> task, to give 
fine-grained control over this.  You'll need to use the Ant 1.5alpha in CVS.

-- 
Adam

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: I want to specify no -g flags to javac

Posted by "TAKAHASHI Hideo(BSD-M1G)" <hi...@bisd.hitachi.co.jp>.
Thank you. Just what I wanted.
I will switch to 1.5 when its ready to go.

Diane Holt wrote:
> 
> --- "TAKAHASHI Hideo(BSD-M1G)" <hi...@bisd.hitachi.co.jp> wrote:
> > No -g flags is an alias to -g:source,lines and is helpful for trouble
> > shooting, without revealing the variable information.  We want to use
> > this for production build.
> >
> > -g is an alias to -g:source,lines,vars and is helpful for use with a
> > debugger.  This is OK for a development phase build.
> 
> 1.5alpha's <javac> has a new attribute, 'debuglevel' -- so you can now do:
> 
>   debug="on"
>   debuglevel="source,lines"
> 
> (Of course, you probably wouldn't want to hard-code in the debug and
> debuglevel value, but reference properties instead, so you can switch
> their values according to what type of build you're running.)
> 
> Diane
> 
> =====
> (holtdl@yahoo.com)
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

-- 
高橋英男 hideo-t@bisd.hitachi.co.jp
日立製作所 ビジネスソリューション事業部
先端ミドルウェア開発部 第1G
電話 877-5722 FAX 877-5719 社内便 (BSD)M1G 高橋(英)

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: I want to specify no -g flags to javac

Posted by Diane Holt <ho...@yahoo.com>.
--- "TAKAHASHI Hideo(BSD-M1G)" <hi...@bisd.hitachi.co.jp> wrote:
> No -g flags is an alias to -g:source,lines and is helpful for trouble
> shooting, without revealing the variable information.  We want to use
> this for production build.
> 
> -g is an alias to -g:source,lines,vars and is helpful for use with a
> debugger.  This is OK for a development phase build.

1.5alpha's <javac> has a new attribute, 'debuglevel' -- so you can now do:

  debug="on"
  debuglevel="source,lines"

(Of course, you probably wouldn't want to hard-code in the debug and
debuglevel value, but reference properties instead, so you can switch
their values according to what type of build you're running.)

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>