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
32 $Id: cacao.c,v 3.165 2006/01/03 23:44:38 twisti Exp $
39 #include "threads/native/threads.h"
40 #include "native/jvmti/jvmti.h"
41 #include "native/include/java_lang_String.h"
59 void** new_address_ptr;
60 jmethodID catch_method;
61 jlocation catch_location;
63 jobject protection_domain;
66 unsigned char* class_data;
67 jint* new_class_data_len;
68 unsigned char** new_class_data;
69 jvmtiAddrLocationMap* map;
76 #if defined(ENABLE_THREADS)
77 struct _jrawMonitorID {
78 java_lang_String *name;
85 /* constants where system breakpoints are stored in the breakpoint table */
86 #define SETSYSBRKPT 0 /* used for setsysbrkpt calls */
87 #define CACAODBGSERVERQUIT 1
88 #define NOTHARDCODEDBRK 2 /* here is where the first not hard coded
89 breakpoint is stored */
90 #define THREADSTARTBRK 2
91 #define THREADENDBRK 3
92 #define CLASSLOADBRK 4
93 #define CLASSPREPARERK 5
94 #define CLASSFILELOADHOOKBRK 6
95 #define COMPILEDMETHODLOADBRK 7
96 #define COMPILEDMETHODUNLOADBRK 8
97 #define BEGINUSERBRK 9 /* here is where the first user breakpoint
103 void* addr; /* memory address */
119 struct brkpts jvmtibrkpt;
120 } cacaodbgcommunication;
122 cacaodbgcommunication *dbgcom;
124 bool jvmti; /* jvmti agent */
126 extern pthread_mutex_t dbgcomlock;
128 jvmtiEnv* jvmti_new_environment();
129 void jvmti_set_phase(jvmtiPhase p);
130 void jvmti_fireEvent(genericEventData* data);
131 void jvmti_agentload(char* opt_arg, bool agentbypath,
132 lt_dlhandle *handle, char **libname);
133 void jvmti_agentunload();
134 void jvmti_add_breakpoint(void* addr, jmethodID method, jlocation location);
135 void jvmti_set_system_breakpoint(int sysbrk, bool mode);
136 jvmtiError jvmti_get_all_threads (jint * threads_count_ptr,
137 threadobject *** threads_ptr);
138 jthread jvmti_get_current_thread();
139 void jvmti_cacao_debug_init();
140 void jvmti_cacaodbgserver_quit();
142 void jvmti_ClassLoadPrepare(bool prepared, classinfo *c);
143 void jvmti_ClassFileLoadHook(utf* name, int class_data_len,
144 unsigned char* class_data,
145 java_objectheader* loader,
146 java_objectheader* protection_domain,
147 jint* new_class_data_len,
148 unsigned char** new_class_data);
149 void jvmti_MonitorContendedEntering(bool entered, jobject obj);
150 void jvmti_MonitorWaiting(bool wait, jobject obj, jlong timeout);
151 void jvmti_ThreadStartEnd(jvmtiEvent ev);
152 void jvmti_NativeMethodBind(jmethodID method, void* address,
153 void** new_address_ptr);
157 * These are local overrides for various environment variables in Emacs.
158 * Please do not remove this and leave it at the end of the file, where
159 * Emacs will automagically detect them.
160 * ---------------------------------------------------------------------
163 * indent-tabs-mode: t