[Top][All Lists]

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

Re: A java DEBUG flag

From: Brian Jones
Subject: Re: A java DEBUG flag
Date: 29 Nov 2000 18:51:02 -0500
User-agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7

Pat Tullmann wrote:

> I do a very similar thing (preprocesssing Java code to help
> debugging).  I've got a framework that allows me to turn debugging
> on/off with the preprocessor, and then I can select subsets of the
> printfs() at run-time via a system property.  Its easier to look at
> than explain, so if you're interested fetch:
> Untar it an look at:
>       janos-20000905/java/Defines.cpp (these are the CPP macros I use)
>       janos-20000905/java/nodeos/Trace.Java (this is what the macros 
>                       call)
> Then grep around janos-20000905/java/nodeos/ for calls to the macros
> (DBG*) to see how its used.
> I find it exceedingly handy to be able to turn debugging printfs (and
> other code) on/off without recompiling.

Pat sent me this and after taking a look I think he's possibly
provided an easy solution to two problems.

a) You can define package names and have the preprocessor name the
classes.  I'd vote to not try to rename some things in java.lang as
they are just plainly VM specific and you'd never want to test them
against anything other than that VM anyway.

b) You can #ifdef debugging code and this doesn't rely on a java
compiler to optimize the debugging code out of the class.

Making these sorts of changes would be time consuming and indeed the
gcj team might have problems with it as it would affect their build as
well as ours.  Can I get buy in for either (a) or (b)?

Brian Jones <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]