DR_EXPORT void dr_init(client_id_t id) { drsys_options_t ops = { sizeof(ops), 0, }; drmgr_init(); if (drsys_init(id, &ops) != DRMF_SUCCESS) ASSERT(false, "drsys failed to init"); dr_register_exit_event(exit_event); dr_register_filter_syscall_event(event_filter_syscall); drmgr_register_pre_syscall_event(event_pre_syscall); drmgr_register_post_syscall_event(event_post_syscall); if (drsys_filter_all_syscalls() != DRMF_SUCCESS) ASSERT(false, "drsys_filter_all_syscalls should never fail"); test_static_queries(); test_static_iterator(); /* XXX: it would be nice to do deeper tests: * + drsys_filter_syscall() and have an app that makes both filtered * and unfiltered syscalls * + have app make specific syscall w/ specific args and ensure * they match up */ }
DR_EXPORT void dr_init(client_id_t id) { drsys_options_t ops = { sizeof(ops), 0, }; drmgr_init(); if (drsys_init(id, &ops) != DRMF_SUCCESS) ASSERT(false, "drsys failed to init"); dr_register_exit_event(exit_event); dr_register_filter_syscall_event(event_filter_syscall); drmgr_register_pre_syscall_event(event_pre_syscall); drmgr_register_post_syscall_event(event_post_syscall); if (drsys_filter_all_syscalls() != DRMF_SUCCESS) ASSERT(false, "drsys_filter_all_syscalls should never fail"); }
DR_EXPORT void dr_init(client_id_t id) { uint i = 0; uint const_arrays_num; drsys_options_t ops = { sizeof(ops), 0, }; dr_set_client_name("Dr. STrace", "http://drmemory.org/issues"); #ifdef WINDOWS dr_enable_console_printing(); #endif options_init(id); drsym_init(0); drmgr_init(); drx_init(); if (drsys_init(id, &ops) != DRMF_SUCCESS) ASSERT(false, "drsys failed to init"); dr_register_exit_event(exit_event); dr_register_filter_syscall_event(event_filter_syscall); drmgr_register_pre_syscall_event(event_pre_syscall); drmgr_register_post_syscall_event(event_post_syscall); if (drsys_filter_all_syscalls() != DRMF_SUCCESS) ASSERT(false, "drsys_filter_all_syscalls should never fail"); open_log_file(); const_arrays_num = get_const_arrays_num(); hashtable_init(&nconsts_table, HASHTABLE_BITSIZE, HASH_STRING, false); while (i < const_arrays_num) { const_values_t *named_consts = const_struct_array[i]; bool res = hashtable_add(&nconsts_table, (void *) named_consts[0].const_name, (void *) named_consts); if (!res) ASSERT(false, "drstrace failed to add to hashtable"); i++; } }