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
11 #ifndef __JV_STACKTRACE_H__
12 #define __JV_STACKTRACE_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
;
36 struct _Jv_InterpFrameInfo
38 _Jv_InterpMethod
*meth
;
49 _Jv_FrameType type
; /* Native or interpreted. */
52 _Jv_InterpFrameInfo interp
;
56 // _Jv_FrameInfo info; /* Frame-type specific data. */
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
,
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__ */