Re: Debug Info in class files (original) (raw)
On 2012-12-28 02:47, Mani Sarkar wrote:
Hi guys,
I have been following this thread and would like to see some examples on using the below (-g and/or DEBUG_CLASSFILES=true options when running the make command with the new build-infra system).
This variable only works with the old build system. The question was directed at jdk7 so I didn't include information about the new build system in the answer.
I have also come across a blog on java.net which talks about fastdebug and product builds and suggests to do the following
SKIP_DEBUG_BUILD=true SKIP_FASTDEBUG_BUILD=false DEBUG_NAME=fastdebug for a fastdebug build
and
SKIP_DEBUG_BUILD=true SKIP_FASTDEBUG_BUILD=true for a product build
To build fastdebug or what used to be called "debug" with the new build system, you give the parameter --with-debug-level=slowdebug/fastdebug to configure. The default is "release". There is a shorthand --enable-debug which does fastdebug. Any debug level except release will enable -g for javac. For native code, this is what the debuglevels do:
release: no debug information, all optimizations, no asserts.
fastdebug: debug information (-g), all optimizations, all asserts
slowdebug: debug information (-g), no optimizations, all asserts
As I understand it, slowdebug is too slow to be usable so it's rarely used. Fastdebug is what developers typically build.
There is currently no specific parameter to enable -g just for java code. One way to achieve it is to add JAVAC_FLAGS=-g to the configure line.
bash configure JAVAC_FLAGS=-g
Are they flags still valid with the new build-infra system, should they be accompanied by any other settings (any configure related commands). Where should we expect the build artefacts to be created? Are there any flags to build a full debug of the Hotspot? Examples on how to use these flags to achieve the three respective types of builds would definitely be helpful.
No, the old variables are not valid. If you configure with a different debuglevel, the build output will by default end up in a different directory. Example:
build/linux-x86_64-normal-server-release build/linux-x86_64-normal-server-fastdebug
The debuglevel also affects hotspot.
Examples and help can be found here: http://openjdk.java.net/projects/build-infra/guide.html
Whats the difference between a full debug, fastdebug and product build in terms of the build process and the end-output?
See above.
/Erik
Miten, if you are still following this thread, please feel free to join the Adopt OpenJDK project as suggested by Ben by going to http://java.net/projects/adoptopenjdk. The wiki and other links should help you get started.
Thanks, Mani