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"
43 #define MSGQPTRACEREQ 2
44 #define MSGQPTRACEANS 3
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;
74 #if defined(USE_THREADS) && defined(NATIVE_THREADS)
75 struct _jrawMonitorID {
76 java_lang_String *name;
81 threadobject* cacaothreadobj;
85 struct _threadmap* map;
90 struct threadmap thmap;
94 /* constants where system breakpoints are stored in the breakpoint table */
95 #define HEREWEGOBRK 0 /* used for suspend VM on startup */
96 #define SETTHREADOBJECTBRK 1 /* used for EVENT_THREAD_START */
97 #define BEGINUSERBRK 2 /* here is where the first user breakpoint is
103 long orig; /* original memory content */
113 struct brkpts jvmtibrkpt;
115 bool jdwp; /* debugger via jdwp */
116 bool jvmti; /* jvmti agent */
117 bool dbgprocess; /* ture if debugger else debuggee process */
118 pid_t debuggee; /* PID of debuggee */
120 char *transport, *agentarg; /* arguments for jdwp transport and agent load */
121 bool suspend; /* should the virtual machine suspend on startup? */
125 void cacaodbglisten(char* transport);
126 jvmtiEnv* new_jvmtienv();
127 void set_jvmti_phase(jvmtiPhase p);
128 bool contdebuggee(int signal);
130 void fireEvent(genericEventData* data);
131 bool VMjdwpInit(jvmtiEnv *jvmti_env);
132 jvmtiEnv* remotedbgjvmtienv;
133 jvmtiEventCallbacks jvmti_jdwp_EventCallbacks;
134 void agentload(char* opt_arg);
137 void getchildproc (char **ptr, void* addr, int count);
138 void addbrkpt(void* addr, jmethodID method, jlocation location);
139 void setsysbrkpt(int sysbrk, void* addr);
140 jthread threadobject2jthread(threadobject* thread);
141 jvmtiError allthreads (jint * threads_count_ptr, threadobject ** threads_ptr);
142 jthread getcurrentthread();
149 * These are local overrides for various environment variables in Emacs.
150 * Please do not remove this and leave it at the end of the file, where
151 * Emacs will automagically detect them.
152 * ---------------------------------------------------------------------
155 * indent-tabs-mode: t