Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libjava / java / lang / natVMThrowable.cc
blob6db1a1fd56d0a85fb1c4ddc4f3db4507a4f3fbbe
1 // natVMThrowable.cc - Native part of VMThrowable class.
3 /* Copyright (C) 2003 Free Software Foundation
5 This file is part of libgcj.
7 This software is copyrighted work licensed under the terms of the
8 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
9 details. */
11 #include <config.h>
13 #include <stdlib.h>
15 #include <gcj/cni.h>
16 #include <jvm.h>
17 #include <java-stack.h>
19 #include <java/lang/Throwable.h>
20 #include <java/lang/VMThrowable.h>
22 using namespace gnu::gcj;
24 java::lang::VMThrowable *
25 java::lang::VMThrowable::fillInStackTrace (java::lang::Throwable *)
27 using namespace java::lang;
29 // Don't trace stack during initialization of the runtime.
30 if (! trace_enabled)
31 return NULL;
33 _Jv_StackTrace *trace = _Jv_StackTrace::GetStackTrace ();
34 VMThrowable *vmthrowable = new VMThrowable ();
35 vmthrowable->data = (RawDataManaged *) trace;
36 return vmthrowable;
40 JArray< ::java::lang::StackTraceElement *> *
41 java::lang::VMThrowable::getStackTrace (java::lang::Throwable *throwable)
43 _Jv_StackTrace *trace = reinterpret_cast <_Jv_StackTrace *> (data);
44 return _Jv_StackTrace::GetStackTraceElements (trace, throwable);