OSDN Git Service

* include/jvmti-int.h (_Jv_GetJDWP_JVMTIEnv): Declare.
[pf3gnuchains/gcc-fork.git] / libjava / include / jvmti-int.h
1 /* jvmti-int.h -- Internal JVMTI definitions
2    Copyright (C) 2006, 2007 Free Software Foundation, Inc.
3
4 This file is part of GNU Classpath.
5
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10  
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING.  If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301 USA.
20
21 As a special exception, if you link this library with other files to
22 produce an executable, this library does not by itself cause the
23 resulting executable to be covered by the GNU General Public License.
24 This exception does not however invalidate any other reasons why the
25 executable file might be covered by the GNU General Public License. */
26
27 #ifndef __GCJ_JVTMI_INT_H__
28 #define __GCJ_JVMTI_INT_H__
29
30 /* A macro to map jvmtiEvent to an index in thread[] and enabled[]
31    in the jvmtiEnv. This will only work if the order of events listed
32    in jvmtiEvent and jvmtiEventCallbacks is kept the same (which should
33    not be a problem). */
34 #define EVENT_INDEX(jvmtievent) (int)(jvmtievent - JVMTI_EVENT_VM_INIT)
35
36 /* A few globals to help limit the impact of JVMTI on normal operations.
37    False means no JVMTI environment requested that event type. */
38 namespace JVMTI
39 {
40   extern bool VMInit;
41   extern bool VMDeath;
42   extern bool ThreadStart;
43   extern bool ThreadEnd;
44   extern bool ClassFileLoadHook;
45   extern bool ClassLoad;
46   extern bool ClassPrepare;
47   extern bool VMStart;
48   extern bool Exception;
49   extern bool ExceptionCatch;
50   extern bool SingleStep;
51   extern bool FramePop;
52   extern bool Breakpoint;
53   extern bool FieldAccess;
54   extern bool FieldModification;
55   extern bool MethodEntry;
56   extern bool MethodExit;
57   extern bool NativeMethodBind;
58   extern bool CompiledMethodLoad;
59   extern bool CompiledMethodUnload;
60   extern bool DynamicCodeGenerated;
61   extern bool DataDumpRequest;
62   extern bool reserved72;
63   extern bool MonitorWait;
64   extern bool MonitorWaited;
65   extern bool MonitorContendedEnter;
66   extern bool MonitorContendedEntered;
67   extern bool reserved77;
68   extern bool reserved78;
69   extern bool reserved79;
70   extern bool reserved80;
71   extern bool GarbageCollectionStart;
72   extern bool GarbageCollectionFinish;
73   extern bool ObjectFree;
74   extern bool VMObjectAlloc;
75 };
76
77 /* A macro to test whether an event should be posted to JVMTI.*/
78 #define JVMTI_REQUESTED_EVENT(Event) __builtin_expect (JVMTI::Event, false)
79
80 /* Post the event to requesting JVMTI environments.
81
82    For speed, this function should only be called after 
83    JVMTI_REQUESTED_EVENT is checked. */
84 extern void _Jv_JVMTI_PostEvent (jvmtiEvent type, jthread event_thread,                          ...);
85 // Returns the jvmtiEnv used by the JDWP backend
86 extern jvmtiEnv *_Jv_GetJDWP_JVMTIEnv (void);
87
88 #endif /* __GCJ_JVMTI_INT_H__ */