1 /* src/native/jvmti/cacaodbg.h - contains cacao specifics for debugging support
3 Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Martin Platter
36 #include "threads/native/threads.h"
37 #include "native/jvmti/jvmti.h"
38 #include "native/include/java_lang_String.h"
56 void** new_address_ptr;
57 jmethodID catch_method;
58 jlocation catch_location;
60 jobject protection_domain;
63 unsigned char* class_data;
64 jint* new_class_data_len;
65 unsigned char** new_class_data;
66 jvmtiAddrLocationMap* map;
73 #if defined(ENABLE_THREADS)
74 struct _jrawMonitorID {
75 java_lang_String *name;
82 /* constants where system breakpoints are stored in the breakpoint table */
83 #define SETSYSBRKPT 0 /* used for setsysbrkpt calls */
84 #define CACAODBGSERVERQUIT 1
85 #define NOTHARDCODEDBRK 2 /* here is where the first not hard coded
86 breakpoint is stored */
87 #define THREADSTARTBRK 2
88 #define THREADENDBRK 3
89 #define CLASSLOADBRK 4
90 #define CLASSPREPARERK 5
91 #define CLASSFILELOADHOOKBRK 6
92 #define COMPILEDMETHODLOADBRK 7
93 #define COMPILEDMETHODUNLOADBRK 8
94 #define BEGINUSERBRK 9 /* here is where the first user breakpoint
100 void* addr; /* memory address */
116 struct brkpts jvmtibrkpt;
117 } cacaodbgcommunication;
119 cacaodbgcommunication *dbgcom;
121 bool jvmti; /* jvmti agent */
123 extern pthread_mutex_t dbgcomlock;
125 jvmtiEnv* jvmti_new_environment();
126 void jvmti_set_phase(jvmtiPhase p);
127 void jvmti_fireEvent(genericEventData* data);
128 void jvmti_agentload(char* opt_arg, bool agentbypath,
129 lt_dlhandle *handle, char **libname);
130 void jvmti_agentunload();
131 void jvmti_add_breakpoint(void* addr, jmethodID method, jlocation location);
132 void jvmti_set_system_breakpoint(int sysbrk, bool mode);
133 jvmtiError jvmti_get_all_threads (jint * threads_count_ptr,
134 threadobject *** threads_ptr);
135 jthread jvmti_get_current_thread();
136 void jvmti_cacao_debug_init();
137 void jvmti_cacaodbgserver_quit();
139 void jvmti_ClassLoadPrepare(bool prepared, classinfo *c);
140 void jvmti_ClassFileLoadHook(utf* name, int class_data_len,
141 unsigned char* class_data,
142 java_objectheader* loader,
143 java_objectheader* protection_domain,
144 jint* new_class_data_len,
145 unsigned char** new_class_data);
146 void jvmti_MonitorContendedEntering(bool entered, jobject obj);
147 void jvmti_MonitorWaiting(bool wait, jobject obj, jlong timeout);
148 void jvmti_ThreadStartEnd(jvmtiEvent ev);
149 void jvmti_NativeMethodBind(jmethodID method, void* address,
150 void** new_address_ptr);
154 * These are local overrides for various environment variables in Emacs.
155 * Please do not remove this and leave it at the end of the file, where
156 * Emacs will automagically detect them.
157 * ---------------------------------------------------------------------
160 * indent-tabs-mode: t