1 /* src/native/jvmti/cacaodbg.h - contains cacao specifics for debugging support
3 Copyright (C) 1996-2005, 2006, 2008
4 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
6 This file is part of CACAO.
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2, or (at
11 your option) any later version.
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
28 #include "threads/mutex.h"
29 #include "threads/thread.hpp"
30 #include "native/jvmti/jvmti.h"
31 #include "native/include/java_lang_String.h"
49 void** new_address_ptr;
50 jmethodID catch_method;
51 jlocation catch_location;
53 jobject protection_domain;
56 unsigned char* class_data;
57 jint* new_class_data_len;
58 unsigned char** new_class_data;
59 jvmtiAddrLocationMap* map;
66 #if defined(ENABLE_THREADS)
67 struct _jrawMonitorID {
68 java_lang_String *name;
75 /* constants where system breakpoints are stored in the breakpoint table */
76 #define SETSYSBRKPT 0 /* used for setsysbrkpt calls */
77 #define CACAODBGSERVERQUIT 1
78 #define NOTHARDCODEDBRK 2 /* here is where the first not hard coded
79 breakpoint is stored */
80 #define THREADSTARTBRK 2
81 #define THREADENDBRK 3
82 #define CLASSLOADBRK 4
83 #define CLASSPREPARERK 5
84 #define CLASSFILELOADHOOKBRK 6
85 #define COMPILEDMETHODLOADBRK 7
86 #define COMPILEDMETHODUNLOADBRK 8
87 #define BEGINUSERBRK 9 /* here is where the first user breakpoint
93 void* addr; /* memory address */
109 struct brkpts jvmtibrkpt;
110 } cacaodbgcommunication;
112 cacaodbgcommunication *dbgcom;
114 bool jvmti; /* jvmti agent */
116 extern mutex_t dbgcomlock;
118 jvmtiEnv* jvmti_new_environment();
119 void jvmti_set_phase(jvmtiPhase p);
120 void jvmti_fireEvent(genericEventData* data);
121 void jvmti_agentload(char* opt_arg, bool agentbypath,
122 lt_dlhandle *handle, char **libname);
123 void jvmti_agentunload();
124 void jvmti_add_breakpoint(void* addr, jmethodID method, jlocation location);
125 void jvmti_set_system_breakpoint(int sysbrk, bool mode);
126 jvmtiError jvmti_get_all_threads (jint * threads_count_ptr,
127 threadobject *** threads_ptr);
128 jthread jvmti_get_current_thread();
129 void jvmti_cacao_debug_init();
130 void jvmti_cacaodbgserver_quit();
132 void jvmti_ClassLoadPrepare(bool prepared, classinfo *c);
133 void jvmti_ClassFileLoadHook(utf* name, int class_data_len,
134 unsigned char* class_data,
135 java_objectheader* loader,
136 java_objectheader* protection_domain,
137 jint* new_class_data_len,
138 unsigned char** new_class_data);
139 void jvmti_MonitorContendedEntering(bool entered, jobject obj);
140 void jvmti_MonitorWaiting(bool wait, jobject obj, jlong timeout);
141 void jvmti_ThreadStartEnd(jvmtiEvent ev);
142 void jvmti_NativeMethodBind(jmethodID method, void* address,
143 void** new_address_ptr);
147 * These are local overrides for various environment variables in Emacs.
148 * Please do not remove this and leave it at the end of the file, where
149 * Emacs will automagically detect them.
150 * ---------------------------------------------------------------------
153 * indent-tabs-mode: t