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
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.
33 _Jv_StackTrace
*trace
= _Jv_StackTrace::GetStackTrace ();
34 VMThrowable
*vmthrowable
= new VMThrowable ();
35 vmthrowable
->data
= (RawDataManaged
*) trace
;
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
);