mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +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
@ -4287,12 +4287,25 @@ defineClass(Thread* t, object loader, const uint8_t* buffer, unsigned length)
|
||||
PROTECT(t, loader);
|
||||
|
||||
object c = parseClass(t, loader, buffer, length);
|
||||
|
||||
// char name[byteArrayLength(t, className(t, c))];
|
||||
// memcpy(name, &byteArrayBody(t, className(t, c), 0),
|
||||
// byteArrayLength(t, className(t, c)));
|
||||
// replace('/', '-', name);
|
||||
|
||||
if (c) {
|
||||
PROTECT(t, c);
|
||||
// const unsigned BufferSize = 1024;
|
||||
// char path[BufferSize];
|
||||
// snprintf(path, BufferSize, "/tmp/avian-define-class/%s.class", name);
|
||||
|
||||
saveLoadedClass(t, loader, c);
|
||||
}
|
||||
// FILE* file = fopen(path, "wb");
|
||||
// if (file) {
|
||||
// fwrite(buffer, length, 1, file);
|
||||
// fclose(file);
|
||||
// }
|
||||
|
||||
PROTECT(t, c);
|
||||
|
||||
saveLoadedClass(t, loader, c);
|
||||
|
||||
return c;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user