Commit ed347998 by Hans Boehm Committed by Hans Boehm

configure.ac: Handle --enable-gc-debug.

	* configure.ac: Handle --enable-gc-debug.
	* configure: Regenerate.
	* include/config.h.in (LIBGCJ_GC_DEBUG): Add.
	* boehm.cc: Include gc_mark.h, javaxfc.h, but no GC private files.
	Rearrange include file order.
	(GC_DEBUG): Set if LIBGCJ_GC_DEBUG is set.
	(GC_finalize_all, GC_debug_generic_malloc): Don't declare.
	(disable_gc_mutex): Delete along with all references.
	(_Jv_MarkObj, _Jv_MarkArray): Use public types,
	adjust for debug header size.
	(_Jv_AllocObj, _Jv_allocPtrFreeObj): Define out of line for
	debug case.
	(_Jv_AllocArray): Declare min_heap_addr only if needed.
	(gcj_describe_type_fn): New.
	(_Jv_InitGC): Use GC_new_free_list, GC_new_proc, and GC_new_kind.
	Register gcj_describe_type_fn.
	* include/boehm-gc.h:
	(_Jv_AllocObj, _Jv_allocPtrFreeObj):
	Don't define, but declare, for debug case.
	* java/lang/natObject.cc:
	(GC_DEBUG): Define if LIBGCJ_GC_DEBUG is set.

