forked from RedlineResearch/elephant-tracks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExternalClassInstrumenter.h
More file actions
65 lines (53 loc) · 2.08 KB
/
Copy pathExternalClassInstrumenter.h
File metadata and controls
65 lines (53 loc) · 2.08 KB
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
#ifndef EXTERNALCLASSINSTRUMENTER_H_
#define EXTERNALCLASSINSTRUMENTER_H_
#include "ClassInstrumenter.h"
#include "ETCallBackHandler.h"
#include <jni.h>
#include <jvmti.h>
using namespace std;
#include <string>
#include <map>
class ExternalClassInstrumenter : public ClassInstrumenter {
public:
ExternalClassInstrumenter (jvmtiEnv *jvmti, string javapath, string classpath, string mainclass,
string outputFile, bool verbose, string experimental,
map<string,string> optionMap, ETCallBackHandler *etcb);
virtual ~ExternalClassInstrumenter ();
virtual void instrumentClass (jvmtiEnv *jvmti,
JNIEnv* env,
jclass class_being_redefined,
jobject loader,
const char* name,
jobject protection_domain,
jint class_data_len,
const unsigned char* class_data,
jint* new_class_data_len,
unsigned char** new_class_data);
virtual void sendInfo (jvmtiEnv *jvmti, JNIEnv *jni, SendKind kind, const char *line);
private:
string javapath;
string classpath;
string mainclass;
string experimental;
map<string,string> optionMap;
void writeUntilDone (SendKind kind, int fd, const unsigned char* buffer, int length);
unsigned char *readUntilDone (jvmtiEnv *jvmti, int fd, RecvKind &kind, int &length);
unsigned char readByte (int fd);
void writeByte (unsigned char b, int fd);
unsigned int readShort (int fd);
unsigned int readSize (int fd);
void writeSize (unsigned int size, int fd);
void readFully (int fd, unsigned char * buffer, int length);
void writeFully (int fd, const unsigned char * buffer, int length);
jrawMonitorID lock;
int childPid;
int parentToChild[2];
int childToParent[2];
ETCallBackHandler *etcb;
};
#endif /*EXTERNALCLASSINSTRUMENTER_H_*/
// Local Variables:
// mode:C++
// c-basic-offset:2
// indent-tabs-mode:nil
// End: