* config/sparc/sparc.md (save_register_windowdi): Add missing mode.
[official-gcc.git] / libjava / include / java-stack.h
blob6c3103ce05682d0eed6f003dadfed5bb18f58288
1 // java-stack.h - Definitions for unwinding & inspecting the call stack.
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 #ifndef __JV_STACKTRACE_H__
12 #define __JV_STACKTRACE_H__
14 #include <unwind.h>
16 #include <gcj/cni.h>
17 #include <gcj/javaprims.h>
19 #include <java-interp.h>
21 #include <java/lang/Class.h>
22 #include <java/lang/StackTraceElement.h>
23 #include <java/lang/Throwable.h>
25 #include <gnu/gcj/runtime/NameFinder.h>
27 using namespace gnu::gcj::runtime;
29 enum _Jv_FrameType
31 frame_native,
32 frame_interpreter
35 #ifdef INTERPRETER
36 struct _Jv_InterpFrameInfo
38 _Jv_InterpMethod *meth;
39 pc_t pc;
41 #endif
43 union _Jv_FrameInfo
47 struct _Jv_StackFrame
49 _Jv_FrameType type; /* Native or interpreted. */
50 union {
51 #ifdef INTERPRETER
52 _Jv_InterpFrameInfo interp;
53 #endif
54 void *ip;
56 // _Jv_FrameInfo info; /* Frame-type specific data. */
57 jclass klass;
58 _Jv_Method *meth;
61 class _Jv_StackTrace
63 private:
64 int length;
65 _Jv_StackFrame frames[];
67 static void UpdateNCodeMap ();
68 static jclass ClassForIP (void *ip, void **ncode);
69 static void FillInFrameInfo (_Jv_StackFrame *frame);
70 static void getLineNumberForFrame(_Jv_StackFrame *frame, NameFinder *finder,
71 jstring *sourceFileName, jint *lineNum);
73 static _Unwind_Reason_Code UnwindTraceFn (struct _Unwind_Context *context,
74 void *state_ptr);
76 public:
77 static _Jv_StackTrace *GetStackTrace (void);
78 static JArray< ::java::lang::StackTraceElement *>*
79 GetStackTraceElements (_Jv_StackTrace *trace,
80 java::lang::Throwable *throwable);
81 static jclass GetCallingClass (void);
84 #endif /* __JV_STACKTRACE_H__ */