Ejemplo n.º 1
0
static void channel_redirection_listener(Channel * host, Channel * target) {
    if (target->state == ChannelStateStarted) {
#if SERVICE_LineNumbers
        ini_line_numbers_service(target->protocol);
#endif
#if SERVICE_Symbols
        ini_symbols_service(target->protocol);
#endif
#if ENABLE_DebugContext && ENABLE_ContextProxy
        ini_context_proxy_service(target->protocol);
#endif
    }
    if (target->state == ChannelStateConnected) {
        int i;
#if SERVICE_LineNumbers
        int service_ln = 0;
#endif
#if SERVICE_PathMap
#  if ENABLE_DebugContext && ENABLE_ContextProxy
        int service_pm = 0;
#  endif
#endif
#if SERVICE_Symbols
        int service_sm = 0;
#endif
#if SERVICE_Disassembly
        int service_da = 0;
#endif
#if ENABLE_DebugContext && ENABLE_ContextProxy
        int forward_pm = 0;
#endif
        for (i = 0; i < target->peer_service_cnt; i++) {
            char * nm = target->peer_service_list[i];
            /* Added this line to avoid build warnings if none of the
             * services below are defined (note that nm may be used
             * in TARGET_SERVICE_CHECK_HOOK() macro). */
            if (nm);
#if SERVICE_LineNumbers
            if (strcmp(nm, "LineNumbers") == 0) service_ln = 1;
#endif
#if SERVICE_Symbols
            if (strcmp(nm, "Symbols") == 0) service_sm = 1;
#endif
#if SERVICE_PathMap
#  if ENABLE_DebugContext && ENABLE_ContextProxy
            if (strcmp(nm, "PathMap") == 0) service_pm = 1;
#  endif
#endif
#if SERVICE_Disassembly
            if (strcmp(nm, "Disassembly") == 0) service_da = 1;
#endif
            TARGET_SERVICE_CHECK_HOOK;
        }
#if SERVICE_PathMap
        ini_path_map_service(host->protocol, bcg);
#  if ENABLE_DebugContext && ENABLE_ContextProxy
        if (service_pm) forward_pm = 1;
#  endif
#endif
#if SERVICE_LineNumbers
        if (!service_ln) ini_line_numbers_service(host->protocol);
#endif
#if SERVICE_Symbols
        if (!service_sm) ini_symbols_service(host->protocol);
#endif
#if SERVICE_Disassembly
        if (!service_da) ini_disassembly_service(host->protocol);
#endif
#if SERVICE_Expressions
        ini_expressions_service(host->protocol);
#endif
#if ENABLE_DebugContext && ENABLE_ContextProxy
        create_context_proxy(host, target, forward_pm);
#endif
    }
}
Ejemplo n.º 2
0
void ini_services(Protocol * proto, TCFBroadcastGroup * bcg) {
#if SERVICE_Locator
    ini_locator_service(proto, bcg);
#endif
#if SERVICE_RunControl
    ini_run_ctrl_service(proto, bcg);
#endif
#if SERVICE_Breakpoints
    ini_breakpoints_service(proto, bcg);
#endif
#if SERVICE_Memory
    ini_memory_service(proto, bcg);
#endif
#if SERVICE_MemoryMap
    ini_memory_map_service(proto, bcg);
#endif
#if SERVICE_Registers
    ini_registers_service(proto, bcg);
#endif
#if SERVICE_StackTrace
    ini_stack_trace_service(proto, bcg);
#endif
#if SERVICE_Symbols
    ini_symbols_service(proto);
#elif ENABLE_SymbolsProxy
    ini_symbols_lib();
#endif
#if SERVICE_LineNumbers
    ini_line_numbers_service(proto);
#elif ENABLE_LineNumbersProxy
    ini_line_numbers_lib();
#endif
#if SERVICE_Processes
    ini_processes_service(proto);
#endif
#if SERVICE_FileSystem
    ini_file_system_service(proto);
#endif
#if SERVICE_SysMonitor
    ini_sys_mon_service(proto);
#endif
#if SERVICE_Expressions
    ini_expressions_service(proto);
#endif
#if SERVICE_Streams
    ini_streams_service(proto);
#endif
#if SERVICE_PathMap
    ini_path_map_service(proto, bcg);
#endif
#if SERVICE_Terminals
    ini_terminals_service(proto);
#endif
#if ENABLE_DebugContext
    ini_contexts();
#endif
#if ENABLE_ELF
    ini_elf();
#endif
#if ENABLE_Plugins
    plugins_load(proto, bcg);
#endif

    ini_diagnostics_service(proto);
    ini_ext_services(proto, bcg);
}