core/dynamo.c
/* To make DynamoRIO useful as a library for a standalone client
 * application (as opposed to a client library that works with
 * DynamoRIO in executing a target application).  This makes DynamoRIO
 * useful as an IA-32 disassembly library, etc.  
 */
To make DynamoRIO useful as a library for a standalone client
application (as opposed to a client library that works with
DynamoRIO in executing a target application).  This makes DynamoRIO
useful as an IA-32 disassembly library, etc.
To make DynamoRIO useful as a library for a standalone client application ( as opposed to a client library that works with DynamoRIO in executing a target application ) . This makes DynamoRIO useful as an IA - 32 disassembly library etc .
dcontext_t *
standalone_init(void)
{
    dcontext_t *dcontext;
    standalone_library = true;
    stats = &nonshared_stats;
#ifdef WINDOWS
    syscalls_init();
#endif
    config_init();
    options_init();
    vmm_heap_init();
    heap_init();
    dynamo_heap_initialized = true;
    dynamo_vm_areas_init();
    proc_init();
    os_init();
    os_tls_init();
    dcontext = create_new_dynamo_context(true, NULL);
    set_thread_private_dcontext(dcontext);
    ASSERT(get_thread_private_dcontext() == dcontext);
    heap_thread_init(dcontext);
#ifdef STANDALONE_UNIT_TEST
    nonshared_stats.logmask = LOG_ALL;
    options_init();
    if (stats->loglevel > 0) {
        char initial_options[MAX_OPTIONS_STRING];
        main_logfile = open_log_file(main_logfile_name(), NULL, 0);
        print_file(main_logfile, "%s\n", dynamorio_version_string);
        print_file(main_logfile, "Log file for standalone unit test\n");
        get_dynamo_options_string(&dynamo_options, 
                                  initial_options, sizeof(initial_options), true);
        SYSLOG_INTERNAL_INFO("Initial options = %s", initial_options);
        print_file(main_logfile, "\n");
    }
#endif
    dynamo_initialized = true;
    return dcontext;
}
dcontext_t * standalone_init ( void ) { dcontext_t * dcontext ; standalone_library = true ; stats = & nonshared_stats ; #ifdef WINDOWS syscalls_init ( ) ; #endif config_init ( ) ; options_init ( ) ; vmm_heap_init ( ) ; heap_init ( ) ; dynamo_heap_initialized = true ; dynamo_vm_areas_init ( ) ; proc_init ( ) ; os_init ( ) ; os_tls_init ( ) ; dcontext = create_new_dynamo_context ( true , NULL ) ; set_thread_private_dcontext ( dcontext ) ; ASSERT ( get_thread_private_dcontext ( ) == dcontext ) ; heap_thread_init ( dcontext ) ; #ifdef STANDALONE_UNIT_TEST nonshared_stats . logmask = LOG_ALL ; options_init ( ) ; if ( stats -> loglevel > 0 ) { char initial_options [ MAX_OPTIONS_STRING ] ; main_logfile = open_log_file ( main_logfile_name ( ) , NULL , 0 ) ; print_file ( main_logfile , " \n " , dynamorio_version_string ) ; print_file ( main_logfile , " \n " ) ; get_dynamo_options_string ( & dynamo_options , initial_options , sizeof ( initial_options ) , true ) ; SYSLOG_INTERNAL_INFO ( " " , initial_options ) ; print_file ( main_logfile , " \n " ) ; } #endif dynamo_initialized = true ; return dcontext ; }
To make DynamoRIO useful as a library for a standalone client
 application (as opposed to a client library that works with
 DynamoRIO in executing a target application).
To make DynamoRIO useful as a library for a standalone client application ( as opposed to a client library that works with DynamoRIO in executing a target application ) .
/* We have release-build stats now so this is not just DEBUG */ /* FIXME: I believe we only need dcontext for the heap.
     * Nothing else should fail, unless client calls something that's
     * not initialized...for now we blame client if that happens.
     */ /* MUST do this before making any system calls */ /*initial*/ /* sanity check */ /* FIXME: share code w/ main init routine? */