1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
/*
Copyright (c) 1998--2006 Benhur Stein
This file is part of Pajé.
Pajé is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
Pajé is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with Pajé; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
*/
//////////////////////////////////////////////////
/* Author: Geovani Ricardo Wiedenhoft */
/* Email: grw@inf.ufsm.br */
//////////////////////////////////////////////////
#ifndef _JRASTRO_BASIC_H_
#define _JRASTRO_BASIC_H_
#define THREAD_LOADER 1234
#define THREAD_MONITOR 4321
#define THREAD_NEW_ARRAY 5678
#define MAX_NAME_THREAD 70
//#define OBJECT_ID(object) (*(int *)object)
#define GET_JVMTI() (gagent->jvmti)
typedef struct {
jvmtiEnv *jvmti;
jrawMonitorID monitor;
jrawMonitorID monitor_thread;
jrawMonitorID monitor_buffer;
jrawMonitorID monitor_new_array;
jrawMonitorID monitor_tag;
}globalAgent;
extern globalAgent *gagent;
extern jvmtiCapabilities capabilities;
extern jvmtiEventCallbacks callbacks;
extern hash_t h_options;
//extern hash_t h;
extern bool traces;
extern bool tracesAll;
extern bool methodsTrace;
extern bool memoryTrace;
extern bool initialized;
extern rst_buffer_t *ptr_loader;
extern rst_buffer_t *ptr_monitor;
extern rst_buffer_t *ptr_new_array;
void jrst_describe_error(jvmtiEnv *jvmtiEnv, jvmtiError error);
void jrst_check_error(jvmtiEnv *jvmtiEnv, jvmtiError error, const char *frase);
void jrst_enter_critical_section(jvmtiEnv *jvmtiEnv, jrawMonitorID monitor);
void jrst_exit_critical_section(jvmtiEnv *jvmtiEnv, jrawMonitorID monitor);
void jrst_get_thread_name(jvmtiEnv *jvmtiLocate, jthread thread, char *name, int numMax);
bool jrst_trace_class(char *className);
bool jrst_trace_methods();
//bool jrst_trace(void *key);
#endif /*_JRASTRO_BASIC_H_*/
|