mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
add some commented-out debug code to defineClass
When uncommented, this code will write each defined class to disk, which allows one to examine e.g. dynamically-generated classes using e.g. javap.
This commit is contained in:
parent
af9288f4ee
commit
60db8cc047
@ -4288,11 +4288,24 @@ defineClass(Thread* t, object loader, const uint8_t* buffer, unsigned length)
|
|||||||
|
|
||||||
object c = parseClass(t, loader, buffer, length);
|
object c = parseClass(t, loader, buffer, length);
|
||||||
|
|
||||||
if (c) {
|
// char name[byteArrayLength(t, className(t, c))];
|
||||||
|
// memcpy(name, &byteArrayBody(t, className(t, c), 0),
|
||||||
|
// byteArrayLength(t, className(t, c)));
|
||||||
|
// replace('/', '-', name);
|
||||||
|
|
||||||
|
// const unsigned BufferSize = 1024;
|
||||||
|
// char path[BufferSize];
|
||||||
|
// snprintf(path, BufferSize, "/tmp/avian-define-class/%s.class", name);
|
||||||
|
|
||||||
|
// FILE* file = fopen(path, "wb");
|
||||||
|
// if (file) {
|
||||||
|
// fwrite(buffer, length, 1, file);
|
||||||
|
// fclose(file);
|
||||||
|
// }
|
||||||
|
|
||||||
PROTECT(t, c);
|
PROTECT(t, c);
|
||||||
|
|
||||||
saveLoadedClass(t, loader, c);
|
saveLoadedClass(t, loader, c);
|
||||||
}
|
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user