<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                ### 穩定度: 2 - 穩定 V8自帶了一個強大的調試器,可以從外部通過TCP協議訪問。`io.js`為這個調試器內建了一個客戶端。要使用它的話,使用`debug`參數啟動`io.js`;會出現提示符: ~~~ % iojs debug myscript.js < debugger listening on port 5858 connecting... ok break in /home/indutny/Code/git/indutny/myscript.js:1 1 x = 5; 2 setTimeout(function () { 3 debugger; debug> ~~~ `io.js`的調試器客戶端并未支持所有的命令,但是簡單的步進和調試都是可以的。通過在源代碼就放置`debugger;`語句,你可以啟用一個斷點。 例如,假設又一個這樣的`myscript.js`: ~~~ // myscript.js x = 5; setTimeout(function () { debugger; console.log("world"); }, 1000); console.log("hello"); ~~~ 那么一旦你打開調試器,它會在第四行中斷。 ~~~ % iojs debug myscript.js < debugger listening on port 5858 connecting... ok break in /home/indutny/Code/git/indutny/myscript.js:1 1 x = 5; 2 setTimeout(function () { 3 debugger; debug> cont < hello break in /home/indutny/Code/git/indutny/myscript.js:3 1 x = 5; 2 setTimeout(function () { 3 debugger; 4 console.log("world"); 5 }, 1000); debug> next break in /home/indutny/Code/git/indutny/myscript.js:4 2 setTimeout(function () { 3 debugger; 4 console.log("world"); 5 }, 1000); 6 console.log("hello"); debug> repl Press Ctrl + C to leave debug repl > x 5 > 2+2 4 debug> next < world break in /home/indutny/Code/git/indutny/myscript.js:5 3 debugger; 4 console.log("world"); 5 }, 1000); 6 console.log("hello"); 7 debug> quit % ~~~ `repl`命令允許你遠程地執行代碼。`next`命令步進到下一行。還有一些其他的可用命令,輸入`help`查看它們。 #### Watchers 在調試代碼時,你可監視表達式和變量的值。在每個斷點,監視器列表上的每個表達式會被在當前上下文執行,并且斷點的源代碼前展示。 為了開始監視一個表達式,輸入`watch("my_expression")`。`watchers`打印可用的監視器。為了移除一個監視器,輸入`unwatch("my_expression")`。 #### 命令參考 **Stepping** - cont, c - 繼續執行 - next, n - 下一步 - step, s - 介入(Step in) - out, o - 離開(Step out) - pause - 暫停代碼執行(類似開發者工具中的暫停按鈕) **Breakpoints** - setBreakpoint(), sb() - 在當前行設置一個斷點 - setBreakpoint(line), sb(line) - 在指定行設置一個斷點 - setBreakpoint('fn()'), sb(...) - 在函數體的第一個語句上設置斷點 - setBreakpoint('script.js', 1), sb(...) - 在`script.js`的第一行設置斷點 - clearBreakpoint('script.js', 1), cb(...) - 清除`script.js`第一行的斷點 同樣也可以在一個還未載入的文件(模塊)中設置斷點: ~~~ % ./iojs debug test/fixtures/break-in-module/main.js < debugger listening on port 5858 connecting to port 5858... ok break in test/fixtures/break-in-module/main.js:1 1 var mod = require('./mod.js'); 2 mod.hello(); 3 mod.hello(); debug> setBreakpoint('mod.js', 23) Warning: script 'mod.js' was not loaded yet. 1 var mod = require('./mod.js'); 2 mod.hello(); 3 mod.hello(); debug> c break in test/fixtures/break-in-module/mod.js:23 21 22 exports.hello = function() { 23 return 'hello from module'; 24 }; 25 debug> ~~~ **Info** - backtrace, bt - 打印當前執行框架的回溯 - list(5) - 列出腳本源代碼的5行上下文(前5行和后5行) - watch(expr) - 為監視列表添加表達式 - unwatch(expr) - 從監視列表中移除表達式 - watchers - 列出所有的監視器和它們的值(會在每一個斷點自動列出) - repl - 在所調試的腳本上下文中打開調試器的`repl` **Execution control** - run - 運行腳本(在調試器開始時自動運行) - restart - 重啟腳本 - kill - 結束腳本 **Various** - scripts - 列出所有載入的腳本 - version - 展示V8版本 #### 高級使用 V8調試器可以通過 使用`--debug`命令行參數打開`io.js` 或 向一個已存在的`io.js`進程發送`SIGUSR1`信號 來啟用。 一旦一個進程被設置為了調試模式,它就可以被連接到`io.js`調試器。可以通過pid或URI來連接,語法為: - iojs debug -p - 通過pid連接進程 - iojs debug - 通過URI(如`localhost:5858`)連接進程
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看