<commit_before>if !exists("s:init")
    let s:init = 1
    " exists("*logger#getLogger")
    silent! let s:log = logger#getLogger(expand('<sfile>:t'))

    let s:symbols = {}
endif


function! neobugger#gdb#server#Conf() abort
    " user special config
    let this = {
        \ "module" : "gdb",
        \ "Scheme" : 'neobugger#gdb#basic#Conf',
        \ "Inherit": 'neobugger#gdb#server#New',
        \
        \ "autorun" : 0,
        \ "reconnect" : 0,
        \ "showbreakpoint" : 1,
        \ "showbacktrace" : 1,
        \ "conf_gdb_layout" : ["vsp"],
        \ "conf_gdb_cmd" : ["gdb -ex 'echo neobugger_starting\n' -q -f", 'sysinit/init'],
        \ "conf_server_cmd" : ["$SHELL",],
        \ "conf_server_addr" : ["",],
        \ "state" : {
        \   "gdbserver": [
        \       {   "match":   ['\v^Remote debugging from host '],
        \           "hint":    "server.GdbClientConnected",
        \           "window":  "",
        \           "action":  "call",
        \           "arg0":    "on_remote_debugging",
        \       },
        \   ]
        \ }
        \ }


    function this.on_remote_debugging(funcname, ...)
        silent! call s:log.info(self.module.".Scheme.".a:funcname." args=", string(a:000))
        call neobugger#Handle(self.module, a:funcname, a:000)
    endfunction

    return this
endfunc


function! neobugger#gdb#server#New()
    let this = tlib#Object#New({
                \ '_class': ['GdbServer'],
                \ })


    function! this.Init()
        let l:__func__ = "server.Init"
        if !has_key(self, "_server_id")
            echoerr l:__func__. "(): GdbServer window not exist."
            return
        endif
        if empty(self._server_addr)
            echoerr l:__func__. "(): server address is empty."
            return
        endif

        let self._vdom = 0
        let self._worker_pid = 0
        let self._debug_level = 0
        let self._remote_debugging = 0

        silent! call s:log.info(l:__func__, " args=", string(self.args))
        let l:cmdstr = 'login.py -h '. self._server_addr[0].' '.join(self.args.args[1:], ' ')
        silent! call s:log.info(l:__func__, " cmdstr=", l:cmdstr)
        call self.SendSvr(l:cmdstr)
    endfunction


    function! this.Symbol(type, expr)
        let l:__func__ = "server.Symbol"
        silent! call s:log.info(l:__func__, " type=", a:type, " expr=", a:expr)<commit_msg>improve dut.py: rename login.py to dut.py<commit_after>if !exists("s:init")
    let s:init = 1
    " exists("*logger#getLogger")
    silent! let s:log = logger#getLogger(expand('<sfile>:t'))

    let s:symbols = {}
endif


function! neobugger#gdb#server#Conf() abort
    " user special config
    let this = {
        \ "module" : "gdb",
        \ "Scheme" : 'neobugger#gdb#basic#Conf',
        \ "Inherit": 'neobugger#gdb#server#New',
        \
        \ "autorun" : 0,
        \ "reconnect" : 0,
        \ "showbreakpoint" : 1,
        \ "showbacktrace" : 1,
        \ "conf_gdb_layout" : ["vsp"],
        \ "conf_gdb_cmd" : ["gdb -ex 'echo neobugger_starting\n' -q -f", 'sysinit/init'],
        \ "conf_server_cmd" : ["$SHELL",],
        \ "conf_server_addr" : ["",],
        \ "state" : {
        \   "gdbserver": [
        \       {   "match":   ['\v^Remote debugging from host '],
        \           "hint":    "server.GdbClientConnected",
        \           "window":  "",
        \           "action":  "call",
        \           "arg0":    "on_remote_debugging",
        \       },
        \   ]
        \ }
        \ }


    function this.on_remote_debugging(funcname, ...)
        silent! call s:log.info(self.module.".Scheme.".a:funcname." args=", string(a:000))
        call neobugger#Handle(self.module, a:funcname, a:000)
    endfunction

    return this
endfunc


function! neobugger#gdb#server#New()
    let this = tlib#Object#New({
                \ '_class': ['GdbServer'],
                \ })


    function! this.Init()
        let l:__func__ = "server.Init"
        if !has_key(self, "_server_id")
            echoerr l:__func__. "(): GdbServer window not exist."
            return
        endif
        if empty(self._server_addr)
            echoerr l:__func__. "(): server address is empty."
            return
        endif

        let self._vdom = 0
        let self._worker_pid = 0
        let self._debug_level = 0
        let self._remote_debugging = 0

        silent! call s:log.info(l:__func__, " args=", string(self.args))
        let l:cmdstr = 'dut.py -h '. self._server_addr[0].' '.join(self.args.args[1:], ' ')
        silent! call s:log.info(l:__func__, " cmdstr=", l:cmdstr)
        call self.SendSvr(l:cmdstr)
    endfunction


    function! this.Symbol(type, expr)
        let l:__func__ = "server.Symbol"
        silent! call s:log.info(l:__func__, " type=", a:type, " expr=", a:expr)
{'fraction_non_alphanumeric': 0.15950413223140497, 'fraction_numerical': 0.00743801652892562, 'mean_word_length': 1.9005392450569203, 'pattern_counts': {'":': 14, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '105900', 'n_tokens_mistral': 1713, 'n_tokens_neox': 1656, 'n_words': 312}