

def init(self):
    if (not is_connected()):
        return
    init = S.SESSION.read()
    S.SESSION.send(dbgp.FEATURE_SET, n='show_hidden', v=1)
    response = S.SESSION.read()
    max_children = get_value(S.KEY_MAX_CHILDREN)
    if ((max_children is not False) and (max_children is not True) and (H.is_number(max_children) or H.is_digit(max_children))):
        S.SESSION.send(dbgp.FEATURE_SET, n=dbgp.FEATURE_NAME_MAXCHILDREN, v=max_children)
        response = S.SESSION.read()
    max_data = get_value(S.KEY_MAX_DATA)
    if ((max_data is not False) and (max_data is not True) and (H.is_number(max_data) or H.is_digit(max_data))):
        S.SESSION.send(dbgp.FEATURE_SET, n=dbgp.FEATURE_NAME_MAXDATA, v=max_data)
        response = S.SESSION.read()
    max_depth = get_value(S.KEY_MAX_DEPTH)
    if ((max_depth is not False) and (max_depth is not True) and (H.is_number(max_depth) or H.is_digit(max_depth))):
        S.SESSION.send(dbgp.FEATURE_SET, n=dbgp.FEATURE_NAME_MAXDEPTH, v=max_depth)
        response = S.SESSION.read()
    for (filename, breakpoint_data) in S.BREAKPOINT.items():
        if breakpoint_data:
            for (lineno, bp) in breakpoint_data.items():
                if bp['enabled']:
                    self.set_breakpoint(filename, lineno, bp['expression'])
                    debug(((('breakpoint_set: ' + filename) + ':') + lineno))
    break_on_exception = get_value(S.KEY_BREAK_ON_EXCEPTION)
    if isinstance(break_on_exception, list):
        for exception_name in break_on_exception:
            self.set_exception(exception_name)
    if get_value(S.KEY_BREAK_ON_START):
        fileuri = init.get(dbgp.INIT_FILEURI)
        filename = get_real_path(fileuri)
        self.status_message('Xdebug: Break on start')
        info(('Break on start: ' + filename))
        S.BREAKPOINT_ROW = {
            'filename': filename,
            'lineno': 1,
        }
        self.timeout((lambda : show_file(filename, 1)))
        context = self.get_context_values()
        self.timeout((lambda : show_content(DATA_CONTEXT, context)))
        stack = self.get_stack_values()
        if (not stack):
            stack = H.unicode_string('[{level}] {filename}.{where}:{lineno}\n'.format(level=0, where='{main}', lineno=1, filename=fileuri))
        self.timeout((lambda : show_content(DATA_STACK, stack)))
        self.watch_expression()
    else:
        self.run_command('xdebug_execute', {
            'command': 'run',
        })

dataset/ETHPy150Open martomo/SublimeTextXdebug/xdebug/session.py SocketHandler.init/original