Looking at fastdebug build log files, no -g or -gstabs is provided on
any linux builds as far as I can see.
I suspect that hotspot/make/linux/makefiles/fastdebug.make is missing
the addition of this DEBUG_CFLAGS variable to CFLAGS like the jvmg.make
and debug.make files. Adding it to CFLAGS adds it to all compile lines.
The gcc.make file does not add the DEBUG_CFLAGS to CFLAGS.
-kto
David Holmes - Sun Microsystems wrote:
Kelly O'Hair said the following on 07/23/08 05:17:
Jeffrey Baker wrote:
Third problem: fastdebug_build target doesn't seem to propagate the -g
flag. All of hotspot was built with -fPIC -fno-rtti -fno-exceptions
-fcheck-new -m32 -march=i586 -pipe -O3 -fno-strict-aliasing
-Wpointer-arith -Wconversion -Wsign-compare, i.e. without -g. I
thought the point of the fastdebug target was to build with -g -O.
Yes, it should have. That's a new one on me.
I see that the debug build seems to use -gstabs, but it looks
like linux/makefiles/fastdebug.make forgot to add -gstabs to CFLAGS.
It's possible that they removed it with 64bit mode because of the
size problems with Dwarf2 debug format, and accidently removed it for
32bit too. :^( Sounds like a bug to me.
The debug flags are handled in gcc.make:
hypert /scratch/mirrors/ws-mirrors/java7/open/hotspot/make > tail -15
linux/makefiles/gcc.make
#------------------------------------------------------------------------
# Debug flags
# Use the stabs format for debugging information (this is the default
# on gcc-2.91). It's good enough, has all the information about line
# numbers and local variables, and libjvm_g.so is only about 16M.
# Change this back to "-g" if you want the most expressive format.
# (warning: that could easily inflate libjvm_g.so to 150M!)
# Note: The Itanium gcc compiler crashes when using -gstabs.
DEBUG_CFLAGS/ia64 = -g
DEBUG_CFLAGS/amd64 = -g
DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
DEBUG_CFLAGS += -gstabs
endif
See also bug 6485088
Cheers,
David Holmes