

def execute(self, command):
    if ((not command) or (not is_connected())):
        return
    S.SESSION.send(command)
    response = S.SESSION.read()
    S.BREAKPOINT_EXCEPTION = None
    S.BREAKPOINT_ROW = None
    S.CONTEXT_DATA.clear()
    self.watch_expression()
    self.run_command('xdebug_layout')
    for child in response:
        if ((child.tag == dbgp.ELEMENT_BREAKPOINT) or (child.tag == dbgp.ELEMENT_PATH_BREAKPOINT)):
            fileuri = child.get(dbgp.BREAKPOINT_FILENAME)
            lineno = child.get(dbgp.BREAKPOINT_LINENO)
            exception = child.get(dbgp.BREAKPOINT_EXCEPTION)
            filename = get_real_path(fileuri)
            if exception:
                info(((exception + ': ') + child.text))
                S.BREAKPOINT_EXCEPTION = {
                    'name': exception,
                    'message': child.text.split('\n')[0],
                    'filename': fileuri,
                    'lineno': lineno,
                }
            if ((S.BREAKPOINT_RUN is not None) and (S.BREAKPOINT_RUN['filename'] == filename) and (S.BREAKPOINT_RUN['lineno'] == lineno)):
                if ((S.BREAKPOINT_RUN['filename'] in S.BREAKPOINT) and (S.BREAKPOINT_RUN['lineno'] in S.BREAKPOINT[S.BREAKPOINT_RUN['filename']])):
                    self.run_view_command('xdebug_breakpoint', {
                        'rows': [S.BREAKPOINT_RUN['lineno']],
                        'filename': S.BREAKPOINT_RUN['filename'],
                    })
                S.BREAKPOINT_RUN = None
            if ((S.BREAKPOINT_RUN is not None) and ((S.BREAKPOINT_RUN['filename'] != filename) or (S.BREAKPOINT_RUN['lineno'] != lineno))):
                self.run_command('xdebug_execute', {
                    'command': 'run',
                })
                return
            self.status_message('Xdebug: Breakpoint')
            info(((('Break: ' + filename) + ':') + lineno))
            S.BREAKPOINT_ROW = {
                'filename': filename,
                'lineno': lineno,
            }
            self.timeout((lambda : show_file(filename, lineno)))
    if (response.get(dbgp.ATTRIBUTE_STATUS) == dbgp.STATUS_BREAK):
        context = self.get_context_values()
        self.timeout((lambda : show_content(DATA_CONTEXT, context)))
        stack = self.get_stack_values()
        self.timeout((lambda : show_content(DATA_STACK, stack)))
        self.watch_expression()
    if ((response.get(dbgp.ATTRIBUTE_STATUS) == dbgp.STATUS_STOPPING) or (response.get(dbgp.ATTRIBUTE_STATUS) == dbgp.STATUS_STOPPED)):
        self.run_command('xdebug_session_stop', {
            'restart': True,
        })
        self.run_command('xdebug_session_start', {
            'restart': True,
        })
        self.status_message('Xdebug: Finished executing file on server. Reload page to continue debugging.')
    self.timeout((lambda : render_regions()))

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