From-SVN: r86686
parent 3c1cbf58
2004-08-27 Hans Boehm <Hans.Boehm@hp.com>
* configure.ac: Handle --enable-gc-debug.
* configure: Regenerate.
* include/config.h.in (LIBGCJ_GC_DEBUG): Add.
* boehm.cc: Include gc_mark.h, javaxfc.h, but no GC private files.
Rearrange include file order.
(GC_DEBUG): Set if LIBGCJ_GC_DEBUG is set.
(GC_finalize_all, GC_debug_generic_malloc): Don't declare.
(disable_gc_mutex): Delete along with all references.
(_Jv_MarkObj, _Jv_MarkArray): Use public types,
adjust for debug header size.
(_Jv_AllocObj, _Jv_allocPtrFreeObj): Define out of line for
debug case.
(_Jv_AllocArray): Declare min_heap_addr only if needed.
(gcj_describe_type_fn): New.
(_Jv_InitGC): Use GC_new_free_list, GC_new_proc, and GC_new_kind.
Register gcj_describe_type_fn.
* include/boehm-gc.h:
(_Jv_AllocObj, _Jv_allocPtrFreeObj):
Don't define, but declare, for debug case.
* java/lang/natObject.cc:
(GC_DEBUG): Define if LIBGCJ_GC_DEBUG is set.
2004-08-26 Mark Wielaard <mark@klomp.org> 2004-08-26 Mark Wielaard <mark@klomp.org>
Fixes PR libgcj/17002: Fixes PR libgcj/17002:
......
...@@ -869,6 +869,7 @@ Optional Features: ...@@ -869,6 +869,7 @@ Optional Features:
allow compilation of several files at once allow compilation of several files at once
--enable-libgcj-debug enable runtime debugging code --enable-libgcj-debug enable runtime debugging code
--enable-gc-debug include full support for pointer backtracing etc.
--enable-interpreter enable interpreter --enable-interpreter enable interpreter
--enable-sjlj-exceptions --enable-sjlj-exceptions
force use of builtin_setjmp for exceptions force use of builtin_setjmp for exceptions
...@@ -4735,7 +4736,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" ...@@ -4735,7 +4736,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
case $host in case $host in
*-*-irix6*) *-*-irix6*)
# Find out which ABI we are using. # Find out which ABI we are using.
echo '#line 4738 "configure"' > conftest.$ac_ext echo '#line 4739 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5 (eval $ac_compile) 2>&5
ac_status=$? ac_status=$?
...@@ -5716,6 +5717,18 @@ _ACEOF ...@@ -5716,6 +5717,18 @@ _ACEOF
fi fi
fi; fi;
# Check for gc debugging. This option is handled both here and in the GC.
# Check whether --enable-gc-debug or --disable-gc-debug was given.
if test "${enable_gc_debug+set}" = set; then
enableval="$enable_gc_debug"
if test "$enable_gc_debug" = "yes"; then
cat >>confdefs.h <<\_ACEOF
#define LIBGCJ_GC_DEBUG 1
_ACEOF
fi
fi;
# See if the user has the interpreter included. # See if the user has the interpreter included.
# Check whether --enable-interpreter or --disable-interpreter was given. # Check whether --enable-interpreter or --disable-interpreter was given.
if test "${enable_interpreter+set}" = set; then if test "${enable_interpreter+set}" = set; then
...@@ -5752,7 +5765,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then ...@@ -5752,7 +5765,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then
: :
else else
cat > conftest.$ac_ext << EOF cat > conftest.$ac_ext << EOF
#line 5755 "configure" #line 5768 "configure"
struct S { ~S(); }; struct S { ~S(); };
void bar(); void bar();
void foo() void foo()
......
...@@ -253,6 +253,13 @@ AC_ARG_ENABLE(libgcj-debug, ...@@ -253,6 +253,13 @@ AC_ARG_ENABLE(libgcj-debug,
LIBGCJDEBUG="true" LIBGCJDEBUG="true"
fi]) fi])
# Check for gc debugging. This option is handled both here and in the GC.
AC_ARG_ENABLE(gc-debug,
[ --enable-gc-debug include full support for pointer backtracing etc.],
[ if test "$enable_gc_debug" = "yes"; then
AC_DEFINE(LIBGCJ_GC_DEBUG)
fi])
# See if the user has the interpreter included. # See if the user has the interpreter included.
AC_ARG_ENABLE(interpreter, AC_ARG_ENABLE(interpreter,
AS_HELP_STRING([--enable-interpreter], AS_HELP_STRING([--enable-interpreter],
......
...@@ -35,6 +35,8 @@ extern "C" void * GC_local_gcj_malloc(size_t, void *); ...@@ -35,6 +35,8 @@ extern "C" void * GC_local_gcj_malloc(size_t, void *);
extern "C" void * GC_local_malloc_atomic(size_t); extern "C" void * GC_local_malloc_atomic(size_t);
#endif #endif
#ifndef LIBGCJ_GC_DEBUG
inline void * inline void *
_Jv_AllocObj (jsize size, jclass klass) _Jv_AllocObj (jsize size, jclass klass)
{ {
...@@ -67,6 +69,16 @@ _Jv_AllocPtrFreeObj (jsize size, jclass klass) ...@@ -67,6 +69,16 @@ _Jv_AllocPtrFreeObj (jsize size, jclass klass)
return obj; return obj;
} }
#else /* LIBGCJ_GC_DEBUG */
void *
_Jv_AllocObj (jsize size, jclass klass);
void *
_Jv_AllocPtrFreeObj (jsize size, jclass klass);
#endif /* LIBGCJ_GC_DEBUG */
// _Jv_AllocBytes (jsize size) should go here, too. But clients don't // _Jv_AllocBytes (jsize size) should go here, too. But clients don't
// usually include this header. // usually include this header.
......
...@@ -366,6 +366,9 @@ ...@@ -366,6 +366,9 @@
/* Indicate that linker is not able to 8-byte align static data */ /* Indicate that linker is not able to 8-byte align static data */
#undef JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS #undef JV_LINKER_CANNOT_8BYTE_ALIGN_STATICS
/* Define if we want to use debug calls into the garbage collector. */
#undef LIBGCJ_GC_DEBUG
/* Define if using POSIX threads on Linux. */ /* Define if using POSIX threads on Linux. */
#undef LINUX_THREADS #undef LINUX_THREADS
......
...@@ -286,6 +286,9 @@ _Jv_ObjectCheckMonitor (jobject obj) ...@@ -286,6 +286,9 @@ _Jv_ObjectCheckMonitor (jobject obj)
// operations is already ridiculous, and would become worse if we // operations is already ridiculous, and would become worse if we
// went through the proper intermediaries. // went through the proper intermediaries.
#else #else
# ifdef LIBGCJ_GC_DEBUG
# define GC_DEBUG
# endif
# include "gc.h" # include "gc.h"
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment