Commit a8e94ee8 authored by Julian Kranz's avatar Julian Kranz

get_ip_offset => get_ip

parent 6b137997
......@@ -1332,7 +1332,7 @@ structure C1 = struct
C1Templates.expandHeader path outputName [
C1Templates.mkHook ("init", str (prefix ^ "init")),
C1Templates.mkHook ("set_code", str (prefix ^ "set_code")),
C1Templates.mkHook ("get_ip_offset", str (prefix ^ "get_ip_offset")),
C1Templates.mkHook ("get_ip", str (prefix ^ "get_ip")),
C1Templates.mkHook ("seek", str (prefix ^ "seek")),
(*C1Templates.mkHook ("rseek", str (prefix ^ "rseek")),*)
C1Templates.mkHook ("err_tgt", str (prefix ^ "err_tgt")),
......
......@@ -44,7 +44,7 @@ void
/* Query the offset of the current IP relative to base. */
size_t
@get_ip_offset@
@get_ip@
(state_t s);
/* Set the current code position to this address. */
......@@ -108,8 +108,8 @@ void
#define gdsl_set_code \
@set_code@
#define gdsl_get_ip_offset \
@get_ip_offset@
#define gdsl_get_ip \
@get_ip@
#define gdsl_seek \
@seek@
......
......@@ -34,7 +34,7 @@ public:
/*
* generic
*/
int_t get_ip_offset();
int_t get_ip();
void set_code(unsigned char *buffer, uint64_t size, uint64_t base);
bool seek(int_t ip);
void reset_heap();
......
......@@ -41,11 +41,11 @@ gdsl::gdsl::~gdsl() {
if(gdsl_state) frontend->native().generic.destroy(gdsl_state);
}
int_t gdsl::gdsl::get_ip_offset() {
if(setjmp(*frontend->native().generic.err_tgt(gdsl_state))) throw gdsl_exception("get_ip_offset() failed",
int_t gdsl::gdsl::get_ip() {
if(setjmp(*frontend->native().generic.err_tgt(gdsl_state))) throw gdsl_exception("get_ip() failed",
string(frontend->native().generic.get_error_message(gdsl_state)));
return frontend->native().generic.get_ip_offset(gdsl_state);
return frontend->native().generic.get_ip(gdsl_state);
}
void gdsl::gdsl::set_code(unsigned char *buffer, uint64_t size, uint64_t base) {
......
......@@ -17,7 +17,7 @@ struct _generic {
jmp_buf* function (state_t) err_tgt;
string_t function (state_t, obj_t) merge_rope;
char* function (state_t) get_error_message;
ulong function (state_t) get_ip_offset;
ulong function (state_t) get_ip;
void function (state_t) reset_heap;
void function (state_t) destroy;
};
......
......@@ -26,7 +26,7 @@ struct frontend {
jmp_buf *(*err_tgt)(state_t s);
string_t (*merge_rope)(state_t s, obj_t rope);
char* (*get_error_message)(state_t s);
uint64_t (*get_ip_offset)(state_t s);
uint64_t (*get_ip)(state_t s);
void (*reset_heap)(state_t state);
void (*destroy)(state_t state);
} generic;
......
......@@ -103,7 +103,7 @@ static char gdsl_multiplex_frontend_get(struct frontend *frontend, void *dl) {
ADD_FUNCTION(generic, get_error_message)
ADD_FUNCTION(generic, reset_heap)
ADD_FUNCTION(generic, destroy)
ADD_FUNCTION(generic, get_ip_offset)
ADD_FUNCTION(generic, get_ip)
ADD_FUNCTION(generic, merge_rope)
ADD_FUNCTION(decoder, config_default)
ADD_FUNCTION(decoder, decoder_config)
......
......@@ -26,122 +26,122 @@
}
static jobjectArray get_frontends_with_descs(JNIEnv *env, struct frontend_desc *descs, size_t descs_length) {
jclass Gdsl_ListFrontend = (*env)->FindClass(env, "gdsl/ListFrontend");
jclass Gdsl_ListFrontend = (*env)->FindClass(env, "gdsl/ListFrontend");
jobjectArray jfrontends = (*env)->NewObjectArray(env, descs_length, Gdsl_ListFrontend, (*env)->NewStringUTF(env, ""));
jobjectArray jfrontends = (*env)->NewObjectArray(env, descs_length, Gdsl_ListFrontend, (*env)->NewStringUTF(env, ""));
for(size_t i = 0; i < descs_length; ++i) {
jstring name = (*env)->NewStringUTF(env, descs[i].name);
jstring ext = (*env)->NewStringUTF(env, descs[i].ext);
for(size_t i = 0; i < descs_length; ++i) {
jstring name = (*env)->NewStringUTF(env, descs[i].name);
jstring ext = (*env)->NewStringUTF(env, descs[i].ext);
jmethodID cons = (*env)->GetMethodID(env, Gdsl_ListFrontend, "<init>", "(Ljava/lang/String;Ljava/lang/String;)V");
jobject frontend = (*env)->NewObject(env, Gdsl_ListFrontend, cons, name, ext);
jmethodID cons = (*env)->GetMethodID(env, Gdsl_ListFrontend, "<init>", "(Ljava/lang/String;Ljava/lang/String;)V");
jobject frontend = (*env)->NewObject(env, Gdsl_ListFrontend, cons, name, ext);
(*env)->SetObjectArrayElement(env, jfrontends, i, frontend);
}
(*env)->SetObjectArrayElement(env, jfrontends, i, frontend);
}
gdsl_multiplex_descs_free(descs, descs_length);
gdsl_multiplex_descs_free(descs, descs_length);
return jfrontends;
return jfrontends;
}
JNIEXPORT jobjectArray JNICALL Java_gdsl_Gdsl_getFrontendsNative(JNIEnv *env, jclass cls) {
struct frontend_desc *descs = NULL;
size_t descs_length = gdsl_multiplex_frontends_list(&descs);
struct frontend_desc *descs = NULL;
size_t descs_length = gdsl_multiplex_frontends_list(&descs);
return get_frontends_with_descs(env, descs, descs_length);
return get_frontends_with_descs(env, descs, descs_length);
}
JNIEXPORT jobjectArray JNICALL Java_gdsl_Gdsl_getFrontendsNativeWithBase(JNIEnv *env, jclass cls, jstring jbase) {
const char *base = (*env)->GetStringUTFChars(env, jbase, 0);
struct frontend_desc *descs = NULL;
size_t descs_length = gdsl_multiplex_frontends_list_with_base(&descs, base);
jobjectArray result = get_frontends_with_descs(env, descs, descs_length);
(*env)->ReleaseStringUTFChars(env, jbase, base);
return result;
const char *base = (*env)->GetStringUTFChars(env, jbase, 0);
struct frontend_desc *descs = NULL;
size_t descs_length = gdsl_multiplex_frontends_list_with_base(&descs, base);
jobjectArray result = get_frontends_with_descs(env, descs, descs_length);
(*env)->ReleaseStringUTFChars(env, jbase, base);
return result;
}
JNIEXPORT jlong JNICALL Java_gdsl_Gdsl_init(JNIEnv *env, jobject this, jlong frontendPtr) {
struct frontend *frontend = (struct frontend*)frontendPtr;
struct frontend *frontend = (struct frontend*)frontendPtr;
return (jlong)frontend->generic.init();
return (jlong)frontend->generic.init();
}
JNIEXPORT void JNICALL Java_gdsl_Gdsl_setCode(JNIEnv *env, jobject this, jlong frontendPtr, jlong gdslStatePtr,
jobject byteBuffer, jlong offset, jlong base) {
jclass java_Nio_ByteBuffer = (*env)->FindClass(env, "java/nio/ByteBuffer");
jmethodID capacity = (*env)->GetMethodID(env, java_Nio_ByteBuffer, "capacity", "()I");
jobject byteBuffer, jlong offset, jlong base) {
jclass java_Nio_ByteBuffer = (*env)->FindClass(env, "java/nio/ByteBuffer");
jmethodID capacity = (*env)->GetMethodID(env, java_Nio_ByteBuffer, "capacity", "()I");
jint size = (*env)->CallIntMethod(env, byteBuffer, capacity);
jbyte *buffer = (*env)->GetDirectBufferAddress(env, byteBuffer);
jint size = (*env)->CallIntMethod(env, byteBuffer, capacity);
jbyte *buffer = (*env)->GetDirectBufferAddress(env, byteBuffer);
struct frontend *frontend = (struct frontend*)frontendPtr;
state_t state = (state_t)gdslStatePtr;
struct frontend *frontend = (struct frontend*)frontendPtr;
state_t state = (state_t)gdslStatePtr;
if(setjmp(*frontend->generic.err_tgt(state)))
THROW_GDSL_ERROR()
if(setjmp(*frontend->generic.err_tgt(state)))
THROW_GDSL_ERROR()
frontend->generic.set_code(state, (unsigned char*)(buffer + offset), (uint64_t)(size - offset), (uint64_t)base);
frontend->generic.set_code(state, (unsigned char*)(buffer + offset), (uint64_t)(size - offset), (uint64_t)base);
}
static obj_t decode_one(JNIEnv *env, jobject this, jlong frontendPtr, jlong gdslStatePtr, int_t decode_config) {
struct frontend *frontend = (struct frontend*)frontendPtr;
state_t state = (state_t)gdslStatePtr;
struct frontend *frontend = (struct frontend*)frontendPtr;
state_t state = (state_t)gdslStatePtr;
if(setjmp(*frontend->generic.err_tgt(state))) {
jclass exp = (*env)->FindClass(env, "gdsl/decoder/GdslDecodeException");
(*env)->ThrowNew(env, exp, "Decode failed");
return 0;
}
if(setjmp(*frontend->generic.err_tgt(state))) {
jclass exp = (*env)->FindClass(env, "gdsl/decoder/GdslDecodeException");
(*env)->ThrowNew(env, exp, "Decode failed");
return 0;
}
obj_t insn = frontend->decoder.decode(state, decode_config);
return insn;
obj_t insn = frontend->decoder.decode(state, decode_config);
return insn;
}
JNIEXPORT jlong JNICALL Java_gdsl_Gdsl_decodeOne(JNIEnv *env, jobject this, jlong frontendPtr, jlong gdslStatePtr) {
struct frontend *frontend = (struct frontend*)frontendPtr;
state_t state = (state_t)gdslStatePtr;
struct frontend *frontend = (struct frontend*)frontendPtr;
state_t state = (state_t)gdslStatePtr;
return (jlong)decode_one(env, this, frontendPtr, gdslStatePtr, frontend->decoder.config_default(state));
return (jlong)decode_one(env, this, frontendPtr, gdslStatePtr, frontend->decoder.config_default(state));
}
JNIEXPORT jlong JNICALL Java_gdsl_Gdsl_decodeOneWithConfig(JNIEnv *env, jobject this, jlong frontendPtr,
jlong gdslStatePtr, jlong decodeConfig) {
return (jlong)decode_one(env, this, frontendPtr, gdslStatePtr, decodeConfig);
jlong gdslStatePtr, jlong decodeConfig) {
return (jlong)decode_one(env, this, frontendPtr, gdslStatePtr, decodeConfig);
}
JNIEXPORT jlong JNICALL Java_gdsl_Gdsl_getIpOffset(JNIEnv *env, jobject this, jlong frontendPtr, jlong gdslStatePtr) {
struct frontend *frontend = (struct frontend*)frontendPtr;
state_t state = (state_t)gdslStatePtr;
struct frontend *frontend = (struct frontend*)frontendPtr;
state_t state = (state_t)gdslStatePtr;
if(setjmp(*frontend->generic.err_tgt(state)))
THROW_GDSL_ERROR(0)
if(setjmp(*frontend->generic.err_tgt(state)))
THROW_GDSL_ERROR(0)
return (jlong)frontend->generic.get_ip_offset(state);
return (jlong)frontend->generic.get_ip(state);
}
JNIEXPORT void JNICALL Java_gdsl_Gdsl_resetHeap(JNIEnv *env, jobject this, jlong frontendPtr, jlong gdslStatePtr) {
struct frontend *frontend = (struct frontend*)frontendPtr;
state_t state = (state_t)gdslStatePtr;
struct frontend *frontend = (struct frontend*)frontendPtr;
state_t state = (state_t)gdslStatePtr;
// printf("Resetting heap...\n");
// fflush(stdout);
if(setjmp(*frontend->generic.err_tgt(state)))
THROW_GDSL_ERROR()
if(setjmp(*frontend->generic.err_tgt(state)))
THROW_GDSL_ERROR()
frontend->generic.reset_heap(state);
frontend->generic.reset_heap(state);
}
JNIEXPORT void JNICALL Java_gdsl_Gdsl_destroy(JNIEnv *env, jobject this, jlong frontendPtr, jlong gdslStatePtr) {
struct frontend *frontend = (struct frontend*)frontendPtr;
state_t state = (state_t)gdslStatePtr;
struct frontend *frontend = (struct frontend*)frontendPtr;
state_t state = (state_t)gdslStatePtr;
// printf("Destroying Gdsl...\n");
// fflush(stdout);
if(setjmp(*frontend->generic.err_tgt(state)))
THROW_GDSL_ERROR()
if(setjmp(*frontend->generic.err_tgt(state)))
THROW_GDSL_ERROR()
frontend->generic.destroy(state);
frontend->generic.destroy(state);
}
......@@ -361,7 +361,7 @@ struct tester_result tester_test_binary(void (*name)(char *), char fork_, uint8_
printf("\n");
fflush(stdout);
data_size = gdsl_get_ip_offset(state);
data_size = gdsl_get_ip(state);
features = gdsl_features_get(state, insn);
printf("[");
......
......@@ -80,7 +80,7 @@ void semantics_instr(char* input, unsigned int in_size, char** output, unsigned
obj_t insn = gdsl_decode(state, gdsl_config_default(state));
#endif
gdsl_get_ip_offset(state);
gdsl_get_ip(state);
string_t fmt = gdsl_merge_rope(state, gdsl_pretty(state, insn)); /* string_t is a typedef for char* */
......@@ -162,7 +162,7 @@ void semantics_multi_opt(char* input, unsigned int in_size, char** output, unsig
*out_size = *out_size + strlen(fmt);
strncat(*output, fmt, strlen(fmt));
gdsl_reset_heap(state);
last_offset = gdsl_get_ip_offset(state);
last_offset = gdsl_get_ip(state);
}
cleanup:
......@@ -226,7 +226,7 @@ void semantics_multi(char* input, unsigned int in_size, char** output, unsigned
*out_size = *out_size + strlen(fmt);
strncat(*output, fmt, strlen(fmt));
gdsl_reset_heap(state);
last_offset = gdsl_get_ip_offset(state);
last_offset = gdsl_get_ip(state);
}
cleanup:
......
......@@ -58,7 +58,7 @@ int main(int argc, char** argv) {
obj_t insn = gdsl_decode(state, config);
printf("[");
size_t decoded = gdsl_get_ip_offset(state);
size_t decoded = gdsl_get_ip(state);
for(size_t i = 0; i < decoded; ++i) {
if(i) printf(" ");
printf("%02x", buffer[i]);
......
......@@ -459,7 +459,7 @@ char analyze(char *file, char print, enum mode mode, char cleanup, size_t file_o
// context->lines_opt++;
//consumed += __getBlobIndex(state) - consumed;
consumed = gdsl_get_ip_offset(state);
consumed = gdsl_get_ip(state);
size_t residency = gdsl_heap_residency(state);
context->memory_cum += residency;
......
......@@ -59,7 +59,7 @@ int main(int argc, char** argv) {
obj_t insn = frontend.decoder.decode(state, frontend.decoder.config_default(state));
printf("[");
size_t decoded = frontend.generic.get_ip_offset(state);
size_t decoded = frontend.generic.get_ip(state);
for(size_t i = 0; i < decoded; ++i) {
if(i) printf(" ");
printf("%02x", buffer[i]);
......
......@@ -57,7 +57,7 @@ int main(int argc, char** argv) {
obj_t insn = gdsl_decode(state, config);
printf("[");
size_t decoded = gdsl_get_ip_offset(state);
size_t decoded = gdsl_get_ip(state);
for(size_t i = 0; i < decoded; ++i) {
if(i) printf(" ");
printf("%02x", buffer[i]);
......
......@@ -147,7 +147,7 @@ int main(int argc, char** argv) {
gdsl_reset_heap(state);
last_offset = gdsl_get_ip_offset(state);
last_offset = gdsl_get_ip(state);
}
gdsl_destroy(state);
......
......@@ -172,7 +172,7 @@ int main(int argc, char** argv) {
obj_t insn = gdsl_decode(state, gdsl_config_default(state));
printf("[");
size_t decoded = gdsl_get_ip_offset(state) - last_offset;
size_t decoded = gdsl_get_ip(state) - last_offset;
for(size_t i = 0; i < decoded; ++i) {
if(i) printf(" ");
printf("%02x", buffer[last_offset + i]);
......@@ -206,7 +206,7 @@ int main(int argc, char** argv) {
gdsl_reset_heap(state);
instructions++;
last_offset = gdsl_get_ip_offset(state);
last_offset = gdsl_get_ip(state);
}
clock_gettime(CLOCK_REALTIME, &end);
......
......@@ -10,152 +10,148 @@
#define NANOS 1000000000LL
struct decode_result {
unsigned int decoded;
unsigned int invalid;
size_t memory;
size_t memory_max;
unsigned int decoded;
unsigned int invalid;
size_t memory;
size_t memory_max;
long time;
long time;
};
static void hexprint(unsigned char *buffer, size_t size_max) {
printf("[");
for (size_t i = 0; i < size_max && i < 20; ++i)
printf("%02x ", buffer[i]);
printf("...]");
printf("[");
for(size_t i = 0; i < size_max && i < 20; ++i)
printf("%02x ", buffer[i]);
printf("...]");
}
static struct decode_result xed_decode_blob(unsigned char *blob, size_t size) {
struct decode_result result;
memset(&result, 0, sizeof(result));
struct decode_result result;
memset(&result, 0, sizeof(result));
struct timespec start;
struct timespec end;
struct timespec start;
struct timespec end;
xed_state_t state;
xed_state_zero(&state);
state.mmode = XED_MACHINE_MODE_LONG_64;
// state.stack_addr_width = XED_ADDRESS_WIDTH_32b;
xed_state_t state;
xed_state_zero(&state);
state.mmode = XED_MACHINE_MODE_LONG_64;
// state.stack_addr_width = XED_ADDRESS_WIDTH_32b;
xed_decoded_inst_t insn;
xed_decoded_inst_t insn;
xed_tables_init();
xed_tables_init();
// xed_decode_init();
char insnstr[128];
unsigned int len;
unsigned char* blobb = blob;
xed_error_enum_t r;
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &start);
do {
xed_decoded_inst_zero_set_mode(&insn, &state);
xed_decoded_inst_set_input_chip(&insn, XED_CHIP_INVALID);
r = xed_decode(&insn, blobb, size > 15 ? 15 : size);
if(r == XED_ERROR_NONE) {
len = xed_decoded_inst_get_length(&insn);
xed_decoded_inst_dump_intel_format(&insn, insnstr, 128, 0);
char insnstr[128];
unsigned int len;
unsigned char* blobb = blob;
xed_error_enum_t r;
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &start);
do {
xed_decoded_inst_zero_set_mode(&insn, &state);
xed_decoded_inst_set_input_chip(&insn, XED_CHIP_INVALID);
r = xed_decode(&insn, blobb, size > 15 ? 15 : size);
if(r == XED_ERROR_NONE) {
len = xed_decoded_inst_get_length(&insn);
xed_decoded_inst_dump_intel_format(&insn, insnstr, 128, 0);
// printf("%c\n", insnstr[0]);
//printf("%-27s\n", insnstr);
//printf("%-27s\n", insnstr);
// puts(insnstr);
} else {
} else {
// printf("{XED}/%02d Unable to decode instruction: ", r);
// hexprint(blobb, size);
// printf("\n");
result.invalid++;
len = 1;
}
blobb += len;
size -= len;
result.decoded++;
} while(len > 0 && size > 0);
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &end);
result.time = end.tv_sec * NANOS + end.tv_nsec - start.tv_nsec - start.tv_sec * NANOS;
return result;
result.invalid++;
len = 1;
}
blobb += len;
size -= len;
result.decoded++;
} while(len > 0 && size > 0);
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &end);
result.time = end.tv_sec * NANOS + end.tv_nsec - start.tv_nsec - start.tv_sec * NANOS;
return result;
}
static struct decode_result gdsl_decode_blob(unsigned char *blob, size_t size) {
struct decode_result result;
memset(&result, 0, sizeof(result));
struct decode_result result;
memset(&result, 0, sizeof(result));
struct timespec start;
struct timespec end;
struct timespec start;
struct timespec end;
state_t state = gdsl_init();
gdsl_set_code(state, (char*)blob, size, 0);
state_t state = gdsl_init();
gdsl_set_code(state, (char*)blob, size, 0);
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &start);
while(1) {
if(setjmp(*gdsl_err_tgt(state))) {
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &start);
while(1) {
if(setjmp(*gdsl_err_tgt(state))) {
// fprintf(stderr, "decode failed: %s\n", gdsl_get_error_message(state));
// fprintf(stderr, "GDSL - FATAL: Invalid instruction, breaking...\n");
if(gdsl_seek(state, gdsl_get_ip_offset(state) + 1))
break;
else
result.invalid++;
}
if(gdsl_seek(state, gdsl_get_ip(state) + 1)) break;
else result.invalid++;
}
// obj_t insn = gdsl_decode(state, gdsl_config_mode64(state) | gdsl_config_default_opnd_sz_32(state));
obj_t insn = gdsl_decode(state, gdsl_config_default(state));
obj_t insn = gdsl_decode(state, gdsl_config_default(state));
string_t fmt = gdsl_merge_rope(state, gdsl_pretty(state, insn));
string_t fmt = gdsl_merge_rope(state, gdsl_pretty(state, insn));
// printf("%c\n", fmt[0]);
// puts(fmt);
size_t residency = gdsl_heap_residency(state);
result.memory += residency;
if(residency > result.memory_max)
result.memory_max = residency;
size_t residency = gdsl_heap_residency(state);
result.memory += residency;
if(residency > result.memory_max) result.memory_max = residency;
gdsl_reset_heap(state);
gdsl_reset_heap(state);
result.decoded++;
}
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &end);
result.decoded++;
}
clock_gettime(CLOCK_THREAD_CPUTIME_ID, &end);
gdsl_destroy(state);
gdsl_destroy(state);
result.time = end.tv_sec * NANOS + end.tv_nsec - start.tv_nsec - start.tv_sec * NANOS;
result.time = end.tv_sec * NANOS + end.tv_nsec - start.tv_nsec - start.tv_sec * NANOS;
return result;
return result;
}
int main(int argc, char** argv) {
if(argc < 2)
exit(1);
const char* fn = argv[1];
if(argc < 2) exit(1);
const char* fn = argv[1];
fprintf(stderr, "file is %s\n", fn);
fprintf(stderr, "file is %s\n", fn);
bfd_init();
bfd* bfd = bfd_openr(fn, NULL);
if(bfd == NULL)
exit(1);
bfd_init();
bfd* bfd = bfd_openr(fn, NULL);
if(bfd == NULL) exit(1);
if(!bfd_check_format(bfd, bfd_object))
exit(1);
if(!bfd_check_format(bfd, bfd_object)) exit(1);
asection* s = bfd_get_section_by_name(bfd, ".text");
if(s == NULL)
exit(1);
asection* s = bfd_get_section_by_name(bfd, ".text");
if(s == NULL) exit(1);
unsigned char* blob;
bfd_size_type sz = s->size;
fprintf(stderr, ".text is %zu bytes\n", sz);
unsigned char* blob;
bfd_size_type sz = s->size;
fprintf(stderr, ".text is %zu bytes\n", sz);
if(!bfd_malloc_and_get_section(bfd, s, &blob))
exit(1);
if(!bfd_malloc_and_get_section(bfd, s, &blob)) exit(1);
struct decode_result xed_result = xed_decode_blob(blob, sz);
struct decode_result xed_result = xed_decode_blob(blob, sz);
printf("------------------------- $$\n");
printf("------------------------- $$\n");
struct decode_result gdsl_result = gdsl_decode_blob(blob, sz);
struct decode_result gdsl_result = gdsl_decode_blob(blob, sz);
fprintf(stderr, "XED: Decoded %u opcode sequences (%u invalid/unknown); time: %lf seconds; memory: %zu bytes, maximal memory: %zu bytes\n", xed_result.decoded,
xed_result.invalid, xed_result.time / (double)(1000000000), xed_result.memory, xed_result.memory_max);
fprintf(stderr, "GDSL: Decoded %u opcode sequences (%u invalid/unknown); time: %lf seconds; memory: %zu bytes, maximal memory: %zu bytes\n", gdsl_result.decoded,
gdsl_result.invalid, gdsl_result.time / (double)(1000000000), gdsl_result.memory, gdsl_result.memory_max);
fprintf(stderr,
"XED: Decoded %u opcode sequences (%u invalid/unknown); time: %lf seconds; memory: %zu bytes, maximal memory: %zu bytes\n",
xed_result.decoded, xed_result.invalid, xed_result.time / (double)(1000000000), xed_result.memory,
xed_result.memory_max);
fprintf(stderr,
"GDSL: Decoded %u opcode sequences (%u invalid/unknown); time: %lf seconds; memory: %zu bytes, maximal memory: %zu bytes\n",
gdsl_result.decoded, gdsl_result.invalid, gdsl_result.time / (double)(1000000000), gdsl_result.memory,
gdsl_result.memory_max);
return (0);
return (0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment