<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 編程調試 [TOC] 使用`Swoole`協程時,可以使用下面的方法進行調試 ## GDB調試 #### 進入 gdb ~~~ gdb php test.php ~~~ #### gdbinit ~~~ (gdb) source /path/to/swoole-src/gdbinit ~~~ #### 設置斷點 例如`co::sleep`函數 ~~~ (gdb) b zim_swoole_coroutine_util_sleep ~~~ #### 打印當前進程的所有協程和狀態 ~~~ (gdb) co_list coroutine 1 SW_CORO_YIELD coroutine 2 SW_CORO_RUNNING ~~~ #### 打印當前運行時協程的調用棧 ~~~ (gdb) co_bt coroutine cid:[2] [0x7ffff148a100] Swoole\Coroutine->sleep(0.500000) [internal function] [0x7ffff148a0a0] {closure}() /home/shiguangqi/php/swoole-src/examples/coroutine/exception/test.php:7 [0x7ffff141e0c0] go(object[0x7ffff141e110]) [internal function] [0x7ffff141e030] (main) /home/shiguangqi/php/swoole-src/examples/coroutine/exception/test.php:10 ~~~ #### 打印指定協程id的調用戰 ~~~ (gdb) co_bt 1 [0x7ffff1487100] Swoole\Coroutine->sleep(0.500000) [internal function] [0x7ffff14870a0] {closure}() /home/shiguangqi/php/swoole-src/examples/coroutine/exception/test.php:3 [0x7ffff141e0c0] go(object[0x7ffff141e110]) [internal function] [0x7ffff141e030] (main) /home/shiguangqi/php/swoole-src/examples/coroutine/exception/test.php:10 ~~~ #### 打印全局協程的狀態 ~~~ (gdb) co_status stack_size: 2097152 call_stack_size: 1 active: 1 coro_num: 2 max_coro_num: 3000 peak_coro_num: 2 ~~~ ## PHP代碼調試 遍歷當前進程內的所有協程,并打印調用棧。 ~~~ function Coroutine::listCoroutines() : Iterator ~~~ > 需要`4.1.0`或更高版本 * 返回迭代器,可使用`foreach`遍歷,或使用`iterator_to_array`轉為數組 ~~~ $coros = Coroutine::listCoroutines(); foreach($coros as $cid) { var_dump(Coroutine::getBackTrace($cid)); } ~~~
                  <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>

                              哎呀哎呀视频在线观看