gcc/libjava/java/lang/natVMThrowable.cc
Gary Benson 8d0941a9c8 prims.cc (_Jv_CreateJavaVM): Move setting runtimeInitialized from the start to the end of the function.
2006-07-28  Gary Benson  <gbenson@redhat.com>

	* prims.cc (_Jv_CreateJavaVM): Move setting runtimeInitialized
	from the start to the end of the function.  Remove references
	to VMThrowable.trace_enabled.
	* java/lang/natVMThrowable.cc (fillInStackTrace): Use
	runtimeInitialized rather than trace_enabled to decide
	whether to inhibit stack trace generation.
	* java/lang/VMThrowable.java (trace_enabled): Removed.

From-SVN: r115791
2006-07-28 07:40:17 +00:00

46 lines
1.1 KiB
C++

// natVMThrowable.cc - Native part of VMThrowable class.
/* Copyright (C) 2003, 2006 Free Software Foundation
This file is part of libgcj.
This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
#include <stdlib.h>
#include <gcj/cni.h>
#include <jvm.h>
#include <java-stack.h>
#include <java/lang/Throwable.h>
#include <java/lang/VMThrowable.h>
using namespace gnu::gcj;
java::lang::VMThrowable *
java::lang::VMThrowable::fillInStackTrace (java::lang::Throwable *)
{
using namespace java::lang;
// Don't trace stack during initialization of the runtime.
if (! gcj::runtimeInitialized)
return NULL;
_Jv_StackTrace *trace = _Jv_StackTrace::GetStackTrace ();
VMThrowable *vmthrowable = new VMThrowable ();
vmthrowable->data = (RawDataManaged *) trace;
return vmthrowable;
}
JArray< ::java::lang::StackTraceElement *> *
java::lang::VMThrowable::getStackTrace (java::lang::Throwable *throwable)
{
_Jv_StackTrace *trace = reinterpret_cast <_Jv_StackTrace *> (data);
return _Jv_StackTrace::GetStackTraceElements (trace, throwable);
}